Skip to content

Commit

Permalink
Merge pull request #64 from KUSITMS-30th-TEAM-A/feature/#63/add-zone-…
Browse files Browse the repository at this point in the history
…color

[feat] 구역 정보 조회에서 색상 정보를 추가한다.
  • Loading branch information
juuuunny authored Nov 8, 2024
2 parents 298e83d + 8459b71 commit b99e1b9
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 2 deletions.
Binary file modified dump.rdb
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public <T extends Enum<T> & StadiumStatusType> SaveTopRankedZoneResponseDto save
Zone zone = Zone.builder()
.result(result)
.name(zoneEnum.getZoneName())
.color(zoneEnum.getZoneColor())
.explanations(zoneEnum.getExplanations())
.tip(zoneEnum.getTip())
.referencesGroup(zoneEnum.getReferencesGroup())
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/kusitms/backend/result/domain/entity/Zone.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ public class Zone extends BaseTimeEntity {
@Column(nullable = false)
private String name;

@Column(nullable = false)
private String color;

@Lob
@Convert(converter = StringListConverter.class)
private List<String> explanations;
Expand All @@ -42,9 +45,10 @@ public class Zone extends BaseTimeEntity {
private List<ReferencesGroup> referencesGroup;

@Builder
public Zone(Result result, String name, List<String> explanations, String tip, List<ReferencesGroup> referencesGroup) {
public Zone(Result result, String name, String color, List<String> explanations, String tip, List<ReferencesGroup> referencesGroup) {
this.result = result;
this.name = name;
this.color = color;
this.explanations = explanations;
this.tip = tip;
this.referencesGroup = referencesGroup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public enum JamsilStadiumStatusType implements StadiumStatusType {

RED("https://kr.object.ncloudstorage.com/hitzone-bucket/hitzone/guide/lg/red.svg",
"레드석",
"#DC032A",
"해당 구역은 다양한 것들을 모두 적절히 즐길 수 있는 구역이예요.",
List.of("응원도 적당히 즐길 수 있지만, 야구나 함께 온 동행자와의 대화에도 집중할 수 있는 구역이에요!"),
"해당 구역은 다양한 것들을 모두 적절히 즐길 수 있는 구역이예요.",
Expand Down Expand Up @@ -44,6 +45,7 @@ public enum JamsilStadiumStatusType implements StadiumStatusType {
),
BLUE("https://kr.object.ncloudstorage.com/hitzone-bucket/hitzone/guide/lg/blue.svg",
"블루석",
"#4699F2",
"힘차게 응원도 가능하고, 야구에 집중도 할 수 있는 구역이에요!",
List.of("힘차게 응원도 가능하고, 야구에 집중도 할 수 있는 구역이에요!"),
"해당 구역은 비교적 조용히 경기 관람이 가능한 구역이예요.",
Expand Down Expand Up @@ -73,6 +75,7 @@ public enum JamsilStadiumStatusType implements StadiumStatusType {
),
NAVY("https://kr.object.ncloudstorage.com/hitzone-bucket/hitzone/guide/lg/navy.svg",
"네이비석",
"#242953",
"높은 곳에서 야구를 전체적으로 볼 수 있는 구역이에요!",
List.of("높은 곳에서 야구를 전체적으로 볼 수 있는 구역이에요!"),
"해당 구역은 높은 층수에 위치해 있어요.",
Expand Down Expand Up @@ -108,6 +111,7 @@ public enum JamsilStadiumStatusType implements StadiumStatusType {
),
ORANGE("https://kr.object.ncloudstorage.com/hitzone-bucket/hitzone/guide/lg/orange.svg",
"오렌지석",
"#E16900",
"야구장의 응원이 가장 열정적인 응원석 구역이에요!",
List.of("야구장의 응원이 가장 열정적인 응원석 구역이에요!"),
"해당 구역은 열정적인 응원이 이루어져요.",
Expand Down Expand Up @@ -139,6 +143,7 @@ public enum JamsilStadiumStatusType implements StadiumStatusType {
),
EXITING("https://kr.object.ncloudstorage.com/hitzone-bucket/hitzone/guide/lg/exciting.svg",
"익사이팅석",
"#6D6D6D",
"야구 필드 안에 들어와 있는 느낌을 받을 수 있는 구역이에요!",
List.of("야구 필드 안에 들어와 있는 느낌을 받을 수 있는 구역이에요!"),
"해당 구역은 연령제한이 있어요.",
Expand Down Expand Up @@ -173,6 +178,7 @@ public enum JamsilStadiumStatusType implements StadiumStatusType {
),
GREEN("https://kr.object.ncloudstorage.com/hitzone-bucket/hitzone/guide/lg/green.svg",
"외야그린석",
"#339600",
"사람들이 몰리지 않아 비교적 한적하게 경기를 즐길 수 있는 구역이에요!",
List.of("사람들이 몰리지 않아 비교적 한적하게 경기를 즐길 수 있는 구역이에요!"),
"해당 구역은 시야 제한석이 있어요.",
Expand Down Expand Up @@ -207,6 +213,7 @@ public enum JamsilStadiumStatusType implements StadiumStatusType {
),
TABLE("https://kr.object.ncloudstorage.com/hitzone-bucket/hitzone/guide/lg/table.svg",
"테이블석",
"#7C0065",
"다양한 음식을 골라 테이블에 펼쳐놓고 먹을 수 있는 구역이에요!",
List.of("다양한 음식을 골라 테이블에 펼쳐놓고 먹을 수 있는 구역이에요!"),
"해당 구역은 예매 시 위치 확인이 필요해요.",
Expand Down Expand Up @@ -236,6 +243,7 @@ public enum JamsilStadiumStatusType implements StadiumStatusType {
),
PREMIUM("https://kr.object.ncloudstorage.com/hitzone-bucket/hitzone/guide/lg/premium.svg",
"프리미엄석",
"#185DDD",
"테이블에서 맛있는 음식을 먹으면서 선수들을 가장 가까이서 볼 수 있는 구역이에요!",
List.of("테이블에서 맛있는 음식을 먹으면서 선수들을 가장 가까이서 볼 수 있는 구역이에요!"),
"해당 구역은 티켓 확인을 2번 해요.",
Expand Down Expand Up @@ -272,6 +280,7 @@ public enum JamsilStadiumStatusType implements StadiumStatusType {
private static final String DEFAULT_TITLE = "참고하세요";
private final String imgUrl;
private final String zoneName;
private final String zoneColor;
private final String oneLineDescription;
private final List<String> explanations;
private final String tip;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public enum KtWizStadiumStatusType implements StadiumStatusType{

CHEERING("https://kr.object.ncloudstorage.com/hitzone-bucket/hitzone/guide/kt/cheering.svg",
"응원지정석",
"#B23039",
"응원 단상과 가까워, 야구를 열정적으로 응원할 수 있는 분위기의 구역이에요!",
List.of("응원 단상과 가까워, 야구를 열정적으로 응원할 수 있는 분위기의 구역이에요!"),
"해당 구역은 예매 시 응원단상 위치 확인이 필요해요.",
Expand Down Expand Up @@ -44,6 +45,7 @@ public enum KtWizStadiumStatusType implements StadiumStatusType{
),
GENIETV("https://kr.object.ncloudstorage.com/hitzone-bucket/hitzone/guide/kt/genietv.svg",
"지니TV석",
"#599741",
"테이블석이라 음식 취식이 편리한 구역이에요!",
List.of("테이블석이라 음식 취식이 편리한 구역이에요!"),
"해당 구역은 3루 테이블석이라 편하게 관람을 할 수 있어요.",
Expand Down Expand Up @@ -76,6 +78,7 @@ public enum KtWizStadiumStatusType implements StadiumStatusType{
//특징 확인 필요
CENTER("https://kr.object.ncloudstorage.com/hitzone-bucket/hitzone/guide/kt/center.svg",
"중앙지정석",
"#5E346E",
"특정 팀에 구애받지 않고 응원하는 구역!",
List.of(
"특정 팀에 구애받지 않고 응원하는 분위기의 구역이에요!",
Expand Down Expand Up @@ -110,6 +113,7 @@ public enum KtWizStadiumStatusType implements StadiumStatusType{
),
YBOX("https://kr.object.ncloudstorage.com/hitzone-bucket/hitzone/guide/kt/ybox.svg",
"Y박스석",
"#F5A545",
"선수들을 가까이서 볼 수 있는 구역이에요!",
List.of("선수들을 가까이서 볼 수 있는 구역이에요!"),
"해당 구역은 1루 테이블석이라 편리하게 음식을 먹을 수 있어요.",
Expand Down Expand Up @@ -141,6 +145,7 @@ public enum KtWizStadiumStatusType implements StadiumStatusType{
),
SKYBOX("https://kr.object.ncloudstorage.com/hitzone-bucket/hitzone/guide/kt/skybox.svg",
"스카이박스(4층)",
"#65C5DE",
"회의실같은 내부에서 쾌적하게 야구를 볼 수 있는 구역!",
List.of(
"회의실처럼 생긴 내부에서 쾌적하게 야구를 볼 수 있는 구역이에요!",
Expand Down Expand Up @@ -181,6 +186,7 @@ public enum KtWizStadiumStatusType implements StadiumStatusType{
),
SKYZONE("https://kr.object.ncloudstorage.com/hitzone-bucket/hitzone/guide/kt/skyzone.svg",
"스카이존(5층)",
"#292F46",
"높은 곳에서 경기를 한 눈에 볼 수 있는 구역!",
List.of("높은 곳에서 경기를 한 눈에 볼 수 있는 구역이에요!"),
"해당 구역은 높은 곳에 위치해있어요!",
Expand Down Expand Up @@ -218,6 +224,7 @@ public enum KtWizStadiumStatusType implements StadiumStatusType{
),
EXCITING("https://kr.object.ncloudstorage.com/hitzone-bucket/hitzone/guide/kt/exciting.svg",
"하이파이브존/익사이팅석",
"#3EA6A5",
"경기 승리 시, 선수들과 하이파이브 할 수 있는 구역!",
List.of(
"(1루 하이파이브존) KT가 경기 승리 시, 선수들과 하이파이브 할 수 있는 구역이에요! 전반적으로 앉아서 응원하는 분위기며, 선수들을 굉장히 가까이에서 볼 수 있는 구역이에요.",
Expand Down Expand Up @@ -279,6 +286,7 @@ public enum KtWizStadiumStatusType implements StadiumStatusType{
),
SHOPPING("https://kr.object.ncloudstorage.com/hitzone-bucket/hitzone/guide/kt/shopping.svg",
"KT알파쇼핑석",
"#E95560",
"중앙테이블석이라, 음식 섭취하기 편한 구역이에요!",
List.of("중앙테이블석이라, 음식 섭취하기 편한 구역이에요!"),
"해당 구역은 중앙 테이블석이고, 빨리 예매하는 것이 좋아요.",
Expand Down Expand Up @@ -317,6 +325,7 @@ public enum KtWizStadiumStatusType implements StadiumStatusType{
),
GENIE("https://kr.object.ncloudstorage.com/hitzone-bucket/hitzone/guide/kt/genie.svg",
"지니존",
"#35659E",
"포수 바로 뒤에서 관람할 수 있는 구역이에요!",
List.of("포수 바로 뒤에서 관람할 수 있는 구역이에요!"),
"해당 구역은 경기를 생동감있게 볼 수 있어요.",
Expand Down Expand Up @@ -347,6 +356,7 @@ public enum KtWizStadiumStatusType implements StadiumStatusType{
),
TVING("https://kr.object.ncloudstorage.com/hitzone-bucket/hitzone/guide/kt/tving.svg",
"티빙 테이블석",
"#E3A3B1",
"외야 테이블석이며, 2인 테이블 3개로 구성되어있는 구역이에요!",
List.of("외야 테이블석이며, 2인 테이블 3개로 구성되어있는 구역이에요!"),
"해당 구역은 외야 테이블석이에요.",
Expand Down Expand Up @@ -374,6 +384,7 @@ public enum KtWizStadiumStatusType implements StadiumStatusType{
),
GRASS("https://kr.object.ncloudstorage.com/hitzone-bucket/hitzone/guide/kt/grass.svg",
"외야 잔디 자유석",
"#CEDA82",
"넓은 외야에 잔디가 깔려 있어 앉아서 관람할 수 있는 구역이에요! 계단처럼 층이 나뉘어져 있어요.",
List.of(
"넓은 외야에 잔디가 깔려 있어 앉아서 관람할 수 있는 구역이에요!",
Expand Down Expand Up @@ -414,6 +425,7 @@ public enum KtWizStadiumStatusType implements StadiumStatusType{
),
CAMPING("https://kr.object.ncloudstorage.com/hitzone-bucket/hitzone/guide/kt/camping.svg",
"키즈랜드 캠핑존",
"#008FD7",
"""
텐트에서 야구를 볼 수 있는 구역이에요!
고기를 구워 먹는 것이 가능해요.""",
Expand Down Expand Up @@ -458,6 +470,7 @@ public enum KtWizStadiumStatusType implements StadiumStatusType{
private static final String DEFAULT_TITLE = "참고하세요";
private final String imgUrl;
private final String zoneName;
private final String zoneColor;
private final String oneLineDescription;
private final List<String> explanations;
private final String tip;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
public interface StadiumStatusType {
String getImgUrl();
String getZoneName();
String getZoneColor();
String getOneLineDescription();
List<String> getExplanations();
String getTip();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public record GetZonesResponseDto (
public record ZoneResponseDto (
Long zoneId,
String name,
String color,
List<String> explanations,
String tip,
List<ReferencesGroup> referencesGroup
Expand All @@ -20,6 +21,7 @@ public static ZoneResponseDto from(Zone zone) {
return new ZoneResponseDto(
zone.getId(),
zone.getName(),
zone.getColor(),
zone.getExplanations(),
zone.getTip(),
zone.getReferencesGroup()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
public record GetZoneGuideResponseDto(
String imgUrl,
String zoneName,
String zoneColor,
String explanation,
String entrance,
String stepSpacing,
Expand All @@ -21,6 +22,7 @@ public static GetZoneGuideResponseDto from(StadiumStatusType zone) {
return new GetZoneGuideResponseDto(
zone.getImgUrl(),
zone.getZoneName(),
zone.getZoneColor(),
zone.getOneLineDescription(),
zone.getEntrance(),
zone.getStepSpacing(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public ResponseEntity<ApiResponse<GetZonesNameResponseDto>> getZonesName(

/**
* 해당 스타디움 구역의 정보와 팁을 반환한다.
* @return 구역 정보(한줄 설명, 출입구, 단차 간격, 좌석 간격, 팁, 참고사항)
* @return 구역 정보(구역명, 구역색깔, 한줄 설명, 출입구, 단차 간격, 좌석 간격, 팁, 참고사항)
*/
@GetMapping("/stadium/zones/guide")
public ResponseEntity<ApiResponse<GetZoneGuideResponseDto>> getZoneGuide(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ public void getRecommendedZones() throws Exception {
GetZonesResponseDto.ZoneResponseDto redZone = new GetZonesResponseDto.ZoneResponseDto(
1L,
"레드석",
"#DC032A",
List.of("응원도 적당히 즐길 수 있지만, 야구나 함께 온 동행자와의 대화에도 집중할 수 있는 구역이에요!"),
"해당 구역은 다양한 것들을 모두 적절히 즐길 수 있는 구역이예요.",
List.of(
Expand All @@ -186,6 +187,7 @@ public void getRecommendedZones() throws Exception {
GetZonesResponseDto.ZoneResponseDto blueZone = new GetZonesResponseDto.ZoneResponseDto(
2L,
"블루석",
"#4699F2",
List.of("힘차게 응원도 가능하고, 야구에 집중도 할 수 있는 구역이에요!"),
"해당 구역은 비교적 조용히 경기 관람이 가능한 구역이에요.",
List.of(
Expand Down Expand Up @@ -219,6 +221,7 @@ public void getRecommendedZones() throws Exception {
.andExpect(jsonPath("$.message").value("해당 결과의 추천 구역 정보 리스트를 조회하였습니다."))
.andExpect(jsonPath("$.payload.zones[0].zoneId").value(redZone.zoneId()))
.andExpect(jsonPath("$.payload.zones[0].name").value(redZone.name()))
.andExpect(jsonPath("$.payload.zones[0].color").value(redZone.color()))
.andExpect(jsonPath("$.payload.zones[0].explanations[0]").value(redZone.explanations().get(0)))
.andExpect(jsonPath("$.payload.zones[0].tip").value(redZone.tip()))
.andExpect(jsonPath("$.payload.zones[0].referencesGroup[0].groupTitle").value(redZone.referencesGroup().get(0).getGroupTitle()))
Expand All @@ -227,6 +230,7 @@ public void getRecommendedZones() throws Exception {

.andExpect(jsonPath("$.payload.zones[1].zoneId").value(blueZone.zoneId()))
.andExpect(jsonPath("$.payload.zones[1].name").value(blueZone.name()))
.andExpect(jsonPath("$.payload.zones[1].color").value(blueZone.color()))
.andExpect(jsonPath("$.payload.zones[1].explanations[0]").value(blueZone.explanations().get(0)))
.andExpect(jsonPath("$.payload.zones[1].tip").value(blueZone.tip()))
.andExpect(jsonPath("$.payload.zones[1].referencesGroup[0].groupTitle").value(blueZone.referencesGroup().get(0).getGroupTitle()))
Expand All @@ -251,6 +255,7 @@ public void getRecommendedZones() throws Exception {
fieldWithPath("payload").type(JsonFieldType.OBJECT).description("응답 데이터").optional(),
fieldWithPath("payload.zones[].zoneId").type(JsonFieldType.NUMBER).description("구역 ID"),
fieldWithPath("payload.zones[].name").type(JsonFieldType.STRING).description("구역 이름"),
fieldWithPath("payload.zones[].color").type(JsonFieldType.STRING).description("구역 색상"),
fieldWithPath("payload.zones[].explanations[]").type(JsonFieldType.ARRAY).description("구역 설명 리스트"),
fieldWithPath("payload.zones[].tip").type(JsonFieldType.STRING).description("구역에 대한 팁"),
fieldWithPath("payload.zones[].referencesGroup[].groupTitle").type(JsonFieldType.STRING).description("참고 그룹 제목"),
Expand Down
Loading

0 comments on commit b99e1b9

Please sign in to comment.