[#22] Feature : 목표 생성, 수정, 완료, 삭제, 목록 조회 및 완료 목록 조회 API#33
Open
[#22] Feature : 목표 생성, 수정, 완료, 삭제, 목록 조회 및 완료 목록 조회 API#33
Conversation
Open
DevKimJH
reviewed
Sep 6, 2023
| return GoalUpdateResponse.of(completedGoal); | ||
| } | ||
|
|
||
| public boolean deleteGoal(Long id) { |
Contributor
There was a problem hiding this comment.
- 삭제 처리도 예외가 있으면 어떨까요?
- 삭제 실패하고 return true 되는 케이스가 있을수도 있을까요...?
DevKimJH
reviewed
Sep 6, 2023
| private String name; | ||
| private int amount; | ||
| private int currentAmount; | ||
| @JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss") |
Contributor
There was a problem hiding this comment.
목표 입력 및 수정할 때 받는 Time이 사용되는 곳이 있나요?!
Author
There was a problem hiding this comment.
목표 시작일, 종료일 수정하는 경우가 있다고 생각해서 사용했습니다 ..! 수정이 필요할까요 ? !
ikjo39
reviewed
Sep 8, 2023
Comment on lines
+25
to
+30
| // Optional<Member> optionalMember = memberRepository.findByOauthId(request.getOauthId()); | ||
| // if (!optionalMember.isPresent()) { | ||
| // throw new RuntimeException("id not found."); | ||
| // } | ||
| // | ||
| // Member member = optionalMember.get(); |
ikjo39
reviewed
Sep 8, 2023
|
|
||
| public GoalUpdateResponse updateGoal(GoalUpdateRequest request, Long id) { | ||
|
|
||
| // Member member = memberRepository.findByOauthId(oauthId).orElseThrow(() -> new RuntimeException("Id not found")); |
ikjo39
reviewed
Sep 8, 2023
Comment on lines
+67
to
+81
| Long goalId = goalRepository.findById(id).orElseThrow(() -> new RuntimeException("Goal not found")) | ||
| .getId(); | ||
|
|
||
| Goal updatedGoal = Goal.builder() | ||
| .id(goalId) | ||
| .member(member) | ||
| .amount(request.getAmount()) | ||
| .currentAmount(request.getCurrentAmount()) | ||
| .name(request.getName()) | ||
| .startDate(request.getStartDate()) | ||
| .endDate(request.getEndDate()) | ||
| .isCompleted(false) | ||
| .build(); | ||
|
|
||
| goalRepository.save(updatedGoal); |
Contributor
There was a problem hiding this comment.
이렇게 진행하시면 업데이트가 아니라 새로운 데이터가 추가될거 같네요
한번 확인해보심이 좋을듯 합니다!
ikjo39
reviewed
Sep 8, 2023
ikjo39
reviewed
Sep 8, 2023
| public List<GoalListResponse> getAllGoals(String oauthId) { | ||
|
|
||
|
|
||
| List<Goal> goalList = goalRepository.findAllByMemberId_OauthIdAndIsCompletedFalse(oauthId); |
Contributor
There was a problem hiding this comment.
goalRepository 변경부분이 없어 에러가 뜨네요!
커밋 확인해보셔야할거 같아요!
ikjo39
reviewed
Sep 8, 2023
ikjo39
reviewed
Sep 8, 2023
src/main/java/com/project/poorlex/api/controller/GoalController.java
Outdated
Show resolved
Hide resolved
Co-authored-by: 조형익 <70360890+ikjo39@users.noreply.github.com>
Co-authored-by: 조형익 <70360890+ikjo39@users.noreply.github.com>
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.
Issue
Description
Todo
ETC