File tree Expand file tree Collapse file tree
src/main/java/com/semosan/api/domain/semofeed/controller Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44import com .semosan .api .common .response .PageResponse ;
55import com .semosan .api .common .status .SuccessStatus ;
66import com .semosan .api .domain .semofeed .controller .docs .SemoFeedControllerDocs ;
7+ import com .semosan .api .domain .semofeed .dto .SemoFeedCreateRequest ;
78import com .semosan .api .domain .semofeed .dto .SemoFeedEmojiRequest ;
89import com .semosan .api .domain .semofeed .dto .SemoFeedEmojiToggleResponse ;
910import com .semosan .api .domain .semofeed .dto .SemoFeedResponse ;
@@ -30,11 +31,12 @@ public class SemoFeedController implements SemoFeedControllerDocs {
3031
3132 @ PostMapping
3233 @ Override
34+ // @RequestBody String 대신 DTO를 사용해 Jackson이 JSON 따옴표를 제거한 뒤 imageUrl을 전달합니다.
3335 public ResponseEntity <ApiResponse <SemoFeedResponse >> create (
3436 @ AuthenticationPrincipal Long userId ,
35- @ RequestBody String imageUrl
37+ @ Valid @ RequestBody SemoFeedCreateRequest request
3638 ) {
37- SemoFeedResponse response = semoFeedService .create (userId , imageUrl );
39+ SemoFeedResponse response = semoFeedService .create (userId , request . imageUrl () );
3840 return ApiResponse .success (SuccessStatus .SEMOFEED_CREATE_SUCCESS , response );
3941 }
4042
Original file line number Diff line number Diff line change 22
33import com .semosan .api .common .response .ApiResponse ;
44import com .semosan .api .common .response .PageResponse ;
5+ import com .semosan .api .domain .semofeed .dto .SemoFeedCreateRequest ;
56import com .semosan .api .domain .semofeed .dto .SemoFeedEmojiRequest ;
67import com .semosan .api .domain .semofeed .dto .SemoFeedEmojiToggleResponse ;
78import com .semosan .api .domain .semofeed .dto .SemoFeedResponse ;
@@ -42,7 +43,7 @@ public interface SemoFeedControllerDocs {
4243 })
4344 ResponseEntity <ApiResponse <SemoFeedResponse >> create (
4445 @ AuthenticationPrincipal Long userId ,
45- @ RequestBody String imageUrl
46+ @ RequestBody SemoFeedCreateRequest request
4647 );
4748
4849 @ Operation (
You can’t perform that action at this time.
0 commit comments