diff --git a/src/main/java/com/pickple/server/api/moim/controller/MoimController.java b/src/main/java/com/pickple/server/api/moim/controller/MoimController.java index 4f0f63b4..77d997de 100644 --- a/src/main/java/com/pickple/server/api/moim/controller/MoimController.java +++ b/src/main/java/com/pickple/server/api/moim/controller/MoimController.java @@ -54,4 +54,10 @@ public ApiResponseDto getMoimListByCategory(@RequestParam String category) { return ApiResponseDto.success(SuccessCode.MOIM_LIST_BY_CATEGORY_GET_SUCCESS, moimQueryService.getMoimListByCategory(category)); } + + @GetMapping("/v1/moim/{moimId}/description") + public ApiResponseDto getMoimDescription(@PathVariable Long moimId) { + return ApiResponseDto.success(SuccessCode.MOIM_DESCRIPTION_GET_SUCCESS, + moimQueryService.getMoimDescription(moimId)); + } } diff --git a/src/main/java/com/pickple/server/api/moim/dto/response/MoimDescriptionResponse.java b/src/main/java/com/pickple/server/api/moim/dto/response/MoimDescriptionResponse.java new file mode 100644 index 00000000..da0e553a --- /dev/null +++ b/src/main/java/com/pickple/server/api/moim/dto/response/MoimDescriptionResponse.java @@ -0,0 +1,9 @@ +package com.pickple.server.api.moim.dto.response; + +import lombok.Builder; + +@Builder +public record MoimDescriptionResponse( + String description +) { +} diff --git a/src/main/java/com/pickple/server/api/moim/service/MoimQueryService.java b/src/main/java/com/pickple/server/api/moim/service/MoimQueryService.java index 6e6a7d13..3417e245 100644 --- a/src/main/java/com/pickple/server/api/moim/service/MoimQueryService.java +++ b/src/main/java/com/pickple/server/api/moim/service/MoimQueryService.java @@ -2,6 +2,7 @@ import com.pickple.server.api.moim.domain.Moim; import com.pickple.server.api.moim.dto.response.MoimByCategoryResponse; +import com.pickple.server.api.moim.dto.response.MoimDescriptionResponse; import com.pickple.server.api.moim.dto.response.MoimDetailResponse; import com.pickple.server.api.moim.dto.response.SubmittedMoimResponse; import com.pickple.server.api.moim.repository.MoimRepository; @@ -62,4 +63,11 @@ public List getMoimListByCategory(final String category) .build()) .collect(Collectors.toList()); } + + public MoimDescriptionResponse getMoimDescription(final Long moimId) { + Moim moim = moimRepository.findMoimByIdOrThrow(moimId); + return MoimDescriptionResponse.builder() + .description(moim.getDescription()) + .build(); + } } diff --git a/src/main/java/com/pickple/server/global/response/enums/SuccessCode.java b/src/main/java/com/pickple/server/global/response/enums/SuccessCode.java index a86c466a..2df089e3 100644 --- a/src/main/java/com/pickple/server/global/response/enums/SuccessCode.java +++ b/src/main/java/com/pickple/server/global/response/enums/SuccessCode.java @@ -22,7 +22,7 @@ public enum SuccessCode { SUBMITTED_MOIM_DETAIL_GET_SUCCESS(20008, HttpStatus.OK, "신청한 모임 상세 정보 조회 성공"), HOST_POST_SUCCESS(20009, HttpStatus.OK, "공지사항 작성 성공"), MOIM_LIST_BY_CATEGORY_GET_SUCCESS(20010, HttpStatus.OK, "카테고리에 해당하는 모임 조회 성공"), - + MOIM_DESCRIPTION_GET_SUCCESS(20012, HttpStatus.OK, "모임에 해당하는 소개 조회 성공"), //201 Created MOIM_CREATE_SUCCESS(20100, HttpStatus.CREATED, "모임 개설 성공");