(김기현) Todo 일기 작성하기 (Side-Project) 리뷰 부탁드립니다.#2
Open
Duskafka wants to merge 63 commits intokihyun/mainfrom
Open
(김기현) Todo 일기 작성하기 (Side-Project) 리뷰 부탁드립니다.#2Duskafka wants to merge 63 commits intokihyun/mainfrom
Duskafka wants to merge 63 commits intokihyun/mainfrom
Conversation
DongGeon0908
reviewed
Feb 6, 2023
Member
DongGeon0908
left a comment
There was a problem hiding this comment.
현재 Todo는 titler과 content만으로 구분되고 있는데요!
어떤 날짜에 어떤 todo 목록들이 있고, 이걸 관리하는 기능을 새롭게 구현해보는 건 어떨까요?
DongGeon0908
reviewed
Feb 8, 2023
| } | ||
|
|
||
| @ApiOperation(value = "Diary 단건 조회하기") | ||
| @GetMapping("/search/single/{id}") |
Member
There was a problem hiding this comment.
Suggested change
| @GetMapping("/search/single/{id}") | |
| @GetMapping("/{id}") |
| } | ||
|
|
||
| @ApiOperation(value = "Diary 범위 조회") | ||
| @GetMapping("/search/month/{month}") |
Member
There was a problem hiding this comment.
이런 경우에는 month를 Request Param으로
| } | ||
|
|
||
| @ApiOperation(value = "Diary 범위 조회") | ||
| @GetMapping("/search/month/{month}") |
Member
There was a problem hiding this comment.
음 여러 조건으로 검색 기능을 만드신 것 같은데, API를 나누지 말고, 검색 모듈을 만드는게 어떨까요?
| } | ||
|
|
||
| @ApiOperation(value = "Diary 삭제하기") | ||
| @DeleteMapping("/delete/id/{id}") |
Member
There was a problem hiding this comment.
Suggested change
| @DeleteMapping("/delete/id/{id}") | |
| @DeleteMapping("/{id}") |
| } | ||
|
|
||
| @ApiOperation(value = "Diary 수정하기") | ||
| @PutMapping("/update/{id}") // @PatchMapping |
Member
There was a problem hiding this comment.
Suggested change
| @PutMapping("/update/{id}") // @PatchMapping | |
| @PutMapping("/{id}") |
| private int day; | ||
|
|
||
| @Column(name = "feel") | ||
| private Feeling feel; |
| public void monthDelete(int month) { | ||
| List<Long> deleteId = new LinkedList<>(); | ||
|
|
||
| diaryRepository.findAll().forEach(eachDiary -> { |
Member
There was a problem hiding this comment.
특정 달에 대한 데이터만 조회해서 삭제하는게 어떨까요?
Member
There was a problem hiding this comment.
특정달에 대한 데이터를 삭제하는 쿼리를 만들어서 진행하는 건 어떨까요?
예시는
deletebydatetimebetween...
Comment on lines
+68
to
+77
| @Transactional(readOnly = true) | ||
| public Page<DiaryResponse> getRange(Pageable pageable, int month) { | ||
| log.info("Todo 범위 조회"); | ||
| Page<DiaryResponse> allPage = diaryRepository.findAll(pageable).map(DiaryResponse::from); | ||
| List<DiaryResponse> middleProcess = allPage.stream().filter(a -> a.getMonth() == month).collect(Collectors.toList()); | ||
| PageRequest pageRequest = PageRequest.of(0, 10); | ||
| int start = (int) pageRequest.getOffset(); | ||
| int end = Math.min((start + pageRequest.getPageSize()), middleProcess.size()); | ||
| return new PageImpl<>(middleProcess.subList(start, end), pageRequest, middleProcess.size()); | ||
| } |
|
|
||
| @Api(tags = {"Diary API"}) | ||
| @RestController | ||
| @RequestMapping(value = "/api/v1/Diarys/default", produces = MediaType.APPLICATION_JSON_VALUE) |
Member
There was a problem hiding this comment.
REST API
- POST : /api/v1/diaries
- GET : /api/v1/diaries
- GET : /api/v1/diaries/{id}
- PUT : /api/v1/diaries/{id}
- DELETE : /api/v1/diaries/{id}
이 형태 아닌가요?
그리고 url path에 왜 대문자가 들어가는걸까용?
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.