11package com .somemore .domains .recruitboard .controller ;
22
33
4+ import static org .springframework .http .MediaType .MULTIPART_FORM_DATA_VALUE ;
5+
46import com .somemore .domains .recruitboard .dto .request .RecruitBoardCreateRequestDto ;
57import com .somemore .domains .recruitboard .dto .request .RecruitBoardLocationUpdateRequestDto ;
68import com .somemore .domains .recruitboard .dto .request .RecruitBoardStatusUpdateRequestDto ;
1517import io .swagger .v3 .oas .annotations .Operation ;
1618import io .swagger .v3 .oas .annotations .tags .Tag ;
1719import jakarta .validation .Valid ;
20+ import java .util .UUID ;
1821import lombok .RequiredArgsConstructor ;
1922import org .springframework .security .access .annotation .Secured ;
20- import org .springframework .web .bind .annotation .*;
23+ import org .springframework .web .bind .annotation .DeleteMapping ;
24+ import org .springframework .web .bind .annotation .PatchMapping ;
25+ import org .springframework .web .bind .annotation .PathVariable ;
26+ import org .springframework .web .bind .annotation .PostMapping ;
27+ import org .springframework .web .bind .annotation .PutMapping ;
28+ import org .springframework .web .bind .annotation .RequestBody ;
29+ import org .springframework .web .bind .annotation .RequestMapping ;
30+ import org .springframework .web .bind .annotation .RequestPart ;
31+ import org .springframework .web .bind .annotation .RestController ;
2132import org .springframework .web .multipart .MultipartFile ;
2233
23- import java .time .LocalDateTime ;
24- import java .util .UUID ;
25-
26- import static org .springframework .http .MediaType .MULTIPART_FORM_DATA_VALUE ;
27-
2834@ Tag (name = "Recruit Board Command API" , description = "봉사 활동 모집글 생성 수정 삭제 API" )
2935@ RequiredArgsConstructor
3036@ RequestMapping ("/api" )
@@ -44,7 +50,6 @@ public ApiResponse<Long> createRecruitBoard(
4450 @ Valid @ RequestPart ("data" ) RecruitBoardCreateRequestDto requestDto ,
4551 @ RequestPart (value = "img_file" , required = false ) MultipartFile image
4652 ) {
47-
4853 String imgUrl = imageUploadUseCase .uploadImage (new ImageUploadRequestDto (image ));
4954 return ApiResponse .ok (
5055 201 ,
@@ -63,9 +68,7 @@ public ApiResponse<String> updateRecruitBoard(
6368 @ RequestPart (value = "img_file" , required = false ) MultipartFile image
6469 ) {
6570 String imgUrl = imageUploadUseCase .uploadImage (new ImageUploadRequestDto (image ));
66- LocalDateTime now = LocalDateTime .now ();
67- updateRecruitBoardUseCase .updateRecruitBoard (requestDto , id , userId , imgUrl , now );
68-
71+ updateRecruitBoardUseCase .updateRecruitBoard (requestDto , id , userId , imgUrl );
6972 return ApiResponse .ok ("봉사 활동 모집글 수정 성공" );
7073 }
7174
@@ -77,8 +80,7 @@ public ApiResponse<String> updateRecruitBoardLocation(
7780 @ PathVariable Long id ,
7881 @ Valid @ RequestBody RecruitBoardLocationUpdateRequestDto requestDto
7982 ) {
80- LocalDateTime now = LocalDateTime .now ();
81- updateRecruitBoardUseCase .updateRecruitBoardLocation (requestDto , id , userId , now );
83+ updateRecruitBoardUseCase .updateRecruitBoardLocation (requestDto , id , userId );
8284 return ApiResponse .ok ("봉사 활동 모집글 위치 수정 성공" );
8385 }
8486
@@ -90,9 +92,7 @@ public ApiResponse<String> updateRecruitBoardStatus(
9092 @ PathVariable Long id ,
9193 @ RequestBody RecruitBoardStatusUpdateRequestDto requestDto
9294 ) {
93- LocalDateTime now = LocalDateTime .now ();
94- updateRecruitBoardUseCase .updateRecruitBoardStatus (requestDto .status (), id , userId , now );
95-
95+ updateRecruitBoardUseCase .updateRecruitBoardStatus (requestDto .status (), id , userId );
9696 return ApiResponse .ok ("봉사 활동 모집글 상태 수정 성공" );
9797 }
9898
@@ -106,5 +106,4 @@ public ApiResponse<String> deleteRecruitBoard(
106106 deleteRecruitBoardUseCase .deleteRecruitBoard (userId , id );
107107 return ApiResponse .ok ("봉사 활동 모집글 삭제 성공" );
108108 }
109-
110109}
0 commit comments