Skip to content

Commit

Permalink
fix(article): @ReqeustBody 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobhboy committed Apr 30, 2024
1 parent 81aac39 commit fa7ea97
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
Expand All @@ -20,8 +21,10 @@
import com.sickgyun.server.auth.annotation.LoginRequired;
import com.sickgyun.server.auth.service.implementation.AuthReader;

import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;

@Valid
@RestController
@RequiredArgsConstructor
@RequestMapping("/articles")
Expand All @@ -34,7 +37,7 @@ public class ArticleController {
@PostMapping
@LoginRequired
@ResponseStatus(HttpStatus.CREATED)
public void create(ArticleCreateRequest creatRequest) {
public void create(@RequestBody ArticleCreateRequest creatRequest) {
commandService.create(
creatRequest.toEntity(
authReader.getCurrentUser()
Expand Down Expand Up @@ -70,7 +73,7 @@ public List<ArticleResponse> findMine() {
@LoginRequired
@PutMapping("/{id}")
@ResponseStatus(HttpStatus.CREATED)
public void update(ArticleUpdateRequest updateRequest, @PathVariable Long id) {
public void update(@RequestBody ArticleUpdateRequest updateRequest, @PathVariable Long id) {
commandService.update(
updateRequest.toEntity(
authReader.getCurrentUser()
Expand Down

0 comments on commit fa7ea97

Please sign in to comment.