|
|
@@ -54,6 +54,26 @@ public class AuctionOrderController extends BaseController {
|
|
|
return auctionOrderService.create(userId, auctionId, addressId, auctionRecordId, type);
|
|
|
}
|
|
|
|
|
|
+ @PostMapping("/createFixPrice")
|
|
|
+ @ApiModelProperty(value = "创建拍卖订单(保证金)")
|
|
|
+ public AuctionOrder createFixPrice(Long userId, @RequestParam(required = false) Long auctionId,
|
|
|
+ Long addressId, AuctionPaymentType type) {
|
|
|
+ AuctionActivity auctionActivity = auctionActivityRepo.findById(auctionId)
|
|
|
+ .orElseThrow(new BusinessException("暂无"));
|
|
|
+ AuctionRecord auctionRecord = AuctionRecord.builder()
|
|
|
+ .auctionId(auctionId)
|
|
|
+ .type(AuctionRecordType.FIXEDPRICE)
|
|
|
+ .bidderPrice(auctionActivity.getFixedPrice())
|
|
|
+ .auctionPic(null)
|
|
|
+ .userId(SecurityUtils.getAuthenticatedUser().getId())
|
|
|
+ .avatar(SecurityUtils.getAuthenticatedUser().getAvatar())
|
|
|
+ .name(auctionActivity.getName())
|
|
|
+ .purchased(false)
|
|
|
+ .build();
|
|
|
+ AuctionRecord record = auctionRecordRepo.save(auctionRecord);
|
|
|
+ return auctionOrderService.create(userId, auctionId, addressId, record.getId(), type);
|
|
|
+ }
|
|
|
+
|
|
|
@PostMapping("/createDeposit")
|
|
|
@ApiModelProperty(value = "创建拍卖订单(保证金)")
|
|
|
public AuctionOrder createDeposit(Long userId, @RequestParam(required = false) Long auctionId,
|
|
|
@@ -64,7 +84,7 @@ public class AuctionOrderController extends BaseController {
|
|
|
.auctionId(auctionId)
|
|
|
.type(AuctionRecordType.DEPOSIT)
|
|
|
.bidderPrice(auctionActivity.getDeposit())
|
|
|
- .auctionPic(auctionActivity.getPic().get(0).toString())
|
|
|
+ .auctionPic(null)
|
|
|
.userId(SecurityUtils.getAuthenticatedUser().getId())
|
|
|
.avatar(SecurityUtils.getAuthenticatedUser().getAvatar())
|
|
|
.name(auctionActivity.getName())
|