Open
Conversation
Owner
|
Good!! |
Chuseok22
reviewed
Sep 30, 2024
| } | ||
|
|
||
| @PostMapping("/users/join") | ||
| private User findUserById(@RequestParam("username") String username, @RequestParam("password") String password, @RequestParam("nickname") String nickname) { |
Owner
There was a problem hiding this comment.
물론 스프링 컨테이너가 post요청으로 /users/join이라는 엔드포인트로 들어온 요청을 자동으로 처리해줘
따라서 메서드명을 어떻게 작성해도 크게 상관은 없어
그래도 통상적인 방법으로 작성해주면 좋아요~
findUserById는 Id값으로 유저를 찾는다는 의미니까
login, join 또는 signUp 등등 회원가입이나 로그인에 해당하는 메서드 명으로 수정해주면 좋습니다~
Chuseok22
reviewed
Sep 30, 2024
Comment on lines
+18
to
+30
| private User findUserById(@RequestParam("username") String username, @RequestParam("password") String password, @RequestParam("nickname") String nickname) { | ||
| return userService.saveUser(username, password, nickname); | ||
| } | ||
|
|
||
| @GetMapping("/users/id/{id}") | ||
| private User findUserById(@PathVariable("id") Long id) { | ||
| return userService.findUserById(id); | ||
| } | ||
|
|
||
| @GetMapping("/users/username/{username}") | ||
| private User findUserByUsername(@PathVariable("username") String username) { | ||
| return userService.findUserByUsername(username); | ||
| } |
Owner
There was a problem hiding this comment.
모든 메서드의 접근제한자가 private인데 controller에서 메서드는 public 으로 수정해주세요~
public User findUserById
public User findUserByUsername
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.