Repository navigation
feat: 플랜 구분 제거 · 사용 한도 UsageLimits로 통합 (#60) #61
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
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
e9bc8ab
refactor: 사용 한도를 UsageLimits로 모으고 plan 도메인 삭제 (#60)
chjpooh2002 6185d91
refactor: 회원의 플랜 지정값·정렬 기준 삭제 (#60)
chjpooh2002 569d19f
docs: CLAUDE.md에서 플랜 구분 내용 정리 (#60)
chjpooh2002 f8fdbc2
docs: 설정 API 삭제·한도 50 반영해 CLAUDE.md·PR 템플릿 예시 정리 (#60)
chjpooh2002 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
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
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
37 changes: 0 additions & 37 deletions
37
src/main/java/com/sniptext/domain/plan/service/PlanQueryService.java
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
src/main/java/com/sniptext/domain/plan/service/dto/result/PlanResult.java
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
src/main/java/com/sniptext/domain/user/entity/TemplateSort.java
This file was deleted.
Oops, something went wrong.
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
17 changes: 1 addition & 16 deletions
17
src/main/java/com/sniptext/domain/user/service/UserQueryService.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 |
|---|---|---|
| @@ -1,33 +1,18 @@ | ||
| package com.sniptext.domain.user.service; | ||
|
|
||
| import java.util.Optional; | ||
|
|
||
| import org.springframework.stereotype.Service; | ||
| import org.springframework.transaction.annotation.Transactional; | ||
|
|
||
| import com.sniptext.domain.user.entity.Plan; | ||
| import com.sniptext.domain.user.entity.User; | ||
| import com.sniptext.domain.user.exception.UserErrorCode; | ||
| import com.sniptext.domain.user.repository.UserRepository; | ||
| import com.sniptext.global.exception.BusinessException; | ||
|
|
||
| import lombok.RequiredArgsConstructor; | ||
|
|
||
| /** 회원 조회 (다른 도메인이 회원 정보를 읽을 때 쓰는 진입점). */ | ||
| @Service | ||
| @RequiredArgsConstructor | ||
| @Transactional(readOnly = true) | ||
| public class UserQueryService { | ||
|
|
||
| private final UserRepository userRepository; | ||
|
|
||
| /** | ||
| * 회원의 플랜 지정값(plan_override). 지정값이 없으면 빈 값이다. | ||
| * 현재 플랜 판정은 plan 도메인의 PlanQueryService가 하므로 여기서 기본값을 정하지 않는다. | ||
| */ | ||
| public Optional<Plan> findPlanOverride(Long userId) { | ||
| User user = userRepository.findByIdAndDeletedAtIsNull(userId) | ||
| .orElseThrow(() -> new BusinessException(UserErrorCode.USER_NOT_FOUND)); | ||
| return Optional.ofNullable(user.getPlanOverride()); | ||
| } | ||
|
|
||
| } |
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,18 @@ | ||
| package com.sniptext.global.policy; | ||
|
|
||
| /** | ||
| * 사용 한도. 모든 사용자에게 같다 (플랜 구분 없음). 한도 숫자는 여기 한 곳에서만 쓴다. | ||
| * 화면은 숫자를 직접 쓰지 않고 사용량 API의 limit을 쓴다. | ||
| */ | ||
| public final class UsageLimits { | ||
|
|
||
| /** 보유 템플릿 한도 (휴지통 제외 개수 기준) */ | ||
| public static final int TEMPLATE_LIMIT = 50; | ||
|
|
||
| /** AI 톤 교정 하루 한도 (KST 날짜 기준) */ | ||
| public static final int AI_TONE_DAILY_LIMIT = 5; | ||
|
|
||
| private UsageLimits() { | ||
| } | ||
|
|
||
| } |
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.
보유 템플릿 한도, AI 톤 교정 같은 경우는 각각 템플릿, ai 패키지로 이동해도 좋을 것 같기도 하구
둘이 분리되어있으면 너무 분리되어 있는 것 아닌가 싶기도 하네요 ㅎㅎ
한도라는 관점에서 전체적으로 사용될 여지가 있다는 생각이 들기도 하고, 한도라는 책임으로 묶는 게 나은 것 같아서
위치 좋은 것 같은 생각입니다!