-
Notifications
You must be signed in to change notification settings - Fork 1
refactor: 포인트 도메인 리펙토링 #231
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
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
1afa6b1
refactor : 자료형 변경 Long -> long
Seungcode 12307f3
refactor : builder 제거
Seungcode 32e1b18
feat: 포인트 타입 생성 (결제 / 적립)
Seungcode d4b044e
refactor : point 엔티티 Builder 제거
Seungcode 406173c
refactor : History 엔티티 Builder 제거
Seungcode 3060634
refactor: Builder 제거로 인한 save 메소드 변경
Seungcode 94788fc
refactor: Builder 제거로 인한 save 메소드 변경
Seungcode 973c238
test: test 내용 전체 주석처리
Seungcode 2632542
feat: PointNotEnoughExceptionV2 생성
Seungcode 5220d38
feat: PointNotFoundExceptionV2 생성
Seungcode eed58da
feat: getByMember 메서드 생성
Seungcode 44ee6c7
feat: getMemberById 메서드 생성
Seungcode d6f77cd
feat: findHistoryListByMember 메서드 생성
Seungcode a31352f
feat: PointControllerV2 생성
Seungcode bbdbea8
feat: PointServiceV2 생성
Seungcode 1033ecd
feat: PayPointReqV2 생성
Seungcode 3777ce3
feat: HistoryListResV2 생성
Seungcode 26a8b1e
feat: DepositPointReqV2 생성
Seungcode dc3c613
refactor : toResponse -> of
Seungcode 2848333
refactor : getMemberById -> getById
Seungcode 2db80d5
refactor : Transactional 어노테이션 메서드 단위 추가
Seungcode 5d74eb8
refactor : findHistoryListByMember 삭제
Seungcode File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
24 changes: 24 additions & 0 deletions
24
src/main/java/com/kau/capstone/entity/point/PointType.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| package com.kau.capstone.entity.point; | ||
|
|
||
| import lombok.Getter; | ||
|
|
||
| @Getter | ||
| public enum PointType { | ||
| PAYMENT_POINT("포인트 결제"), | ||
| EARN_POINT("포인트 적립"); | ||
|
|
||
| final String description; | ||
|
|
||
| PointType(String description) { | ||
| this.description = description; | ||
| } | ||
|
|
||
| public static PointType getPointType(String description) { | ||
| for (PointType pointType : PointType.values()) { | ||
| if (pointType.description.equals(description)) { | ||
| return pointType; | ||
| } | ||
| } | ||
| return null; | ||
| } | ||
| } |
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
13 changes: 13 additions & 0 deletions
13
src/main/java/com/kau/capstone/entity/point/repository/PointRepository.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,20 @@ | ||
| package com.kau.capstone.entity.point.repository; | ||
|
|
||
| import com.kau.capstone.entity.member.Member; | ||
| import com.kau.capstone.entity.point.Point; | ||
| import com.kau.capstone.v2.point.exception.PointNotFoundExceptionV2; | ||
| import org.springframework.data.jpa.repository.JpaRepository; | ||
| import org.springframework.data.jpa.repository.Query; | ||
| import org.springframework.data.repository.query.Param; | ||
|
|
||
| import java.util.Optional; | ||
|
|
||
| public interface PointRepository extends JpaRepository<Point, Long> { | ||
|
|
||
| @Query("SELECT p FROM Point p WHERE p.member = :member") | ||
| Optional<Point> findByMember(@Param("member") Member member); | ||
|
|
||
| default Point getByMember(Member member){ | ||
| return findByMember(member).orElseThrow(PointNotFoundExceptionV2::new); | ||
| }; | ||
| } | ||
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
2 changes: 1 addition & 1 deletion
2
src/main/java/com/kau/capstone/v1/point/dto/DeliveryFeeRequest.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| package com.kau.capstone.v1.point.dto; | ||
|
|
||
| public record DeliveryFeeRequest( | ||
| Long deliveryFee | ||
| long deliveryFee | ||
| ) { | ||
| } |
2 changes: 1 addition & 1 deletion
2
src/main/java/com/kau/capstone/v1/point/dto/EarnPointRequest.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| package com.kau.capstone.v1.point.dto; | ||
|
|
||
| public record EarnPointRequest( | ||
| Long point | ||
| long point | ||
| ) { | ||
| } |
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
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
2 changes: 1 addition & 1 deletion
2
src/main/java/com/kau/capstone/v1/point/dto/PayPointRequest.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| package com.kau.capstone.v1.point.dto; | ||
|
|
||
| public record PayPointRequest( | ||
| Long point | ||
| long point | ||
| ) { | ||
| } |
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
얘는 왜 Optional 써요