Skip to content

Commit 6c7fb16

Browse files
authored
feat: 신규 사용자 abvDegree 기본값 처리 로직 추가 (#133)
1 parent 284dc12 commit 6c7fb16

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/com/back/domain/profile/dto/ProfileResponseDto.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ public static ProfileResponseDto of(User user,
2828
long myPostCount,
2929
long myCommentCount,
3030
long myLikedPostCount) {
31+
// 신규 사용자는 기본 5%로 시작하도록 뷰 레벨에서 기본값 적용
3132
Double percent = user.getAbvDegree();
32-
int percentInt = percent == null ? 0 : Math.max(0, Math.min(100, percent.intValue()));
33+
if (percent == null) percent = 5.0;
34+
int percentInt = Math.max(0, Math.min(100, percent.intValue()));
3335
int level = AbvLevel.of(percentInt).code;
3436
String label = AbvView.percentLabel(percent);
3537

0 commit comments

Comments
 (0)