-
Notifications
You must be signed in to change notification settings - Fork 1
product 1.0.1 #410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
product 1.0.1 #410
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5d6cc4a
feat: enhance README with detailed bottle note features and images
hgkim-openerd c927628
Merge remote-tracking branch 'origin/dev' into dev
hgkim-openerd 0cde894
feat: update whiskey search API requests with new parameters and incr…
hgkim-openerd 432f471
New Feature: Admin Permissions Management (#409)
hgkim-openerd 6d24452
feat: update profanity filter API URLs and keys in environment files
hgkim-openerd b5ced75
fix: update git.environment-variables with new hash value
hgkim-openerd bf9e49c
Feat/token provider (#411)
hgkim-openerd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,59 @@ | ||
|  | ||
|
|
||
| > Bottle note 프로젝트의 API 서버입니다. | ||
|
|
||
| ## Bottle Note Api Server | ||
| <img src="https://github.com/bottle-note/.github/assets/97773895/fa515094-a490-4b7b-9bca-026752fe3de1" alt="Image 1" width="49.5%"/> | ||
| <img src="https://github.com/bottle-note/.github/assets/97773895/98a69d6d-af4f-4365-ac6c-b3e7bdd6aed1" alt="Image 4" width="49.5%"/> | ||
| <img src="https://github.com/bottle-note/.github/assets/97773895/5877ab4b-af23-4767-aebc-5e97a35a89ba" alt="Image 3" width="49.5%"/> | ||
| <img src="https://github.com/bottle-note/.github/assets/97773895/039cf3df-7169-46ed-a76b-72de6f1a1217" alt="Image 2" width="49.5%"/> | ||
| <br/> | ||
|
|
||
| ### 개요(Overview) | ||
| ## *bottle note* | ||
|
|
||
| > Bottle note 프로젝트의 API 서버입니다. | ||
| --- | ||
|
|
||
| **📄*내 입맛에 딱 맞는 한병을 찾아가는 여정노트*** | ||
|
|
||
| 보틀노트는 위스키 애호가들이 모여 서로의 의견을 공유하고, 더욱 즐겁고 유익한 시음 경험을 할 수 있도록 도와줍니다. <br/> | ||
| 위스키에 대한 열정을 함께 나눠보세요! 쉽고 편리하게 위스키 평가와 리뷰를 공유할 수 있어요! | ||
|
|
||
| --- | ||
|
|
||
| **🥃 위스키 별점 및 리뷰 작성** | ||
|
|
||
| 위스키를 시음한 후 별점을 부여하고, 상세한 리뷰를 작성해 보세요! <br/> | ||
| 맛, 향, 느낌 등 다양한 측면을 기록하고 공유할 수 있습니다. <br/> | ||
| 가격을 입력하고, 시음한 장소를 태그하여 좋은 경험한 장소를 기록해 보는건 어때요?<br/> | ||
| <br/> | ||
|
|
||
| **🥃 위스키 정보 및 리뷰 보기** | ||
|
|
||
| 위스키의 상세 정보와 다른 사용자의 리뷰를 쉽게 확인할 수 있습니다. <br/> | ||
| 다양한 의견을 통해 다른 사람들이 위스키를 어떻게 평가했는지 알 수 있고 <br/> | ||
| 새로운 위스키를 시도해볼 수 있어요!<br/> | ||
| <br/> | ||
|
|
||
| **🥃 찜하기 기능으로 위스키 목록 관리** | ||
|
|
||
| 관심 있는 위스키를 찜하기 기능을 통해 목록에 추가하고 <br/> | ||
| 찜한 위스키 목록을 통해 나만의 위스키 컬렉션을 만들 수 있어요!<br/> | ||
| <br/> | ||
| **🥃 다른 유저와 팔로우 및 별점 보기** | ||
|
|
||
| 다른 사용자를 팔로우하여 그들의 별점과 리뷰를 볼 수 있어요! <br/> | ||
| 나의 팔로워들은 어떤 평가를 했을까요? <br/> | ||
| 팔로워가 나와 취향이 비슷하다면, 내 입맛에 맞는 새로운 위스키를 알 수 있을지도?<br/> | ||
| <br/> | ||
|
|
||
| **🥃 나의 평가 및 별점 기록 관리** | ||
|
|
||
| 내가 평가한 위스키와 부여한 별점을 한눈에 볼 수 있어요! <br/> | ||
| 나만의 위스키 평가 기록을 통해 나의 취향을 분석하고 다음 시음을 계획해보세요!<br/> | ||
| <br/> | ||
|
|
||
| --- | ||
|
|
||
| 보틀노트는 위스키 애호가들이 모여 서로의 의견을 공유하고 <br/> | ||
| 더욱 즐겁고 유익한 시음 경험을 할 수 있도록 도와줍니다. | ||
|
|
||
|  | ||
|  | ||
|  | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule git.environment-variables
updated
from cd96d7 to 2bf643
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| === 루트 관리자 권한 검증 === | ||
|
|
||
| - 현재 로그인한 사용자가 루트 관리자 권한을 가지고 있는지 검증합니다. | ||
| - 개발 / 운영 환경이 변경 가능한지 검증하는데 활용 할 수 있습니다. | ||
|
|
||
| [source] | ||
| ---- | ||
| api/v2/auth/admin/permissions | ||
| ---- | ||
|
|
||
| [discrete] | ||
| ==== 요청 파라미터 ==== | ||
|
|
||
| [discrete] | ||
| include::{snippets}/auth/admin/root-permissions/curl-request.adoc[] | ||
| include::{snippets}/auth/admin/root-permissions/http-request.adoc[] | ||
|
|
||
| [discrete] | ||
| ==== 응답 파라미터 ==== | ||
|
|
||
| [discrete] | ||
| include::{snippets}/auth/admin/root-permissions/response-fields.adoc[] | ||
| include::{snippets}/auth/admin/root-permissions/http-response.adoc[] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/main/java/app/bottlenote/global/security/jwt/JwtProperties.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| package app.bottlenote.global.security.jwt; | ||
|
|
||
| import lombok.AccessLevel; | ||
| import lombok.AllArgsConstructor; | ||
| import lombok.Getter; | ||
| import lombok.NoArgsConstructor; | ||
| import lombok.Setter; | ||
| import org.springframework.boot.context.properties.ConfigurationProperties; | ||
| import org.springframework.boot.context.properties.ConfigurationPropertiesScan; | ||
| import org.springframework.context.annotation.Configuration; | ||
|
|
||
| @Setter | ||
| @Getter | ||
| @Configuration | ||
| @AllArgsConstructor(access = AccessLevel.PRIVATE) | ||
| @NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
| @ConfigurationProperties(prefix = "security.jwt") | ||
| @ConfigurationPropertiesScan | ||
| public class JwtProperties { | ||
| private String secretKey; | ||
| private long accessTokenExpiration; | ||
| private long refreshTokenExpiration; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/main/java/app/bottlenote/user/controller/AuthV2Controller.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| package app.bottlenote.user.controller; | ||
|
|
||
| import app.bottlenote.global.data.response.GlobalResponse; | ||
| import app.bottlenote.global.security.SecurityContextUtil; | ||
| import app.bottlenote.user.exception.UserException; | ||
| import app.bottlenote.user.service.AuthService; | ||
| import lombok.RequiredArgsConstructor; | ||
| import lombok.extern.slf4j.Slf4j; | ||
| import org.springframework.http.ResponseEntity; | ||
| import org.springframework.web.bind.annotation.GetMapping; | ||
| import org.springframework.web.bind.annotation.RequestMapping; | ||
| import org.springframework.web.bind.annotation.RestController; | ||
|
|
||
| import static app.bottlenote.user.exception.UserExceptionCode.REQUIRED_USER_ID; | ||
|
|
||
|
|
||
| @Slf4j | ||
| @RestController | ||
| @RequiredArgsConstructor | ||
| @RequestMapping("/api/v2/auth") | ||
| public class AuthV2Controller { | ||
| private final AuthService authService; | ||
|
|
||
| @GetMapping("/admin/permissions") | ||
| public ResponseEntity<?> checkAdminStatus() { | ||
| Long currentUserId = SecurityContextUtil.getUserIdByContext(). | ||
| orElseThrow(() -> new UserException(REQUIRED_USER_ID)); | ||
|
|
||
| boolean is = authService.checkAdminStatus(currentUserId); | ||
| return GlobalResponse.ok(is); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| package app.bottlenote.user.domain; | ||
|
|
||
| import jakarta.persistence.Column; | ||
| import jakarta.persistence.Entity; | ||
| import jakarta.persistence.FetchType; | ||
| import jakarta.persistence.Id; | ||
| import jakarta.persistence.JoinColumn; | ||
| import jakarta.persistence.MapsId; | ||
| import jakarta.persistence.OneToOne; | ||
| import jakarta.persistence.Table; | ||
| import lombok.AccessLevel; | ||
| import lombok.Getter; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
| @Getter | ||
| @Entity(name = "root_admins") | ||
| @Table(name = "root_admins") | ||
| @NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
| public class RootAdmin { | ||
|
|
||
| @Id | ||
| @Column(name = "user_id") | ||
| private Long userId; | ||
|
|
||
| @OneToOne(fetch = FetchType.LAZY) | ||
| @JoinColumn(name = "user_id") | ||
| @MapsId | ||
| private User user; | ||
| } |
8 changes: 8 additions & 0 deletions
8
src/main/java/app/bottlenote/user/repository/RootAdminRepository.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| package app.bottlenote.user.repository; | ||
|
|
||
| import app.bottlenote.user.domain.RootAdmin; | ||
| import org.springframework.data.jpa.repository.JpaRepository; | ||
|
|
||
| public interface RootAdminRepository extends JpaRepository<RootAdmin, Long> { | ||
| boolean existsByUserId(Long userId); | ||
| } |
20 changes: 20 additions & 0 deletions
20
src/main/java/app/bottlenote/user/service/AuthService.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| package app.bottlenote.user.service; | ||
|
|
||
| import app.bottlenote.user.repository.RootAdminRepository; | ||
| import lombok.RequiredArgsConstructor; | ||
| import lombok.extern.slf4j.Slf4j; | ||
| import org.springframework.stereotype.Service; | ||
| import org.springframework.transaction.annotation.Transactional; | ||
|
|
||
| @Slf4j | ||
| @Service | ||
| @RequiredArgsConstructor | ||
| public class AuthService { | ||
|
|
||
| private final RootAdminRepository rootAdminRepository; | ||
|
|
||
| @Transactional(readOnly = true) | ||
| public boolean checkAdminStatus(Long userId) { | ||
| return rootAdminRepository.existsByUserId(userId); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] This paragraph duplicates content earlier in the README; consider removing the duplicate to streamline the document.