-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: 포인트 API 구현 #29 #31
Conversation
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.
포인트 부족 시 예외처리 코드도 추가 부탁드립니다!
반영했습니다! |
|
||
@RequiredArgsConstructor | ||
@Service | ||
public class StatementService { | ||
private StatementRepository statementRepository; | ||
|
||
public Statement createStatement(Member member, StatementServiceDTO.CreateStatementDTO dto) { | ||
public Optional<Statement> createStatement(Member member, StatementServiceDTO.CreateStatementDTO dto) { |
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.
금액이 부족할 땐 null을 반환하지 말고 Exception을 throw해주세요!
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.
반영했습니다!
@@ -28,7 +28,7 @@ public Statement getStatement(Long statementId) { | |||
return statementRepository.findByStatementId(statementId).get(); | |||
} | |||
|
|||
public Long getTotalAmountOfMember(Member member) { | |||
public Long getTotalAmount(Member member) { | |||
return statementRepository.findTotalAmountByMember(member); | |||
} | |||
|
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.
메서드 이름 수정은 코드 결과의 변화가 없기 때문에 깃 메시지 작성 시 fix 키워드가 아닌 refactor 키워드를 사용해주셔야 합니다!
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.
👍 👍 👍
Controller 단에서는 다음과 같은 API를 구현했습니다
포인트 내역 추가생각해보니 클라이언트 쪽에서 포인트 내역을 추가할 일이 없어서 삭제했습니다Service 단에서는 다음과 같은 기능을 구현했습니다.
포인트 사용 및 적립의 경우, 포인트 내역 추가를 통해 구현이 될 거 같아서 별도로 만들지 않았습니다