Skip to content

Commit

Permalink
[Refactor] 횃불이 이미지 생성관련 스웨거 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
hen715 committed May 1, 2024
1 parent dfdaaf1 commit fb4378c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ public class FireController {

@Operation(summary = "횃불이 ai 그림 그리기",description = "바디에 {param}을 json 형식으로 보내주세요. 성공 시 만들어진 이미지의 데이터베이스 아이디 값이 {data: id}으로 보내집니다.")
@ApiResponses({
@ApiResponse(responseCode = "201",description = "횃불이 ai 그림 그리기 성공",content = @Content(schema = @Schema(implementation = ResponseDto.class)))
@ApiResponse(responseCode = "201",description = "횃불이 ai 그림 그리기 성공",content = @Content(schema = @Schema(implementation = ResponseDto.class))),
@ApiResponse(responseCode = "400",description = "횃불이 ai 이미지 생성 uri에 문제가 있습니다.",content = @Content(schema = @Schema(implementation = ResponseDto.class)))
})
@PostMapping("")
public ResponseEntity<ResponseDto<Long>> drawFireAiImage(@Valid@RequestBody FireDto fireDto){
Expand All @@ -53,8 +54,7 @@ public ResponseEntity<byte[]> drawFireAiImage(@PathVariable Long id){

@Operation(summary = "ai 생성 요청 uri 변경",description = "바디에 {uri}을 json 형식으로 보내주세요.")
@ApiResponses({
@ApiResponse(responseCode = "200",description = "ai 생성 요청 uri 변경 성공",content = @Content(schema = @Schema(implementation = ResponseDto.class))),
@ApiResponse(responseCode = "400",description = "횃불이 ai 이미지 생성 uri에 문제가 있습니다.",content = @Content(schema = @Schema(implementation = ResponseDto.class)))
@ApiResponse(responseCode = "200",description = "ai 생성 요청 uri 변경 성공",content = @Content(schema = @Schema(implementation = ResponseDto.class)))
})
@PostMapping("/uri")
public ResponseEntity<ResponseDto<Long>> changeRequestUri(@Valid @RequestBody UriDto uriDto){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.http.converter.HttpMessageNotReadableException;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.validation.BindingResult;
import org.springframework.validation.FieldError;
import org.springframework.web.bind.MethodArgumentNotValidException;
Expand All @@ -27,7 +26,7 @@ public ResponseEntity<ResponseDto<Integer>> handleConstraintViolationException(C
}

@ExceptionHandler(MyException.class)
public ResponseEntity<ResponseDto<Integer>> MyNotFoundException(MyException ex){
public ResponseEntity<ResponseDto<Integer>> MyException(MyException ex){
log.error("예외 발생 msg:{}",ex.getErrorCode().getMessage());
return new ResponseEntity<>(new ResponseDto<>(-1,ex.getErrorCode().getMessage()),ex.getErrorCode().getStatus());
}
Expand Down

0 comments on commit fb4378c

Please sign in to comment.