diff --git a/src/main/java/ussum/homepage/application/post/controller/PostManageController.java b/src/main/java/ussum/homepage/application/post/controller/PostManageController.java index bbfc9a62..04cd8fb4 100644 --- a/src/main/java/ussum/homepage/application/post/controller/PostManageController.java +++ b/src/main/java/ussum/homepage/application/post/controller/PostManageController.java @@ -2,7 +2,9 @@ import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.media.Content; import lombok.RequiredArgsConstructor; +import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -79,11 +81,13 @@ public ResponseEntity> createDataPost(@Parameter(hidden = true) @ return ApiResponse.success(postManageService.createDataPost(userId, subCategory, postCreateRequest)); } - @PostMapping("/{boardCode}/files") + @PostMapping(value = "/{boardCode}/files", consumes = MediaType.MULTIPART_FORM_DATA_VALUE, + produces = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity> createBoardPostFile(@Parameter(hidden = true) @UserId Long userId, @PathVariable(name = "boardCode") String boardCode, @RequestPart(value = "files") MultipartFile[] files, @RequestParam(value = "type") String typeName) { + return ApiResponse.success(postManageService.createBoardPostFile(userId, boardCode, files, typeName)); }