From 8720856b52c908354321d074959bd8b9edbc38b1 Mon Sep 17 00:00:00 2001 From: 陶杰 <1378534974@qq.com> Date: 星期二, 22 十月 2024 17:35:33 +0800 Subject: [PATCH] 1.查询时候如果钱包不存在则创建 --- src/main/java/com/mzl/flower/web/v2/wallet/WalletWithdrawRecordController.java | 30 +++++++++++++++++++++++++++++- 1 files changed, 29 insertions(+), 1 deletions(-) diff --git a/src/main/java/com/mzl/flower/web/v2/wallet/WalletWithdrawRecordController.java b/src/main/java/com/mzl/flower/web/v2/wallet/WalletWithdrawRecordController.java index 74e0ce4..a4ec014 100644 --- a/src/main/java/com/mzl/flower/web/v2/wallet/WalletWithdrawRecordController.java +++ b/src/main/java/com/mzl/flower/web/v2/wallet/WalletWithdrawRecordController.java @@ -5,7 +5,18 @@ import com.mzl.flower.base.BaseController; import com.mzl.flower.base.R; import com.mzl.flower.base.ReturnDataDTO; +import com.mzl.flower.config.exception.ValidationException; +import com.mzl.flower.config.security.SecurityUtils; +import com.mzl.flower.dto.request.wallet.CreateWalletWithdrawRecordDTO; +import com.mzl.flower.dto.response.supplier.SupplierDTO; +import com.mzl.flower.entity.wallet.WalletDO; +import com.mzl.flower.service.supplier.SupplierService; +import com.mzl.flower.service.wallet.WalletBillRecordService; +import com.mzl.flower.service.wallet.WalletService; +import com.mzl.flower.service.wallet.WalletWithdrawRecordService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.DeleteMapping; @@ -28,8 +39,25 @@ @RequestMapping("/v2/withdraw-record") public class WalletWithdrawRecordController extends BaseController { + @Autowired + private WalletWithdrawRecordService walletWithdrawRecordService; + + @Autowired + private WalletBillRecordService walletBillRecordService; + + @Autowired + private SupplierService supplierService; + @Autowired + private WalletService walletService; + + + + @PostMapping("") - public ResponseEntity<ReturnDataDTO> create() { + public ResponseEntity<ReturnDataDTO> create(@Validated CreateWalletWithdrawRecordDTO walletWithdrawRecordDTO) { + + walletWithdrawRecordService.create(walletWithdrawRecordDTO); + return returnData(R.SUCCESS.getCode(), null); } -- Gitblit v1.9.3