Skip to content

Commit

Permalink
뱃지 도메인을 추가한다. (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
tkdgur0906 authored Jul 25, 2024
2 parents 837a02d + 97d0979 commit 3b5c9cd
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.bang_ggood.category.domain;

public enum Badge {

CLEAN("청결", "청결해요", "✨"),
ROOM_CONDITION("방 컨디션", "방 컨디션이 좋아요", "🏠"),
AMENITY("편의시설", "편의시설이 많아요", "🚇"),
OPTION("옵션", "옵션이 많아요", "🛋️"),
ENVIRONMENT("주거환경", "주거환경이 좋아요", "🌱"),
SECURITY("보안", "안전해요", "🔒"),
ECONOMIC("경제적", "경제적이에요", "💰")
;

private final String shortDescription;
private final String longDescription;
private final String emoji;

Badge(String shortDescription, String longDescription, String emoji) {
this.shortDescription = shortDescription;
this.longDescription = longDescription;
this.emoji = emoji;
}

public String getShortDescriptionWithEmoji() {
return this.emoji + this.shortDescription;
}

public String getLongDescriptionWithEmoji() {
return this.emoji + this.longDescription;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,22 @@

public enum Category {

CLEAN(1, "청결"),
ROOM_CONDITION(2, "방 컨디션"),
AMENITY(3, "편의시설"),
OPTION(4, "옵션"),
ENVIRONMENT(5, "주거환경"),
SECURITY(6, "보안"),
ECONOMIC(7, "경제적");
CLEAN(1, "청결", Badge.CLEAN),
ROOM_CONDITION(2, "방 컨디션", Badge.ROOM_CONDITION),
AMENITY(3, "편의시설", Badge.AMENITY),
OPTION(4, "옵션", Badge.OPTION),
ENVIRONMENT(5, "주거환경", Badge.ENVIRONMENT),
SECURITY(6, "보안", Badge.SECURITY),
ECONOMIC(7, "경제적", Badge.ECONOMIC);

private final int id;
private final String description;
private final Badge badge;

Category(int id, String description) {
Category(int id, String description, Badge badge) {
this.id = id;
this.description = description;
this.badge = badge;
}

public static boolean contains(int id) {
Expand Down

0 comments on commit 3b5c9cd

Please sign in to comment.