-
Notifications
You must be signed in to change notification settings - Fork 2
배지 목록 조회 및 대표 배지 설정 기능 구현 #164
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
Open
Junad-Park
wants to merge
3
commits into
feature/setup-badge-domain
Choose a base branch
from
feature/badge-list-and-representative
base: feature/setup-badge-domain
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
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
12 changes: 12 additions & 0 deletions
12
...main/java/im/toduck/domain/badge/presentation/dto/request/RepresentativeBadgeRequest.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,12 @@ | ||
| package im.toduck.domain.badge.presentation.dto.request; | ||
|
|
||
| import io.swagger.v3.oas.annotations.media.Schema; | ||
| import jakarta.validation.constraints.NotNull; | ||
|
|
||
| @Schema(description = "대표 뱃지 설정 요청") | ||
| public record RepresentativeBadgeRequest( | ||
| @Schema(description = "설정할 뱃지 ID", example = "1") | ||
| @NotNull(message = "뱃지 ID는 필수입니다.") | ||
| Long badgeId | ||
| ) { | ||
| } |
31 changes: 31 additions & 0 deletions
31
src/main/java/im/toduck/domain/badge/presentation/dto/response/BadgeListResponse.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,31 @@ | ||
| package im.toduck.domain.badge.presentation.dto.response; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| import io.swagger.v3.oas.annotations.media.Schema; | ||
| import lombok.Builder; | ||
|
|
||
| @Builder | ||
| @Schema(description = "내 뱃지 목록 조회 응답") | ||
| public record BadgeListResponse( | ||
| @Schema(description = "전체 뱃지 개수") | ||
| long totalCount, | ||
|
|
||
| @Schema(description = "대표 뱃지 ID (없으면 null)") | ||
| Long representativeBadgeId, | ||
|
|
||
| @Schema(description = "보유한 뱃지 리스트") | ||
| List<BadgeResponse> ownedBadges | ||
| ) { | ||
| public static BadgeListResponse of( | ||
| final long totalCount, | ||
| final Long representativeBadgeId, | ||
| final List<BadgeResponse> ownedBadges | ||
| ) { | ||
| return BadgeListResponse.builder() | ||
| .totalCount(totalCount) | ||
| .representativeBadgeId(representativeBadgeId) | ||
| .ownedBadges(ownedBadges) | ||
| .build(); | ||
| } | ||
| } |
20 changes: 9 additions & 11 deletions
20
...ge/common/dto/response/BadgeResponse.java → ...sentation/dto/response/BadgeResponse.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
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 |
|---|---|---|
|
|
@@ -127,6 +127,7 @@ public enum ExceptionCode { | |
| /* 413xx Badge */ | ||
| NOT_FOUND_BADGE(HttpStatus.NOT_FOUND, 41301, "뱃지를 찾을 수 없습니다."), | ||
| ALREADY_ACQUIRED_BADGE(HttpStatus.CONFLICT, 41302, "이미 획득한 뱃지입니다."), | ||
| NOT_OWNED_BADGE(HttpStatus.FORBIDDEN, 41303, "보유하지 않은 뱃지입니다."), | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. p3: |
||
|
|
||
| /* 431xx schedule */ | ||
| NOT_FOUND_SCHEDULE_RECORD(HttpStatus.NOT_FOUND, 43101, "일정 기록을 찾을 수 없습니다.", | ||
|
|
||
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.
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.
p5: 현재는 "대표 배지를 다른 배지로 변경"만 가능한 것 같은데, 대표 배지를 해제(null로 설정)하는 케이스는 요구사항에 없는 걸까요? 만약 추후에 필요할 수 있다면 badgeId를 nullable로 받아서 해제도 지원하는 것도 고려해볼 수 있을 것 같아서 여쭤봅니다.