-
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 #225 from SKY-HORSE-MAN-POWER/develop
[DEPLOYMENT] 경매 마감 후, 낙찰됐는지 여부를 알려주는 API 구현
- Loading branch information
Showing
7 changed files
with
127 additions
and
1 deletion.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
src/main/java/com/skyhorsemanpower/auction/application/AuctionService.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 |
---|---|---|
@@ -1,11 +1,14 @@ | ||
package com.skyhorsemanpower.auction.application; | ||
|
||
import com.skyhorsemanpower.auction.data.dto.*; | ||
import com.skyhorsemanpower.auction.data.vo.AuctionResultResponseVo; | ||
|
||
public interface AuctionService { | ||
void offerBiddingPrice(OfferBiddingPriceDto offerBiddingPriceDto); | ||
|
||
void auctionClose(String auctionUuid); | ||
|
||
void auctionStateChangeTrue(String auctionUuid); | ||
|
||
AuctionResultResponseVo auctionResult(String uuid, String auctionUuid); | ||
} |
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
27 changes: 27 additions & 0 deletions
27
src/main/java/com/skyhorsemanpower/auction/data/vo/AuctionResultResponseVo.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,27 @@ | ||
package com.skyhorsemanpower.auction.data.vo; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.math.BigDecimal; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
public class AuctionResultResponseVo { | ||
private boolean isBidder; | ||
private BigDecimal price; | ||
|
||
@Builder | ||
public AuctionResultResponseVo(boolean isBidder, BigDecimal price) { | ||
this.isBidder = isBidder; | ||
this.price = price; | ||
} | ||
|
||
public static AuctionResultResponseVo notBidder() { | ||
return AuctionResultResponseVo.builder() | ||
.isBidder(false) | ||
.price(BigDecimal.ZERO) | ||
.build(); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/main/java/com/skyhorsemanpower/auction/domain/AuctionResult.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,31 @@ | ||
package com.skyhorsemanpower.auction.domain; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.ToString; | ||
import org.springframework.data.annotation.Id; | ||
import org.springframework.data.mongodb.core.mapping.Document; | ||
|
||
import java.math.BigDecimal; | ||
import java.util.List; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
@ToString | ||
@Document(collection = "auction_result") | ||
public class AuctionResult { | ||
@Id | ||
private String auctionResultId; | ||
|
||
private String auctionUuid; | ||
private List<String> memberUuids; | ||
private BigDecimal price; | ||
|
||
@Builder | ||
public AuctionResult(String auctionUuid, List<String> memberUuids, BigDecimal price) { | ||
this.auctionUuid = auctionUuid; | ||
this.memberUuids = memberUuids; | ||
this.price = price; | ||
} | ||
} |
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
12 changes: 12 additions & 0 deletions
12
src/main/java/com/skyhorsemanpower/auction/repository/AuctionResultRepository.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,12 @@ | ||
package com.skyhorsemanpower.auction.repository; | ||
|
||
import com.skyhorsemanpower.auction.domain.AuctionResult; | ||
import org.springframework.data.mongodb.repository.MongoRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
import java.util.Optional; | ||
|
||
@Repository | ||
public interface AuctionResultRepository extends MongoRepository<AuctionResult, String> { | ||
Optional<AuctionResult> findByAuctionUuidAndMemberUuidsContains(String auctionUuid, String memberUuid); | ||
} |