Open
Conversation
daye200
reviewed
Sep 30, 2024
|
|
||
| ### VS Code ### | ||
| .vscode/ | ||
|
|
Chuseok22
reviewed
Sep 30, 2024
Comment on lines
+27
to
+28
| User savedUser = userService.saveUser(username, password, nickname); | ||
| return savedUser; |
Owner
There was a problem hiding this comment.
이거는 수정할 부분은 아니고 참고하면 좋은 부분이라 comment 남겨요
UserService의 saveUser라는 메서드 리턴값을 보면 User를 리턴하죠?
그래서 27, 28번 째 줄을 하나로 합칠 수 있어요
savedUser라는 변수를 할당해서 지금처럼 리턴해도 되고
코드를 한줄이라도 줄이고 싶다면
return userService.saveUser(username, password, nickname); 이런식으로 줄이는 것도 가능합니다
물론 이거는 본인 코딩 스타일이라 굳이 어떤 방법이 좋다 이건 없어
Chuseok22
reviewed
Sep 30, 2024
Comment on lines
+23
to
+25
| @RequestParam String username, | ||
| @RequestParam String password, | ||
| @RequestParam String nickname) { |
Owner
There was a problem hiding this comment.
Good!
생략해도 무관한 부분이라 굳이 수정 안해도 괜찮아~
@RequestParam("username") String username,
@RequestParam("password") String password,
@RequestParam("nickname") String nickname
생략된 부분이 있다는 거 꼭 알고 쓰면 됩니다~
Chuseok22
reviewed
Sep 30, 2024
| } | ||
|
|
||
| @GetMapping("/id/{id}")//데이터 조회할 때 | ||
| public User getUserById(@PathVariable Long id){//변수 값 추출 |
Owner
There was a problem hiding this comment.
여기도 마찬가지
생략된 부분이 있다는 것만 알고 공부하면 돼~
수정 안해도 괜찮아
@PathVariable("id") Long id
Owner
|
Good!! 수정할 부분은 없어요 |
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.