Skip to content

Commit

Permalink
fix: @RequestBody 추가 #3
Browse files Browse the repository at this point in the history
  • Loading branch information
623nana committed Aug 16, 2021
1 parent 456bd34 commit 058fd3d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RequiredArgsConstructor
Expand Down Expand Up @@ -40,7 +41,7 @@ public BaseResponse<List<QuestionResponse>> findQuestionsByOptionId(
}

@PostMapping("/letters")
public BaseResponse<LetterResponse> saveLetter(LetterRequest letterRequest) {
public BaseResponse<LetterResponse> saveLetter(@RequestBody LetterRequest letterRequest) {
LetterResponse letter = letterService.saveLetter(letterRequest);
return new BaseResponse<>(200, 0, "", letter);
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/nexters/covid/user/api/UserController.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
Expand All @@ -18,7 +19,7 @@ public class UserController {
private final UserService userService;

@PostMapping("/login")
public BaseResponse<LoginResponse> login(LoginRequest loginRequest) {
public BaseResponse<LoginResponse> login(@RequestBody LoginRequest loginRequest) {
LoginResponse user = userService.login(loginRequest);
return new BaseResponse<>(200, 0, "", user);
}
Expand Down

0 comments on commit 058fd3d

Please sign in to comment.