Skip to content

Commit

Permalink
Merge pull request #271 from Codiary-UMC-6th/feature/#265-post-searchโ€ฆ
Browse files Browse the repository at this point in the history
โ€ฆ-api

Feat: ๊ฒŒ์‹œ๊ธ€ ์กฐํšŒ ๊ด€๋ จ API ๊ธฐ๋Šฅ ๊ฐœ๋ฐœ
  • Loading branch information
ParkJh38 authored Nov 12, 2024
2 parents 914b3e8 + f1b8833 commit 84e62b4
Show file tree
Hide file tree
Showing 13 changed files with 649 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.codiary.backend.domain.member.entity.MemberCategory;
import com.codiary.backend.domain.member.repository.MemberCategoryRepository;
import com.codiary.backend.domain.member.repository.MemberRepository;
import com.codiary.backend.domain.post.entity.Post;
import com.codiary.backend.global.apiPayload.code.status.ErrorStatus;
import com.codiary.backend.global.apiPayload.exception.GeneralException;
import lombok.RequiredArgsConstructor;
Expand Down Expand Up @@ -72,4 +73,13 @@ public void deleteCategory(Long memberCategoryId, Long memberId) {
memberCategory.getCategory().getMemberCategoryList().remove(memberCategory);
memberCategoryRepository.delete(memberCategory);
}


@Transactional
public Category addCategory(Post post, String categoryName) {
return categoryRepository.findByName(categoryName)
.orElseGet(() -> categoryRepository.save(Category.builder()
.name(categoryName)
.build()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ public ApiResponse<String> signUp(@Valid @RequestBody MemberRequestDTO.MemberSig
return ApiResponse.onSuccess(SuccessStatus.MEMBER_OK, response);
}

@GetMapping("sign_up/emails/check")
@GetMapping("sign_up/email/check")
@Operation(summary = "์ด๋ฉ”์ผ ์ค‘๋ณต ํ™•์ธ")
public ApiResponse<String> checkEmailDuplication(@Valid @RequestParam String email) {
String response = authService.checkEmailDuplication(email);
return ApiResponse.onSuccess(SuccessStatus.MEMBER_OK, response);
}

@GetMapping("sign_up/nicknames/check")
@GetMapping("sign_up/nickname/check")
@Operation(summary = "๋‹‰๋„ค์ž„ ์ค‘๋ณต ํ™•์ธ")
public ApiResponse<String> checkNicknameDuplication(@Valid @RequestParam String nickname) {
String response = authService.checkNicknameDuplication(nickname);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public ApiResponse<List<MemberResponseDTO.SimpleMemberDTO>> getFollowings() {
}

@Operation(summary = "์œ ์ €๋ฅผ ํŒ”๋กœ์šฐํ•œ ํŒ”๋กœ์›Œ ๋ชฉ๋ก ์กฐํšŒ", description = "๋กœ๊ทธ์ธํ•œ ์œ ์ €๋ฅผ ํŒ”๋กœ์šฐํ•œ ํŒ”๋กœ์›Œ ๋ชฉ๋ก ์กฐํšŒ")
@GetMapping("/followers")
@GetMapping("/follower")
public ApiResponse<List<MemberResponseDTO.SimpleMemberDTO>> getFollowers() {
Member member = memberCommandService.getRequester();
List<Member> followers = followService.getFollowers(member);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

@RequiredArgsConstructor
@RestController
@RequestMapping("/api/v2/members")
@RequestMapping("/api/v2/member")
@Tag(name = "ํšŒ์› API", description = "ํšŒ์›์ •๋ณด ์กฐํšŒ/์ˆ˜์ •/์‚ญ์ œ ๊ด€๋ จ API์ž…๋‹ˆ๋‹ค.")
public class MemberController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
import org.springframework.data.domain.Pageable;
import com.codiary.backend.global.jwt.JwtTokenProvider;

import java.util.Optional;
import java.util.Set;


@RequiredArgsConstructor
@Validated
Expand Down Expand Up @@ -55,7 +58,7 @@ public ApiResponse<PostResponseDTO.CreatePostResultDTO> createPost(@ModelAttribu

// ๋ฉค๋ฒ„์˜ ๊ฒŒ์‹œ๊ธ€ ์ˆ˜์ •ํ•˜๊ธฐ
@PatchMapping(path = "/{postId}", consumes = "multipart/form-data")
@Operation(summary = "๋‹ค์ด์–ด๋ฆฌ ์ˆ˜์ • API", description = "๋‹ค์ด์–ด๋ฆฌ๋ฅผ ์ˆ˜์ •ํ•ฉ๋‹ˆ๋‹ค.")
@Operation(summary = "๊ฒŒ์‹œ๊ธ€ ์ˆ˜์ • API", description = "๊ฒŒ์‹œ๊ธ€์„ ์ˆ˜์ •ํ•ฉ๋‹ˆ๋‹ค.")
public ApiResponse<PostResponseDTO.UpdatePostResultDTO> updatePost(@ModelAttribute PostRequestDTO.UpdatePostDTO request, @PathVariable Long postId){
Member member = memberCommandService.getRequester();
jwtTokenProvider.isValidToken(member.getMemberId());
Expand All @@ -66,7 +69,7 @@ public ApiResponse<PostResponseDTO.UpdatePostResultDTO> updatePost(@ModelAttribu

// ๊ฒŒ์‹œ๊ธ€ ์‚ญ์ œํ•˜๊ธฐ
@DeleteMapping("/{postId}")
@Operation(summary = "๋‹ค์ด์–ด๋ฆฌ ์‚ญ์ œ API", description = "๋‹ค์ด์–ด๋ฆฌ๋ฅผ ์‚ญ์ œํ•ฉ๋‹ˆ๋‹ค.")
@Operation(summary = "๊ฒŒ์‹œ๊ธ€ ์‚ญ์ œ API", description = "๊ฒŒ์‹œ๊ธ€์„ ์‚ญ์ œํ•ฉ๋‹ˆ๋‹ค.")
public ApiResponse<?> deletePost(@PathVariable Long postId){
Member member = memberCommandService.getRequester();
jwtTokenProvider.isValidToken(member.getMemberId());
Expand All @@ -75,56 +78,78 @@ public ApiResponse<?> deletePost(@PathVariable Long postId){
return ApiResponse.onSuccess(SuccessStatus.POST_OK, null);
}

// ์ €์ž์˜ ๋‹ค์ด์–ด๋ฆฌ ๋ฆฌ์ŠคํŠธ ํŽ˜์ด์ง• ์กฐํšŒ
// ์ €์ž์˜ ๊ฒŒ์‹œ๊ธ€ ๋ฆฌ์ŠคํŠธ ํŽ˜์ด์ง• ์กฐํšŒ
@GetMapping("/member/{memberId}/paging")
@Operation(summary = "์ €์ž์˜ ๋‹ค์ด์–ด๋ฆฌ ๋ฆฌ์ŠคํŠธ ํŽ˜์ด์ง• ์กฐํšŒ API", description = "์ €์ž์˜ ๋‹ค์ด์–ด๋ฆฌ ๋ฆฌ์ŠคํŠธ๋ฅผ ํŽ˜์ด์ง•์œผ๋กœ ์กฐํšŒํ•˜๊ธฐ ์œ„ํ•ด 'Path Variable'๋กœ ํ•ด๋‹น ํŒ€์˜ 'memberId'๋ฅผ ๋ฐ›์Šต๋‹ˆ๋‹ค. **์ฒซ ํŽ˜์ด์ง€๋Š” 0๋ถ€ํ„ฐ ์ž…๋‹ˆ๋‹ค.**", security = @SecurityRequirement(name = "accessToken"))
@Operation(summary = "์ €์ž์˜ ๊ฒŒ์‹œ๊ธ€ ๋ฆฌ์ŠคํŠธ ํŽ˜์ด์ง• ์กฐํšŒ API", description = "์ €์ž์˜ ๊ฒŒ์‹œ๊ธ€ ๋ฆฌ์ŠคํŠธ๋ฅผ ํŽ˜์ด์ง•์œผ๋กœ ์กฐํšŒํ•˜๊ธฐ ์œ„ํ•ด 'Path Variable'๋กœ ํ•ด๋‹น ํŒ€์˜ 'memberId'๋ฅผ ๋ฐ›์Šต๋‹ˆ๋‹ค. **์ฒซ ํŽ˜์ด์ง€๋Š” 0๋ถ€ํ„ฐ ์ž…๋‹ˆ๋‹ค.**", security = @SecurityRequirement(name = "accessToken"))
public ApiResponse<PostResponseDTO.MemberPostPreviewListDTO> findPostByMember(@PathVariable Long memberId, @RequestParam @Min(0) Integer page, @RequestParam @Min(1) @Max(5) Integer size) {
Page<Post> posts = postQueryService.getPostsByMember(memberId, page, size);
return ApiResponse.onSuccess(SuccessStatus.POST_OK, PostConverter.toMemberPostPreviewListDTO(posts));
}


// ํŒ€์˜ ๋‹ค์ด์–ด๋ฆฌ ๋ฆฌ์ŠคํŠธ ํŽ˜์ด์ง• ์กฐํšŒ
// ํŒ€์˜ ๊ฒŒ์‹œ๊ธ€ ๋ฆฌ์ŠคํŠธ ํŽ˜์ด์ง• ์กฐํšŒ
@GetMapping("/team/{teamId}/paging")
@Operation(summary = "ํŒ€์˜ ๋‹ค์ด์–ด๋ฆฌ ๋ฆฌ์ŠคํŠธ ํŽ˜์ด์ง• ์กฐํšŒ API", description = "ํŒ€์˜ ๋‹ค์ด์–ด๋ฆฌ ๋ฆฌ์ŠคํŠธ๋ฅผ ํŽ˜์ด์ง•์œผ๋กœ ์กฐํšŒํ•˜๊ธฐ ์œ„ํ•ด 'Path Variable'๋กœ ํ•ด๋‹น ํŒ€์˜ 'teamId'๋ฅผ ๋ฐ›์Šต๋‹ˆ๋‹ค. **์ฒซ ํŽ˜์ด์ง€๋Š” 0๋ถ€ํ„ฐ ์ž…๋‹ˆ๋‹ค.**", security = @SecurityRequirement(name = "accessToken"))
@Operation(summary = "ํŒ€์˜ ๊ฒŒ์‹œ๊ธ€ ๋ฆฌ์ŠคํŠธ ํŽ˜์ด์ง• ์กฐํšŒ API", description = "ํŒ€์˜ ๊ฒŒ์‹œ๊ธ€ ๋ฆฌ์ŠคํŠธ๋ฅผ ํŽ˜์ด์ง•์œผ๋กœ ์กฐํšŒํ•˜๊ธฐ ์œ„ํ•ด 'Path Variable'๋กœ ํ•ด๋‹น ํŒ€์˜ 'teamId'๋ฅผ ๋ฐ›์Šต๋‹ˆ๋‹ค. **์ฒซ ํŽ˜์ด์ง€๋Š” 0๋ถ€ํ„ฐ ์ž…๋‹ˆ๋‹ค.**", security = @SecurityRequirement(name = "accessToken"))
public ApiResponse<PostResponseDTO.TeamPostPreviewListDTO> findPostByTeam(@PathVariable Long teamId, @RequestParam @Min(0) Integer page, @RequestParam @Min(1) @Max(6) Integer size){
Page<Post> posts = postQueryService.getPostsByTeam(teamId, page, size);
return ApiResponse.onSuccess(SuccessStatus.POST_OK, PostConverter.toTeamPostPreviewListDTO(posts));
}


// ํ”„๋กœ์ ํŠธ๋ณ„ ์ €์ž์˜ ๋‹ค์ด์–ด๋ฆฌ ๋ฆฌ์ŠคํŠธ ํŽ˜์ด์ง• ์กฐํšŒ



// ํ”„๋กœ์ ํŠธ๋ณ„ ํŒ€์˜ ๋‹ค์ด์–ด๋ฆฌ ๋ฆฌ์ŠคํŠธ ํŽ˜์ด์ง• ์กฐํšŒ



// ํŒ€๋ณ„ ์ €์ž์˜ ๋‹ค์ด๋Ÿฌ๋ฆฌ ๋ฆฌ์ŠคํŠธ ํŽ˜์ด์ง• ์กฐํšŒ



// ์ œ๋ชฉ์œผ๋กœ ๋‹ค์ด์–ด๋ฆฌ ๋ฆฌ์ŠคํŠธ ํŽ˜์ด์ง• ์กฐํšŒ



// ์นดํ…Œ๊ณ ๋ฆฌ๋ช…์œผ๋กœ ๋‹ค์ด์–ด๋ฆฌ ๋ฆฌ์ŠคํŠธ ํŽ˜์ด์ง• ์กฐํšŒ


// ํ”„๋กœ์ ํŠธ๋ณ„ ์ €์ž์˜ ๊ฒŒ์‹œ๊ธ€ ๋ฆฌ์ŠคํŠธ ํŽ˜์ด์ง• ์กฐํšŒ
@GetMapping("/project/{projectId}/member/{memberId}/paging")
@Operation(summary = "ํ”„๋กœ์ ํŠธ๋ณ„ ์ €์ž์˜ ๊ฒŒ์‹œ๊ธ€ ๋ฆฌ์ŠคํŠธ ํŽ˜์ด์ง• ์กฐํšŒ API", description = "ํ”„๋กœ์ ํŠธ๋ณ„ ์ €์ž์˜ ๊ฒŒ์‹œ๊ธ€ ๋ฆฌ์ŠคํŠธ๋ฅผ ํŽ˜์ด์ง•์œผ๋กœ ์กฐํšŒํ•˜๊ธฐ ์œ„ํ•ด 'Path Variable'๋กœ ํ•ด๋‹น ํ”„๋กœ์ ํŠธ์˜ 'projectId'์™€ ์ €์ž์˜ 'memberId'๋ฅผ ๋ฐ›์Šต๋‹ˆ๋‹ค. **์ฒซ ํŽ˜์ด์ง€๋Š” 0๋ถ€ํ„ฐ ์ž…๋‹ˆ๋‹ค.**", security = @SecurityRequirement(name = "accessToken"))
public ApiResponse<PostResponseDTO.MemberPostInProjectPreviewListDTO> findPostByMemberInProject(@PathVariable Long projectId, @PathVariable Long memberId, @RequestParam @Min(0) Integer page, @RequestParam @Min(1) @Max(5) Integer size){
Page<Post> posts = postQueryService.getPostsByMemberInProject(projectId, memberId, page, size);
return ApiResponse.onSuccess(SuccessStatus.POST_OK, PostConverter.toMemberPostInProjectPreviewListDTO(posts));
}

// ์ธ์ ‘ํ•œ ๋‹ค์ด์–ด๋ฆฌ ์กฐํšŒ (์ด์ „ ๋‹ค์ด์–ด๋ฆฌ, ๋‹ค์Œ ๋‹ค์ด์–ด๋ฆฌ)

// ํ”„๋กœ์ ํŠธ๋ณ„ ํŒ€์˜ ๊ฒŒ์‹œ๊ธ€ ๋ฆฌ์ŠคํŠธ ํŽ˜์ด์ง• ์กฐํšŒ
@GetMapping("/project/{projectId}/team/{teamId}/paging")
@Operation(summary = "ํ”„๋กœ์ ํŠธ๋ณ„ ํŒ€์˜ ๊ฒŒ์‹œ๊ธ€ ๋ฆฌ์ŠคํŠธ ํŽ˜์ด์ง• ์กฐํšŒ API", description = "ํ”„๋กœ์ ํŠธ๋ณ„ ํŒ€์˜ ๊ฒŒ์‹œ๊ธ€ ๋ฆฌ์ŠคํŠธ๋ฅผ ํŽ˜์ด์ง•์œผ๋กœ ์กฐํšŒํ•˜๊ธฐ ์œ„ํ•ด 'Path Variable'๋กœ ํ•ด๋‹น ํ”„๋กœ์ ํŠธ์˜ 'projectId'์™€ ํŒ€์˜ 'teamId'๋ฅผ ๋ฐ›์Šต๋‹ˆ๋‹ค. **์ฒซ ํŽ˜์ด์ง€๋Š” 0๋ถ€ํ„ฐ ์ž…๋‹ˆ๋‹ค.**", security = @SecurityRequirement(name = "accessToken"))
public ApiResponse<PostResponseDTO.TeamPostInProjectPreviewListDTO> findPostByTeamInProject(@PathVariable Long projectId, @PathVariable Long teamId, @RequestParam @Min(0) Integer page, @RequestParam @Min(1) @Max(6) Integer size){
Page<Post> posts = postQueryService.getPostsByTeamInProject(projectId, teamId, page, size);
return ApiResponse.onSuccess(SuccessStatus.POST_OK, PostConverter.toTeamPostInProjectPreviewListDTO(posts));
}


// ํŒ€๋ณ„ ์ €์ž์˜ ๊ฒŒ์‹œ๊ธ€ ๋ฆฌ์ŠคํŠธ ํŽ˜์ด์ง• ์กฐํšŒ
@GetMapping("/team/{teamId}/member/{memberId}/paging")
@Operation(summary = "ํŒ€๋ณ„ ์ €์ž์˜ ๊ฒŒ์‹œ๊ธ€ ๋ฆฌ์ŠคํŠธ ํŽ˜์ด์ง• ์กฐํšŒ API", description = "ํŒ€๋ณ„ ์ €์ž์˜ ๊ฒŒ์‹œ๊ธ€ ๋ฆฌ์ŠคํŠธ๋ฅผ ํŽ˜์ด์ง•์œผ๋กœ ์กฐํšŒํ•˜๊ธฐ ์œ„ํ•ด 'Path Variable'๋กœ ํ•ด๋‹น ํŒ€์˜ 'teamId'์™€ ์ €์ž์˜ 'memberId'๋ฅผ ๋ฐ›์Šต๋‹ˆ๋‹ค. **์ฒซ ํŽ˜์ด์ง€๋Š” 0๋ถ€ํ„ฐ ์ž…๋‹ˆ๋‹ค.**", security = @SecurityRequirement(name = "accessToken"))
public ApiResponse<PostResponseDTO.MemberPostInTeamPreviewListDTO> findPostByMemberInTeam(@PathVariable Long teamId, @PathVariable Long memberId, @RequestParam @Min(0) Integer page, @RequestParam @Min(1) @Max(6) Integer size){
Page<Post> posts = postQueryService.getPostsByMemberInTeam(teamId, memberId, page, size);
return ApiResponse.onSuccess(SuccessStatus.POST_OK, PostConverter.toMemberPostInTeamPreviewListDTO(posts));
}


// ์ œ๋ชฉ์œผ๋กœ ๊ฒŒ์‹œ๊ธ€ ๋ฆฌ์ŠคํŠธ ํŽ˜์ด์ง• ์กฐํšŒ
@GetMapping("/title/paging")
@Operation(summary = "์ œ๋ชฉ์œผ๋กœ ๊ฒŒ์‹œ๊ธ€ ๋ฆฌ์ŠคํŠธ ํŽ˜์ด์ง• ์กฐํšŒ API", description = "์ œ๋ชฉ์œผ๋กœ ๊ฒŒ์‹œ๊ธ€ ๋ฆฌ์ŠคํŠธ๋ฅผ ํŽ˜์ด์ง•์œผ๋กœ ์กฐํšŒํ•ฉ๋‹ˆ๋‹ค. Param์œผ๋กœ ์ œ๋ชฉ์„ ์ž…๋ ฅํ•˜์„ธ์š”.", security = @SecurityRequirement(name = "accessToken"))
public ApiResponse<PostResponseDTO.PostPreviewListDTO> findPostsByTitle(@RequestParam Optional<String> search, @RequestParam @Min(0) Integer page, @RequestParam @Min(1) @Max(9) Integer size) {
Page<Post> posts = postQueryService.getPostsByTitle(Optional.of(search.orElse("")), page, size);
return ApiResponse.onSuccess(SuccessStatus.POST_OK, PostConverter.toPostPreviewListDTO(posts));
}


// // ์นดํ…Œ๊ณ ๋ฆฌ๋ช…์œผ๋กœ ๊ฒŒ์‹œ๊ธ€ ๋ฆฌ์ŠคํŠธ ํŽ˜์ด์ง• ์กฐํšŒ
// @GetMapping("/categories/paging")
// @Operation(summary = "์นดํ…Œ๊ณ ๋ฆฌ๋ช…์œผ๋กœ ๊ฒŒ์‹œ๊ธ€ ๋ฆฌ์ŠคํŠธ ํŽ˜์ด์ง• ์กฐํšŒ API", description = "์นดํ…Œ๊ณ ๋ฆฌ๋ช…์œผ๋กœ ๊ฒŒ์‹œ๊ธ€ ๋ฆฌ์ŠคํŠธ๋ฅผ ํŽ˜์ด์ง• ์กฐํšŒํ•ฉ๋‹ˆ๋‹ค. ์ž…๋ ฅํ•œ ์นดํ…Œ๊ณ ๋ฆฌ๊ฐ€ ํฌํ•จ๋œ ๋ชจ๋“  ๋‹ค์ด์–ด๋ฆฌ๋ฅผ ์กฐํšŒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. Param์œผ๋กœ ์นดํ…Œ๊ณ ๋ฆฌ๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š”.", security = @SecurityRequirement(name = "accessToken"))
// public ApiResponse<PostResponseDTO.PostPreviewListDTO> findPostsByCategoryName(@RequestParam Optional<String> search, @RequestParam @Min(0) Integer page, @RequestParam @Min(1) @Max(9) Integer size){
// Page<Post> posts = postQueryService.getPostsByCategories(Optional.of(search.orElse("")), page, size);
// return ApiResponse.onSuccess(SuccessStatus.POST_OK, PostConverter.toPostPreviewListDTO(posts));
// }


// ์ธ์ ‘ํ•œ ๊ฒŒ์‹œ๊ธ€ ์กฐํšŒ (์ด์ „ ๊ฒŒ์‹œ๊ธ€, ๋‹ค์Œ ๊ฒŒ์‹œ๊ธ€)
@GetMapping("/{postId}/adjacent")
@Operation(summary = "์ธ์ ‘ํ•œ ๊ฒŒ์‹œ๊ธ€ ์กฐํšŒ API", description = "ํŠน์ • ๊ฒŒ์‹œ๊ธ€์˜ ์ธ์ ‘ํ•œ ๊ฒŒ์‹œ๊ธ€์„ ์กฐํšŒํ•ฉ๋‹ˆ๋‹ค.", security = @SecurityRequirement(name = "accessToken"))
public ApiResponse<PostResponseDTO.PostAdjacentDTO> findAdjacentPosts(@PathVariable Long postId){
return ApiResponse.onSuccess(SuccessStatus.POST_OK, PostConverter.toPostAdjacentDTO(postQueryService.findAdjacentPosts(postId)));
}


// ๊ฒŒ์‹œ๊ธ€ ๊ฒ€์ƒ‰ ๊ฒฐ๊ณผ ํŽ˜์ด์ง€๋„ค์ด์…˜
@Operation(summary = "๊ฒŒ์‹œ๊ธ€ ๊ฒ€์ƒ‰ ๊ฒฐ๊ณผ ํŽ˜์ด์ง€๋„ค์ด์…˜", description = "๊ฒŒ์‹œ๊ธ€(์ œ๋ชฉ/๋‚ด์šฉ) ํ‚ค์›Œ๋“œ ๊ฒ€์ƒ‰ ๊ฒฐ๊ณผ๋ฅผ ํŽ˜์ด์ง€๋„ค์ด์…˜ํ•˜์—ฌ ๋ฐ˜ํ™˜ํ•ฉ๋‹ˆ๋‹ค.")
@GetMapping("/search")
public ApiResponse<Page<PostResponseDTO.SimplePostResponseDTO>> searchPost(
Expand All @@ -134,4 +159,15 @@ public ApiResponse<Page<PostResponseDTO.SimplePostResponseDTO>> searchPost(
return ApiResponse.onSuccess(SuccessStatus.POST_OK, PostConverter.toPostListResponseDto(postPage));
}


// ๊ฒŒ์‹œ๊ธ€์˜ ์นดํ…Œ๊ณ ๋ฆฌ ์„ค์ • ๋ฐ ๋ณ€๊ฒฝ
@PatchMapping("/category/{postId}")
@Operation(summary = "๊ฒŒ์‹œ๊ธ€์˜ ์นดํ…Œ๊ณ ๋ฆฌ ์„ค์ • ๋ฐ ๋ณ€๊ฒฝ API", description = "๊ฒŒ์‹œ๊ธ€์˜ ์นดํ…Œ๊ณ ๋ฆฌ๋ฅผ ์„ค์ • ๋ฐ ๋ณ€๊ฒฝํ•ฉ๋‹ˆ๋‹ค.")
public ApiResponse<PostResponseDTO.UpdatePostResultDTO> setPostCategory(@PathVariable Long postId, @RequestBody Set<String> categoryNames){
Member member = memberCommandService.getRequester();
jwtTokenProvider.isValidToken(member.getMemberId());

Post updatedPost = postCommandService.setPostCategories(postId, categoryNames);
return ApiResponse.onSuccess(SuccessStatus.POST_OK, PostConverter.toSetPostCategoriesResultDTO(updatedPost));
}
}
Loading

0 comments on commit 84e62b4

Please sign in to comment.