diff --git a/backend/emm-sale/src/documentTest/java/com/emmsale/EventApiTest.java b/backend/emm-sale/src/documentTest/java/com/emmsale/EventApiTest.java index 53f148d18..87c4407ec 100644 --- a/backend/emm-sale/src/documentTest/java/com/emmsale/EventApiTest.java +++ b/backend/emm-sale/src/documentTest/java/com/emmsale/EventApiTest.java @@ -61,32 +61,32 @@ class EventApiTest extends MockMvcTestHelper { private static final ResponseFieldsSnippet EVENT_DETAIL_RESPONSE_FILED = PayloadDocumentation.responseFields( - PayloadDocumentation.fieldWithPath("id").type(JsonFieldType.NUMBER).description("event 식별자"), - PayloadDocumentation.fieldWithPath("name").type(JsonFieldType.STRING) + fieldWithPath("id").type(JsonFieldType.NUMBER).description("event 식별자"), + fieldWithPath("name").type(JsonFieldType.STRING) .description("envent 이름"), - PayloadDocumentation.fieldWithPath("informationUrl").type(JsonFieldType.STRING) + fieldWithPath("informationUrl").type(JsonFieldType.STRING) .description("상세정보 url"), - PayloadDocumentation.fieldWithPath("startDate").type(JsonFieldType.STRING) + fieldWithPath("startDate").type(JsonFieldType.STRING) .description("시작일자"), - PayloadDocumentation.fieldWithPath("endDate").type(JsonFieldType.STRING).description("종료일자"), - PayloadDocumentation.fieldWithPath("applyStartDate").type(JsonFieldType.STRING) + fieldWithPath("endDate").type(JsonFieldType.STRING).description("종료일자"), + fieldWithPath("applyStartDate").type(JsonFieldType.STRING) .description("신청 시작일자(nullable)"), - PayloadDocumentation.fieldWithPath("applyEndDate").type(JsonFieldType.STRING) + fieldWithPath("applyEndDate").type(JsonFieldType.STRING) .description("신청 종료일자(nullable)"), - PayloadDocumentation.fieldWithPath("location").type(JsonFieldType.STRING).description("장소"), - PayloadDocumentation.fieldWithPath("status").type(JsonFieldType.STRING).description("진행상태"), - PayloadDocumentation.fieldWithPath("applyStatus").type(JsonFieldType.STRING) + fieldWithPath("location").type(JsonFieldType.STRING).description("장소"), + fieldWithPath("status").type(JsonFieldType.STRING).description("진행상태"), + fieldWithPath("applyStatus").type(JsonFieldType.STRING) .description("행사 신청 기간의 진행 상황"), - PayloadDocumentation.fieldWithPath("tags[]").type(JsonFieldType.ARRAY).description("태그들"), - PayloadDocumentation.fieldWithPath("imageUrl").type(JsonFieldType.STRING) + fieldWithPath("tags[]").type(JsonFieldType.ARRAY).description("태그들"), + fieldWithPath("imageUrl").type(JsonFieldType.STRING) .description("이미지 Url(포스터)"), - PayloadDocumentation.fieldWithPath("remainingDays").type(JsonFieldType.NUMBER) + fieldWithPath("remainingDays").type(JsonFieldType.NUMBER) .description("시작일로 부터 D-day"), - PayloadDocumentation.fieldWithPath("applyRemainingDays").type(JsonFieldType.NUMBER) + fieldWithPath("applyRemainingDays").type(JsonFieldType.NUMBER) .description("행사 신청 시작일까지 남은 일 수"), - PayloadDocumentation.fieldWithPath("type").type(JsonFieldType.STRING) + fieldWithPath("type").type(JsonFieldType.STRING) .description("event의 타입"), - PayloadDocumentation.fieldWithPath("imageUrls[]").description("이미지 URL들").optional()); + fieldWithPath("imageUrls[]").description("이미지 URL들").optional()); @Test @DisplayName("컨퍼런스의 상세정보를 조회할 수 있다.") @@ -130,28 +130,30 @@ void findEvents() throws Exception { ); final ResponseFieldsSnippet responseFields = PayloadDocumentation.responseFields( - PayloadDocumentation.fieldWithPath("[].id").type(JsonFieldType.NUMBER).description("행사 id"), - PayloadDocumentation.fieldWithPath("[].name").type(JsonFieldType.STRING).description("행사명"), - PayloadDocumentation.fieldWithPath("[].startDate").type(JsonFieldType.STRING) + fieldWithPath("[].id").type(JsonFieldType.NUMBER).description("행사 id"), + fieldWithPath("[].name").type(JsonFieldType.STRING).description("행사명"), + fieldWithPath("[].startDate").type(JsonFieldType.STRING) .description("행사 시작일(yyyy:MM:dd:HH:mm:ss)"), - PayloadDocumentation.fieldWithPath("[].endDate").type(JsonFieldType.STRING) + fieldWithPath("[].endDate").type(JsonFieldType.STRING) .description("행사 마감일(yyyy:MM:dd:HH:mm:ss)"), - PayloadDocumentation.fieldWithPath("[].tags[]").type(JsonFieldType.ARRAY) + fieldWithPath("[].tags[]").type(JsonFieldType.ARRAY) .description("행사 태그 목록"), - PayloadDocumentation.fieldWithPath("[].status").type(JsonFieldType.STRING) + fieldWithPath("[].status").type(JsonFieldType.STRING) .description("행사 진행 상황(IN_PROGRESS, UPCOMING, ENDED)"), - PayloadDocumentation.fieldWithPath("[].applyStatus").type(JsonFieldType.STRING) + fieldWithPath("[].applyStatus").type(JsonFieldType.STRING) .description("행사 신청 기간의 진행 상황(IN_PROGRESS, UPCOMING, ENDED)"), - PayloadDocumentation.fieldWithPath("[].remainingDays").type(JsonFieldType.NUMBER) + fieldWithPath("[].remainingDays").type(JsonFieldType.NUMBER) .description("행사 시작일까지 남은 일 수"), - PayloadDocumentation.fieldWithPath("[].applyRemainingDays").type(JsonFieldType.NUMBER) + fieldWithPath("[].applyRemainingDays").type(JsonFieldType.NUMBER) .description("행사 신청 시작일까지 남은 일 수"), - PayloadDocumentation.fieldWithPath("[].imageUrl").type(JsonFieldType.STRING) + fieldWithPath("[].imageUrl").type(JsonFieldType.STRING) .description("행사 이미지 URL"), - PayloadDocumentation.fieldWithPath("[].eventMode").type(JsonFieldType.STRING) + fieldWithPath("[].eventMode").type(JsonFieldType.STRING) .description("행사 온라인 여부(온라인, 오프라인, 온오프라인)"), - PayloadDocumentation.fieldWithPath("[].paymentType").type(JsonFieldType.STRING) - .description("행사 유료 여부(유료, 무료, 유무료)") + fieldWithPath("[].paymentType").type(JsonFieldType.STRING) + .description("행사 유료 여부(유료, 무료, 유무료)"), + fieldWithPath("[].organization").type(JsonFieldType.STRING) + .description("행사 기관") ); final List eventResponses = List.of( @@ -159,17 +161,17 @@ void findEvents() throws Exception { LocalDateTime.parse("2023-09-03T12:00:00"), List.of("백엔드", "프론트엔드", "안드로이드", "IOS", "AI"), "IN_PROGRESS", "ENDED", "https://biz.pusan.ac.kr/dext5editordata/2022/08/20220810_160546511_10103.jpg", - 3, -30, EventMode.ONLINE.getValue(), PaymentType.PAID.getValue()), + 3, -30, EventMode.ONLINE.getValue(), PaymentType.PAID.getValue(), "인프런"), new EventResponse(5L, "웹 컨퍼런스", LocalDateTime.parse("2023-07-03T12:00:00"), LocalDateTime.parse("2023-08-03T12:00:00"), List.of("백엔드", "프론트엔드"), "IN_PROGRESS", "IN_PROGRESS", "https://biz.pusan.ac.kr/dext5editordata/2022/08/20220810_160546511_10103.jpg", - 3, 3, EventMode.ONLINE.getValue(), PaymentType.PAID.getValue()), + 3, 3, EventMode.ONLINE.getValue(), PaymentType.PAID.getValue(), "행사기관"), new EventResponse(2L, "AI 컨퍼런스", LocalDateTime.parse("2023-07-22T12:00:00"), LocalDateTime.parse("2023-07-30T12:00:00"), List.of("AI"), "UPCOMING", "IN_PROGRESS", "https://biz.pusan.ac.kr/dext5editordata/2022/08/20220810_160546511_10103.jpg", - 3, -18, EventMode.ONLINE.getValue(), PaymentType.PAID.getValue()) + 3, -18, EventMode.ONLINE.getValue(), PaymentType.PAID.getValue(), "행사기관") ); Mockito.when(eventService.findEvents(any(EventType.class), diff --git a/backend/emm-sale/src/documentTest/java/com/emmsale/ScrapApiTest.java b/backend/emm-sale/src/documentTest/java/com/emmsale/ScrapApiTest.java index f60bcb992..e78014ad8 100644 --- a/backend/emm-sale/src/documentTest/java/com/emmsale/ScrapApiTest.java +++ b/backend/emm-sale/src/documentTest/java/com/emmsale/ScrapApiTest.java @@ -40,17 +40,17 @@ void findAllScraps() throws Exception { LocalDateTime.parse("2023-09-03T12:00:00"), List.of("백엔드", "프론트엔드", "안드로이드", "IOS", "AI"), "IN_PROGRESS", "ENDED", "https://biz.pusan.ac.kr/dext5editordata/2022/08/20220810_160546511_10103.jpg", - 3, -30, EventMode.ONLINE.getValue(), PaymentType.PAID.getValue()), + 3, -30, EventMode.ONLINE.getValue(), PaymentType.PAID.getValue(), "행사기관"), new EventResponse(5L, "웹 컨퍼런스", LocalDateTime.parse("2023-07-03T12:00:00"), LocalDateTime.parse("2023-08-03T12:00:00"), List.of("백엔드", "프론트엔드"), "IN_PROGRESS", "IN_PROGRESS", "https://biz.pusan.ac.kr/dext5editordata/2022/08/20220810_160546511_10103.jpg", - 3, 3, EventMode.ONLINE.getValue(), PaymentType.PAID.getValue()), + 3, 3, EventMode.ONLINE.getValue(), PaymentType.PAID.getValue(), "행사기관"), new EventResponse(2L, "AI 컨퍼런스", LocalDateTime.parse("2023-07-22T12:00:00"), LocalDateTime.parse("2023-07-30T12:00:00"), List.of("AI"), "UPCOMING", "IN_PROGRESS", "https://biz.pusan.ac.kr/dext5editordata/2022/08/20220810_160546511_10103.jpg", - 3, -18, EventMode.ONLINE.getValue(), PaymentType.PAID.getValue()) + 3, -18, EventMode.ONLINE.getValue(), PaymentType.PAID.getValue(), "행사기관") ); final ResponseFieldsSnippet responseFields = PayloadDocumentation.responseFields( @@ -75,7 +75,9 @@ void findAllScraps() throws Exception { PayloadDocumentation.fieldWithPath("[].eventMode").type(JsonFieldType.STRING) .description("행사 온라인 여부(온라인, 오프라인, 온오프라인)"), PayloadDocumentation.fieldWithPath("[].paymentType").type(JsonFieldType.STRING) - .description("행사 유료 여부(유료, 무료, 유무료)") + .description("행사 유료 여부(유료, 무료, 유무료)"), + PayloadDocumentation.fieldWithPath("[].organization").type(JsonFieldType.STRING) + .description("행사 기관") ); //when diff --git a/backend/emm-sale/src/main/java/com/emmsale/event/application/dto/EventResponse.java b/backend/emm-sale/src/main/java/com/emmsale/event/application/dto/EventResponse.java index 625821aa2..6ff96ca40 100644 --- a/backend/emm-sale/src/main/java/com/emmsale/event/application/dto/EventResponse.java +++ b/backend/emm-sale/src/main/java/com/emmsale/event/application/dto/EventResponse.java @@ -35,6 +35,7 @@ public class EventResponse { private final int applyRemainingDays; private final String eventMode; private final String paymentType; + private final String organization; public static List makeEventResponsesByStatus( final LocalDate today, @@ -75,7 +76,8 @@ private static EventResponse from( event.getEventPeriod().calculateRemainingDays(today), event.getEventPeriod().calculateApplyRemainingDays(today), event.getEventMode().getValue(), - event.getPaymentType().getValue() + event.getPaymentType().getValue(), + event.getOrganization() ); } } diff --git a/backend/emm-sale/src/test/java/com/emmsale/event/application/EventServiceTest.java b/backend/emm-sale/src/test/java/com/emmsale/event/application/EventServiceTest.java index 20ab82a78..0538a63ce 100644 --- a/backend/emm-sale/src/test/java/com/emmsale/event/application/EventServiceTest.java +++ b/backend/emm-sale/src/test/java/com/emmsale/event/application/EventServiceTest.java @@ -72,26 +72,26 @@ class EventServiceTest extends ServiceIntegrationTestHelper { private static final EventResponse 인프콘_2023 = new EventResponse(null, "인프콘 2023", null, null, List.of(), "IN_PROGRESS", "ENDED", null, 0, 0, EventMode.OFFLINE.getValue(), - PaymentType.PAID.getValue()); + PaymentType.PAID.getValue(), "행사기관"); private static final EventResponse 웹_컨퍼런스 = new EventResponse(null, "웹 컨퍼런스", null, null, List.of(), "IN_PROGRESS", "IN_PROGRESS", null, 0, 0, EventMode.ONLINE.getValue(), - PaymentType.PAID.getValue()); + PaymentType.PAID.getValue(), "행사기관"); private static final EventResponse 안드로이드_컨퍼런스 = new EventResponse(null, "안드로이드 컨퍼런스", null, null, List.of(), "ENDED", "ENDED", null, 0, 0, EventMode.ONLINE.getValue(), - PaymentType.PAID.getValue()); + PaymentType.PAID.getValue(), "행사기관"); private static final EventResponse AI_컨퍼런스 = new EventResponse(null, "AI 컨퍼런스", null, null, List.of(), "UPCOMING", "IN_PROGRESS", null, 0, 0, EventMode.ONLINE.getValue(), - PaymentType.PAID.getValue()); + PaymentType.PAID.getValue(), "행사기관"); private static final EventResponse 모바일_컨퍼런스 = new EventResponse(null, "모바일 컨퍼런스", null, null, List.of(), "UPCOMING", "UPCOMING", null, 0, 0, EventMode.ONLINE.getValue(), - PaymentType.PAID.getValue()); + PaymentType.PAID.getValue(), "행사기관"); private static final EventResponse AI_아이디어_공모전 = new EventResponse(null, "AI 아이디어 공모전", null, null, List.of(), "ENDED", "ENDED", null, 0, 0, EventMode.ONLINE.getValue(), - PaymentType.PAID.getValue()); + PaymentType.PAID.getValue(), "행사기관"); private static final EventResponse 구름톤 = new EventResponse(null, "구름톤", null, null, List.of(), "IN_PROGRESS", "IN_PROGRESS", null, 0, 0, EventMode.ONLINE.getValue(), - PaymentType.PAID.getValue()); + PaymentType.PAID.getValue(), "행사기관"); private static final LocalDate TODAY = LocalDate.of(2023, 7, 21); diff --git a/backend/emm-sale/src/test/java/com/emmsale/scrap/application/ScrapQueryServiceTest.java b/backend/emm-sale/src/test/java/com/emmsale/scrap/application/ScrapQueryServiceTest.java index dc56ddc49..63220d57f 100644 --- a/backend/emm-sale/src/test/java/com/emmsale/scrap/application/ScrapQueryServiceTest.java +++ b/backend/emm-sale/src/test/java/com/emmsale/scrap/application/ScrapQueryServiceTest.java @@ -50,14 +50,14 @@ void findAllScrapsTest() { Collections.emptyList(), "ENDED", "ENDED", event1.getImageUrl(), event1.getEventPeriod() .calculateRemainingDays(LocalDate.now()), event1.getEventPeriod() .calculateApplyRemainingDays(LocalDate.now()), event1 - .getEventMode().getValue(), event1.getPaymentType().getValue()), + .getEventMode().getValue(), event1.getPaymentType().getValue(), "인프런"), new EventResponse(event2.getId(), event2.getName(), event2.getEventPeriod().getStartDate(), event2.getEventPeriod().getEndDate(), Collections.emptyList(), "ENDED", "ENDED", event2.getImageUrl(), event2.getEventPeriod() .calculateRemainingDays(LocalDate.now()), event2.getEventPeriod() .calculateApplyRemainingDays(LocalDate.now()), event2 - .getEventMode().getValue(), event2.getPaymentType().getValue()) + .getEventMode().getValue(), event2.getPaymentType().getValue(), "행사기관") ); //then assertThat(actual)