-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[review] f1-washpedia #144
base: refactor/review
Are you sure you want to change the base?
Changes from 3 commits
ddd61fb
c2a17d0
f1d0672
07cb76d
c4e1569
19a24d0
c90f43c
82db412
e0fcb63
1fc0f4e
060196a
5af31d2
44918ee
4d7d388
789b0cb
927b0e7
3afa661
dd9617a
e90ba9f
c4daa01
d3cd247
a4773a2
71676fa
242c2f1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,8 +20,12 @@ | |
public class CommonCodeController { | ||
|
||
private final CommonCodeService commonCodeService; | ||
|
||
// | ||
@GetMapping("/{codeName}") | ||
public ResponseEntity<ApiResponse<List<CommonCodeDto>>> getCommonCode (@PathVariable String codeName){ | ||
|
||
// | ||
List<CommonCodeDto> codes = commonCodeService.getCodes(codeName); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 반환타입을 저장하는 변수를 만드는것도 좋지만 사용처가 없다면 바로 return 문에 넣어주는것은 어떨까요 ?return |
||
|
||
return ApiResponse.toResponseEntity(GET_COMMON_CODE_SUCCESS, codes); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ public class CommonCodeService { | |
|
||
public List<CommonCodeDto> getCodes(String codeName) { | ||
|
||
// | ||
return commonCodeRepository.findAllByUpperNameAndIsUsed(codeName,true) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 항상 true만 반환하는데 spring data jpa 에서 제공하는 true를 그냥 써도 될것같습니다! 참고 사이트 전달드립니다 |
||
.stream() | ||
.map(CommonCodeDto::from) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
만약 버저닝을 해야한다면 어떻게 관리할 수 있을까요?
URL로도 관리할 수 있지만 header를 통해서도 관리하는 방법에 대해 보시면 좋을것 같습니다!