-
Notifications
You must be signed in to change notification settings - Fork 2
[BOM-1031] feat: 연속 읽기 랭킹 조회 api #711
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
The head ref may contain hidden characters: "BOM-1031-\uC5F0\uC18D-\uC77D\uAE30-\uB7AD\uD0B9-\uC870\uD68C-api"
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
9895341
feat: 연속 읽기 랭킹용 flat 추가
kysub99 5753940
feat: flat 기준 뱃지 응답 변환 추가
kysub99 d87451b
feat: 연속 읽기 랭킹 응답 DTO 추가
kysub99 5dba4ab
feat: 연속 읽기 랭킹 쿼리 추가
kysub99 bfdbd74
feat: 연속 읽기 랭킹 서비스 및 API 연동
kysub99 fa8cf3e
test: 연속 읽기 랭킹 테스트
kysub99 24fc57c
fix: 나의 연속 읽기 순위에서 dayCount 0을 최하위 공동 순위로 반환
kysub99 6278d51
refactor: 연속 읽기 순위 Optional 사용
kysub99 c5da72f
feat: 연속 읽기 랭킹 스냅샷/메타 테이블 및 레파지토리 추가
kysub99 b71d264
feat: 연속 읽기 랭킹을 스냅샷 기반으로 조회
kysub99 a2056d2
feat: 연속 읽기 랭킹 DTO 수정
kysub99 cde89a8
test: 조회 구조 변경에 따른 테스트 수정
kysub99 58c72e8
refactor: required를 requiredMode로 변경
kysub99 73f034c
style: DTO 공백 추가
kysub99 b616413
refactor: cron 별도로 분리
kysub99 5fe908c
refactor: ASC 정렬 조건 명시 제거
kysub99 18d1245
refactor: 메서드 네이밍 변경
kysub99 b826935
refactor: 연속 읽기 실시간, 스냅샨 도메인 네이밍 수정
kysub99 5d6c9fb
feat: 연속 읽기 스냅샷을 월간 스냅샷과 동일한 구조로 변경
kysub99 1b1fc26
refactor: readOnly 트랜잭션 적용
kysub99 1cf7ef5
refactor: 불필요한 Schema 어노테이션 제거
kysub99 c5efb25
chore: flyway 버전 수정
kysub99 691fbfd
chore: 엔티티명 변경에 맞춰 테이블명 수정
kysub99 842868e
refactor: meta 테이블 통합
kysub99 267218f
feat: meta 테이블 통합에 따른 스키마 수정
kysub99 889d3ea
chore: flyway 버전 변경
kysub99 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
30 changes: 30 additions & 0 deletions
30
...erver/src/main/java/me/bombom/api/v1/common/ContinueReadingRankingScheduleProperties.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,30 @@ | ||
| package me.bombom.api.v1.common; | ||
|
|
||
| import jakarta.validation.constraints.NotBlank; | ||
| import java.time.ZoneId; | ||
| import lombok.Getter; | ||
| import lombok.Setter; | ||
| import org.springframework.boot.context.properties.ConfigurationProperties; | ||
| import org.springframework.scheduling.support.CronExpression; | ||
| import org.springframework.validation.annotation.Validated; | ||
|
|
||
| @Getter | ||
| @Setter | ||
| @Validated | ||
| @ConfigurationProperties("ranking.reading.continue") | ||
| public class ContinueReadingRankingScheduleProperties { | ||
|
|
||
| @NotBlank | ||
| private String cron; | ||
|
|
||
| @NotBlank | ||
| private String zone; | ||
|
|
||
| public ZoneId zoneId() { | ||
| return ZoneId.of(zone); | ||
| } | ||
|
|
||
| public CronExpression cronExpression() { | ||
| return CronExpression.parse(cron); | ||
| } | ||
| } |
6 changes: 5 additions & 1 deletion
6
...nd/bom-bom-server/src/main/java/me/bombom/api/v1/common/config/RankingScheduleConfig.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,10 +1,14 @@ | ||
| package me.bombom.api.v1.common.config; | ||
|
|
||
| import me.bombom.api.v1.common.ContinueReadingRankingScheduleProperties; | ||
| import me.bombom.api.v1.common.MonthlyRankingScheduleProperties; | ||
| import org.springframework.boot.context.properties.EnableConfigurationProperties; | ||
| import org.springframework.context.annotation.Configuration; | ||
|
|
||
| @Configuration | ||
| @EnableConfigurationProperties(MonthlyRankingScheduleProperties.class) | ||
| @EnableConfigurationProperties({ | ||
| MonthlyRankingScheduleProperties.class, | ||
| ContinueReadingRankingScheduleProperties.class | ||
| }) | ||
| public class RankingScheduleConfig { | ||
| } |
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
53 changes: 53 additions & 0 deletions
53
...bom-bom-server/src/main/java/me/bombom/api/v1/reading/domain/ContinueReadingSnapshot.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,53 @@ | ||
| package me.bombom.api.v1.reading.domain; | ||
|
|
||
| import jakarta.persistence.Column; | ||
| import jakarta.persistence.Entity; | ||
| import jakarta.persistence.GeneratedValue; | ||
| import jakarta.persistence.GenerationType; | ||
| import jakarta.persistence.Id; | ||
| import lombok.AccessLevel; | ||
| import lombok.Builder; | ||
| import lombok.Getter; | ||
| import lombok.NoArgsConstructor; | ||
| import lombok.NonNull; | ||
| import me.bombom.api.v1.common.BaseEntity; | ||
|
|
||
| @Entity | ||
| @Getter | ||
| @NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
| public class ContinueReadingSnapshot extends BaseEntity { | ||
|
|
||
| @Id | ||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
| private Long id; | ||
|
|
||
| @Column(nullable = false, unique = true) | ||
| private Long memberId; | ||
|
|
||
| @Column(nullable = false, columnDefinition = "SMALLINT") | ||
| private int dayCount; | ||
|
|
||
| @Column(nullable = false) | ||
| private long rankOrder; | ||
|
|
||
| @Builder | ||
| public ContinueReadingSnapshot( | ||
| Long id, | ||
| @NonNull Long memberId, | ||
| int dayCount, | ||
| long rankOrder | ||
| ) { | ||
| this.id = id; | ||
| this.memberId = memberId; | ||
| this.dayCount = dayCount; | ||
| this.rankOrder = rankOrder; | ||
| } | ||
|
|
||
| public static ContinueReadingSnapshot create(Long memberId, int dayCount, long rankOrder) { | ||
| return ContinueReadingSnapshot.builder() | ||
| .memberId(memberId) | ||
| .dayCount(dayCount) | ||
| .rankOrder(rankOrder) | ||
| .build(); | ||
| } | ||
| } |
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
7 changes: 7 additions & 0 deletions
7
...end/bom-bom-server/src/main/java/me/bombom/api/v1/reading/domain/ReadingSnapshotType.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,7 @@ | ||
| package me.bombom.api.v1.reading.domain; | ||
|
|
||
| public enum ReadingSnapshotType { | ||
|
|
||
| MONTHLY, | ||
| CONTINUE | ||
| } |
23 changes: 23 additions & 0 deletions
23
...nd/bom-bom-server/src/main/java/me/bombom/api/v1/reading/dto/ContinueReadingRankFlat.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 me.bombom.api.v1.reading.dto; | ||
|
|
||
| public record ContinueReadingRankFlat( | ||
|
|
||
| String nickname, | ||
| long rank, | ||
| int dayCount, | ||
| String rankingBadgeGrade, | ||
| Integer rankingBadgeYear, | ||
| Integer rankingBadgeMonth, | ||
| String challengeBadgeGrade, | ||
| String challengeBadgeName, | ||
| Integer challengeBadgeGeneration | ||
| ) { | ||
|
|
||
| public boolean hasRankingBadge() { | ||
| return rankingBadgeGrade != null && rankingBadgeYear != null && rankingBadgeMonth != null; | ||
| } | ||
|
|
||
| public boolean hasChallengeBadge() { | ||
| return challengeBadgeGrade != null && challengeBadgeName != null && challengeBadgeGeneration != null; | ||
| } | ||
| } | ||
1 change: 1 addition & 0 deletions
1
...end/bom-bom-server/src/main/java/me/bombom/api/v1/reading/dto/MonthlyReadingRankFlat.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
1 change: 1 addition & 0 deletions
1
backend/bom-bom-server/src/main/java/me/bombom/api/v1/reading/dto/RankerInfo.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,6 +1,7 @@ | ||
| package me.bombom.api.v1.reading.dto; | ||
|
|
||
| public record RankerInfo( | ||
|
|
||
| Long memberId, | ||
| long rankOrder | ||
| ) { | ||
|
|
||
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.
p1
이 사이에 공백 추가해주세요!
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.
반영했습니다
style: DTO 공백 추가