-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from 9oormthon-univ/feat/point-2
[FEAT] 포인트 이전/이전 조회 API
- Loading branch information
Showing
5 changed files
with
137 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
8 changes: 8 additions & 0 deletions
8
src/main/java/com/groom/swipo/domain/point/dto/Request/PointTransferRequest.java
This file contains 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,8 @@ | ||
package com.groom.swipo.domain.point.dto.Request; | ||
|
||
public record PointTransferRequest( | ||
String fromCardId, | ||
String toCardId, | ||
Integer point | ||
){ | ||
} |
20 changes: 20 additions & 0 deletions
20
src/main/java/com/groom/swipo/domain/point/dto/Response/PointTransferInfoResponse.java
This file contains 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,20 @@ | ||
package com.groom.swipo.domain.point.dto.Response; | ||
|
||
import java.util.List; | ||
|
||
import com.groom.swipo.domain.point.dto.CardInfo; | ||
|
||
import lombok.Builder; | ||
|
||
@Builder | ||
public record PointTransferInfoResponse( | ||
Integer cardNum, | ||
List<CardInfo> cards | ||
) { | ||
public static PointTransferInfoResponse of(Integer cardNum, List<CardInfo> cards){ | ||
return PointTransferInfoResponse.builder() | ||
.cardNum(cardNum) | ||
.cards(cards) | ||
.build(); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/main/java/com/groom/swipo/domain/point/dto/Response/PointTransferResponse.java
This file contains 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,22 @@ | ||
package com.groom.swipo.domain.point.dto.Response; | ||
|
||
import com.groom.swipo.domain.point.entity.Card; | ||
|
||
import lombok.Builder; | ||
|
||
@Builder | ||
public record PointTransferResponse( | ||
String fromCardId, | ||
String toCardId, | ||
Integer fromPoint, | ||
Integer toPoint | ||
) { | ||
public static PointTransferResponse of(Card fromCard, Card toCard) { | ||
return PointTransferResponse.builder() | ||
.fromCardId(String.valueOf(fromCard.getId())) | ||
.toCardId(String.valueOf(toCard.getId())) | ||
.fromPoint(fromCard.getTotalPoint()) | ||
.toPoint(toCard.getTotalPoint()) | ||
.build(); | ||
} | ||
} |
This file contains 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