Skip to content

Commit

Permalink
[feat] 모임에 해당하는 소개 조회 API 구현
Browse files Browse the repository at this point in the history
[feat] 모임에 해당하는 소개 조회 API 구현
  • Loading branch information
lreowy authored Jul 12, 2024
2 parents 679d006 + 2e18100 commit 09258e2
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.pickple.server.api.moim.dto.response;

import lombok.Builder;

@Builder
public record MoimDescriptionResponse(
String description
) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -62,4 +63,11 @@ public List<MoimByCategoryResponse> 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();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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, "모임 개설 성공");

Expand Down

0 comments on commit 09258e2

Please sign in to comment.