-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[Feat/#70] 그룹 도서 기록 순위 API 구현
- Loading branch information
Showing
8 changed files
with
99 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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 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
src/main/java/com/bookmile/backend/domain/record/dto/res/RecordProgressChartDto.java
This file contains 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 com.bookmile.backend.domain.record.dto.res; | ||
|
||
import com.bookmile.backend.domain.userGroup.entity.UserGroup; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class RecordProgressChartDto { | ||
private final String profile; | ||
private final String nickname; | ||
private final String progress; | ||
|
||
@Builder | ||
public RecordProgressChartDto(String profile, String nickname, String progress) { | ||
this.profile = profile; | ||
this.nickname = nickname; | ||
this.progress = progress; | ||
} | ||
|
||
public static RecordProgressChartDto from(UserGroup userGroup, double progress) { | ||
String formatProgress = String.format("%.2f", progress); | ||
|
||
return RecordProgressChartDto.builder() | ||
.profile(userGroup.getUser().getImage()) | ||
.nickname(userGroup.getUser().getNickname()) | ||
.progress(formatProgress) | ||
.build(); | ||
|
||
} | ||
} |
This file contains 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 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 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 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 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