Skip to content

Commit

Permalink
Merge pull request #64 from jurumarble/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
alsduq1117 authored Sep 24, 2023
2 parents 1b73b1d + b041149 commit 432572b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@

import co.kr.jurumarble.comment.domain.Comment;
import co.kr.jurumarble.comment.domain.Restaurant;
import co.kr.jurumarble.user.enums.AgeType;
import co.kr.jurumarble.user.enums.ChoiceType;
import co.kr.jurumarble.user.enums.GenderType;
import co.kr.jurumarble.user.enums.MbtiType;
import co.kr.jurumarble.user.enums.*;
import lombok.Builder;
import lombok.Getter;

Expand All @@ -21,6 +18,7 @@ public class GetCommentData {
private Long voteId;
private Long drinkId;
private String nickName;
private AlcoholLimitType alcoholLimitType;
private Long parentId;
private String content;
private String imageUrl;
Expand All @@ -46,6 +44,7 @@ public GetCommentData(Comment comment) {
this.age = comment.getUser().classifyAge();
this.mbti = comment.getUser().getMbti();
this.nickName = comment.getUser().getNickname();
this.alcoholLimitType = comment.getUser().getAlcoholLimit();
this.createdDate = comment.getCreatedDate();
this.children = new ArrayList<>();
this.likeCount = comment.getLikeCount();
Expand All @@ -72,6 +71,7 @@ public GetCommentData(Comment comment, ChoiceType choice) {
this.age = comment.getUser().classifyAge();
this.mbti = comment.getUser().getMbti();
this.nickName = comment.getUser().getNickname();
this.alcoholLimitType = comment.getUser().getAlcoholLimit();
this.createdDate = comment.getCreatedDate();
this.children = new ArrayList<>();
this.likeCount = comment.getLikeCount();
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/co/kr/jurumarble/user/domain/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private User(Long id, String nickname, String email, String imageUrl, String pas

public AgeType classifyAge() {
if (age == null) {
return AgeType.NULL; // 혹은 원하는 다른 동작 수행
return null; // 혹은 원하는 다른 동작 수행
}
AgeType ageGroup;
switch (age / 10) {
Expand All @@ -98,7 +98,7 @@ public AgeType classifyAge() {
ageGroup = AgeType.fifties;
break;
default:
ageGroup = AgeType.NULL;
ageGroup = null;
break;
}
return ageGroup;
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/co/kr/jurumarble/user/enums/AgeType.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ public enum AgeType implements EnumModel {
twenties("20대"),
thirties("30대"),
fourties("40대"),
fifties("50대"),
NULL("null");
fifties("50대");

private String value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public static VoteWithPostedUserData generateDrinkVoteData(VoteWithPostedUserCom

public static AgeType classifyAge(Integer age) {
if (age == null) {
return AgeType.NULL; // 혹은 원하는 다른 동작 수행
return null; // 혹은 원하는 다른 동작 수행
}
AgeType ageGroup;
switch (age / 10) {
Expand All @@ -116,7 +116,7 @@ public static AgeType classifyAge(Integer age) {
ageGroup = AgeType.fifties;
break;
default:
ageGroup = AgeType.NULL;
ageGroup = null;
break;
}
return ageGroup;
Expand Down

0 comments on commit 432572b

Please sign in to comment.