-
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.
Browse files
Browse the repository at this point in the history
refactor(coin): coin 도메인 리팩토링 및 테스트 코드 작성
- Loading branch information
Showing
42 changed files
with
1,457 additions
and
502 deletions.
There are no files selected for viewing
107 changes: 0 additions & 107 deletions
107
src/main/java/com/project/bumawiki/domain/coin/controller/CoinController.java
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
src/main/java/com/project/bumawiki/domain/coin/controller/dto/TradeRequest.java
This file was deleted.
Oops, something went wrong.
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
30 changes: 30 additions & 0 deletions
30
src/main/java/com/project/bumawiki/domain/coin/domain/TradeVo.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,30 @@ | ||
package com.project.bumawiki.domain.coin.domain; | ||
|
||
import com.project.bumawiki.domain.coin.domain.type.TradeStatus; | ||
|
||
import jakarta.validation.constraints.NotNull; | ||
import jakarta.validation.constraints.Positive; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public class TradeVo { | ||
@NotNull | ||
@Positive | ||
private Long coinPrice; | ||
|
||
@NotNull | ||
@Positive | ||
private Long coinCount; | ||
|
||
public Trade toTrade(CoinAccount coinAccount) { | ||
return new Trade( | ||
coinPrice, | ||
coinCount, | ||
coinPrice * coinCount, | ||
TradeStatus.NONE, | ||
coinAccount.getId() | ||
); | ||
} | ||
} |
18 changes: 0 additions & 18 deletions
18
...java/com/project/bumawiki/domain/coin/domain/TradeWithoutTradeStatusAndCoinAccountId.java
This file was deleted.
Oops, something went wrong.
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
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
10 changes: 0 additions & 10 deletions
10
src/main/java/com/project/bumawiki/domain/coin/exception/AlreadyAwardedTodayException.java
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
src/main/java/com/project/bumawiki/domain/coin/exception/AlreadyCreateAccountException.java
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
src/main/java/com/project/bumawiki/domain/coin/exception/CancelOthersTradeException.java
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
src/main/java/com/project/bumawiki/domain/coin/exception/CoinAccountNotFoundException.java
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
src/main/java/com/project/bumawiki/domain/coin/exception/CoinNotEnoughException.java
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
src/main/java/com/project/bumawiki/domain/coin/exception/MoneyNotEnoughException.java
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
src/main/java/com/project/bumawiki/domain/coin/exception/PriceNotFoundException.java
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
src/main/java/com/project/bumawiki/domain/coin/exception/RandomInstanceException.java
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
src/main/java/com/project/bumawiki/domain/coin/exception/TradeAlreadyFinishedException.java
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
src/main/java/com/project/bumawiki/domain/coin/exception/TradeNotFoundException.java
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
src/main/java/com/project/bumawiki/domain/coin/implementation/CoinAccountCreator.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,18 @@ | ||
package com.project.bumawiki.domain.coin.implementation; | ||
|
||
import com.project.bumawiki.domain.coin.domain.CoinAccount; | ||
import com.project.bumawiki.domain.coin.domain.repository.CoinAccountRepository; | ||
import com.project.bumawiki.global.annotation.Implementation; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
|
||
@Implementation | ||
@RequiredArgsConstructor | ||
public class CoinAccountCreator { | ||
|
||
private final CoinAccountRepository coinAccountRepository; | ||
|
||
public CoinAccount create(CoinAccount coinAccount) { | ||
return coinAccountRepository.save(coinAccount); | ||
} | ||
} |
Oops, something went wrong.