Skip to content

Commit

Permalink
refactor : ResponseStatus value 값 생략
Browse files Browse the repository at this point in the history
  • Loading branch information
tmxhsk99 committed Jul 15, 2023
1 parent c7b8cc5 commit 12d0811
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
public class ExceptionController {

@ExceptionHandler(TaskNotFound.class)
@ResponseStatus(value = HttpStatus.NOT_FOUND)
@ResponseStatus(HttpStatus.NOT_FOUND)
@ResponseBody
public ErrorResponse TaskNotFoundExceptionHandler(TaskNotFound e) {
return e.toErrorResponse();
}

@ExceptionHandler(InvalidTaskRequest.class)
@ResponseStatus(value = HttpStatus.BAD_REQUEST)
@ResponseStatus(HttpStatus.BAD_REQUEST)
@ResponseBody
public ErrorResponse InvalidTaskExceptionHandler(InvalidTaskRequest e) {
return e.toErrorResponse();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public Task detail(@PathVariable Long id) {
return taskService.getTask(id);
}

@ResponseStatus(value = HttpStatus.CREATED)
@ResponseStatus(HttpStatus.CREATED)
@PostMapping("/tasks")
public Task create(@RequestBody TaskCreate taskCreate) {
taskCreate.validate();
Expand All @@ -41,7 +41,7 @@ public Task update(@PathVariable Long id, @RequestBody TaskEdit task) {
return taskService.updateTask(task);
}

@ResponseStatus(value = HttpStatus.NO_CONTENT)
@ResponseStatus(HttpStatus.NO_CONTENT)
@DeleteMapping("/tasks/{id}")
public void delete(@PathVariable Long id) {
taskService.deleteTask(id);
Expand Down

0 comments on commit 12d0811

Please sign in to comment.