Skip to content

Commit

Permalink
Merge pull request #70 from Hous-Release/fix/#69
Browse files Browse the repository at this point in the history
#69 [fix] Badge 테이블 수정
  • Loading branch information
orijoon98 authored Sep 14, 2022
2 parents 2577c6c + cb2b9fe commit 07db13c
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 9 deletions.
9 changes: 2 additions & 7 deletions src/main/java/hous/server/domain/badge/Badge.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ public class Badge extends AuditingTimeEntity {
private Long id;

@Column(nullable = false, length = 30)
private String name;

@Column(nullable = false, length = 100)
private String description;

@Column(nullable = false, length = 300)
private String imageUrl;
@Enumerated(EnumType.STRING)
private BadgeInfo info;
}
40 changes: 40 additions & 0 deletions src/main/java/hous/server/domain/badge/BadgeInfo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package hous.server.domain.badge;

import hous.server.common.model.EnumModel;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

@Getter
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
public enum BadgeInfo implements EnumModel {

POUNDING_HOUSE("두근두근 하우스", "어서와요\n우리 Hous-에!", "imageUrl"),
I_AM_SUCH_A_PERSON("나 이런 사람이야", "Homie 카드를\n완성한 호미", "imageUrl"),
OUR_HOUSE_HOMIES("우리 집 호미들", "모든 Homie들의\n카드 확인", "imageUrl"),
I_DONT_EVEN_KNOW_ME("나도 날 모르겠어", "성향 테스트를\n5번 이상 한 호미", "imageUrl"),
HOMIE_IS_BORN("Homie 탄생", "Hous-에서의\n첫 생일", "imageUrl"),
TODO_ONE_STEP("to-do 한 걸음", "to-do 전체보기에서\n첫 to-do 등록", "imageUrl"),
GOOD_JOB("참 잘했어요", "1주 동안 to-do\n모두 완료", "imageUrl"),
SINCERITY_KING_HOMIE("성실왕 호미", "2주 동안\nto-do 모두 완료", "imageUrl"),
TODO_MASTER("to-do 마스터", "3주 동안\nto-do 모두 완료", "imageUrl"),
LETS_BUILD_A_POLE("기둥을 세우자", "우리 집 규칙에서\n집 Rules 등록", "imageUrl"),
OUR_HOUSE_PILLAR_HOMIE("우리 집 기둥 호미", "우리 집 Rules\n5개 이상 등록", "imageUrl"),
FEEDBACK_ONE_STEP("피드백 한 걸음", "좋은 의견을\n호미 나라에 전달", "imageUrl");

private final String value;

private final String description;

private final String imageUrl;

@Override
public String getKey() {
return name();
}

@Override
public String getValue() {
return value;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ public static UserInfoResponse of(Onboarding onboarding, Represent represent) {
.mbti(onboarding.getMbti())
.introduction(onboarding.getIntroduction())
.testScore(TestScoreResponse.of(onboarding.getTestScore()))
.representBadge(represent != null ? represent.getBadge().getName() : null)
.representBadgeImage(represent != null ? represent.getBadge().getImageUrl() : null)
.representBadge(represent != null ? represent.getBadge().getInfo().getValue() : null)
.representBadgeImage(represent != null ? represent.getBadge().getInfo().getImageUrl() : null)
.build();
}
}

0 comments on commit 07db13c

Please sign in to comment.