Skip to content

Commit e125d4e

Browse files
committed
refactor: 404응답처리 400번으로 수정
1 parent 04799b7 commit e125d4e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/dmu/dasom/api/domain/news/controller/NewsController.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public ResponseEntity<List<NewsResponseDto>> getAllNews() {
4040
@Operation(summary = "소식 상세 조회", description = "ID로 특정 소식을 조회")
4141
@ApiResponses({
4242
@ApiResponse(responseCode = "200", description = "조회 성공"),
43-
@ApiResponse(responseCode = "404", description = "소식을 찾을 수 없음")
43+
@ApiResponse(responseCode = "400", description = "소식을 찾을 수 없음")
4444
})
4545
@GetMapping("/{id}")
4646
public ResponseEntity<NewsResponseDto> getNewsById(@PathVariable Long id) {
@@ -66,7 +66,7 @@ public ResponseEntity<NewsResponseDto> createNews(@Valid @RequestBody NewsReques
6666
@Operation(summary = "소식 수정", description = "ID로 특정 소식을 수정")
6767
@ApiResponses({
6868
@ApiResponse(responseCode = "200", description = "수정 성공"),
69-
@ApiResponse(responseCode = "404", description = "소식을 찾을 수 없음")
69+
@ApiResponse(responseCode = "400", description = "소식을 찾을 수 없음")
7070
})
7171
@PutMapping("/{id}")
7272
public ResponseEntity<NewsResponseDto> updateNews(@PathVariable Long id, @Valid @RequestBody NewsRequestDto requestDto) {
@@ -78,7 +78,7 @@ public ResponseEntity<NewsResponseDto> updateNews(@PathVariable Long id, @Valid
7878
@Operation(summary = "소식 삭제", description = "ID로 특정 소식을 삭제")
7979
@ApiResponses({
8080
@ApiResponse(responseCode = "204", description = "삭제 성공"),
81-
@ApiResponse(responseCode = "404", description = "소식을 찾을 수 없음")
81+
@ApiResponse(responseCode = "400", description = "소식을 찾을 수 없음")
8282
})
8383
@DeleteMapping("/{id}")
8484
public ResponseEntity<Void> deleteNews(@PathVariable Long id) {

0 commit comments

Comments
 (0)