From 9697aee898da044aac9fc5edba649efe902f47aa Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 21 Oct 2023 21:17:49 +0800 Subject: [PATCH] =?UTF-8?q?code=20review=EF=BC=9A=E9=92=B1=E5=8C=85?= =?UTF-8?q?=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../core/client/impl/alipay/AbstractAlipayPayClient.java | 6 ++---- yudao-module-pay/yudao-module-pay-biz/pom.xml | 2 +- .../yudao/module/pay/api/transfer/PayTransferApiImpl.java | 4 +++- .../pay/controller/admin/wallet/PayWalletController.java | 3 ++- .../controller/admin/wallet/vo/wallet/PayWalletRespVO.java | 5 ++--- .../admin/wallet/vo/wallet/PayWalletUserReqVO.java | 1 + .../module/pay/convert/transfer/PayTransferConvert.java | 5 +++-- .../yudao/module/pay/convert/wallet/PayWalletConvert.java | 1 + .../pay/dal/dataobject/transfer/PayTransferExtensionDO.java | 5 +++-- .../dal/mysql/wallet/PayWalletRechargePackageMapper.java | 4 +++- .../module/pay/service/transfer/PayTransferServiceImpl.java | 1 + .../service/wallet/PayWalletRechargePackageServiceImpl.java | 2 ++ 12 files changed, 24 insertions(+), 15 deletions(-) diff --git a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AbstractAlipayPayClient.java b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AbstractAlipayPayClient.java index 4adb571e9..cb8a0df6e 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AbstractAlipayPayClient.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-pay/src/main/java/cn/iocoder/yudao/framework/pay/core/client/impl/alipay/AbstractAlipayPayClient.java @@ -160,8 +160,7 @@ public abstract class AbstractAlipayPayClient extends AbstractPayClientyudao-module-pay-api ${revision} - cn.iocoder.boot yudao-module-member-api ${revision} + cn.iocoder.boot diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/api/transfer/PayTransferApiImpl.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/api/transfer/PayTransferApiImpl.java index 396b3eca0..786cf70f8 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/api/transfer/PayTransferApiImpl.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/api/transfer/PayTransferApiImpl.java @@ -15,6 +15,7 @@ import javax.annotation.Resource; @Service @Validated public class PayTransferApiImpl implements PayTransferApi { + @Resource private PayTransferService payTransferService; @@ -22,4 +23,5 @@ public class PayTransferApiImpl implements PayTransferApi { public Long createTransfer(PayTransferCreateReqDTO reqDTO) { return payTransferService.createTransfer(reqDTO); } -} \ No newline at end of file + +} diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/PayWalletController.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/PayWalletController.java index 1d70e5d9d..4eed8816f 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/PayWalletController.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/PayWalletController.java @@ -65,7 +65,8 @@ public class PayWalletController { MemberUserRespDTO::getId); pageVO.setUserIds(userIds); } - // 暂时支持查询 userType 会员类型。管理员类型还不知道使用场景 + // TODO @jason:管理员也可以先查询下。。 + // 暂时支持查询 userType 会员类型。管理员类型还不知道使用场景 PageResult pageResult = payWalletService.getWalletPage(MEMBER.getValue(),pageVO); if (CollectionUtil.isEmpty(pageResult.getList())) { return success(new PageResult<>(pageResult.getTotal())); diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/vo/wallet/PayWalletRespVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/vo/wallet/PayWalletRespVO.java index eafb52fc3..a9eedbdfd 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/vo/wallet/PayWalletRespVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/vo/wallet/PayWalletRespVO.java @@ -19,10 +19,9 @@ public class PayWalletRespVO extends PayWalletBaseVO { @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED) private LocalDateTime createTime; - @Schema(description = "用户昵称") + @Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王**") private String nickname; - - @Schema(description = "用户头像") + @Schema(description = "用户头像", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn/xxx.jpg") private String avatar; } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/vo/wallet/PayWalletUserReqVO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/vo/wallet/PayWalletUserReqVO.java index 72647f148..dfa335166 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/vo/wallet/PayWalletUserReqVO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/controller/admin/wallet/vo/wallet/PayWalletUserReqVO.java @@ -12,4 +12,5 @@ public class PayWalletUserReqVO { @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1") @NotNull(message = "用户编号不能为空") private Long userId; + } diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/convert/transfer/PayTransferConvert.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/convert/transfer/PayTransferConvert.java index 69512f81c..440f0103b 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/convert/transfer/PayTransferConvert.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/convert/transfer/PayTransferConvert.java @@ -10,8 +10,9 @@ import org.mapstruct.factory.Mappers; @Mapper public interface PayTransferConvert { - PayTransferConvert INSTANCE = Mappers.getMapper(PayTransferConvert.class); - @Mapping(source = "title", target = "subject") + PayTransferConvert INSTANCE = Mappers.getMapper(PayTransferConvert.class); + + @Mapping(source = "title", target = "subject") // TODO @jason:是不是都改成 subject 完事呀? PayTransferDO convert(PayTransferCreateReqDTO dto); PayTransferCreateReqDTO convert(PayDemoTransferCreateReqVO vo); diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/convert/wallet/PayWalletConvert.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/convert/wallet/PayWalletConvert.java index 31661e65e..e162b88bc 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/convert/wallet/PayWalletConvert.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/convert/wallet/PayWalletConvert.java @@ -26,6 +26,7 @@ public interface PayWalletConvert { PageResult pageResult = convertPage(page); pageResult.getList().forEach( wallet -> MapUtils.findAndThen(userMap, wallet.getUserId(), user -> { + // TODO @jason:可以链式调用哈; wallet.setNickname(user.getNickname()); wallet.setAvatar(user.getAvatar()); })); diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/transfer/PayTransferExtensionDO.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/transfer/PayTransferExtensionDO.java index 58e79dc84..c3d4253e8 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/transfer/PayTransferExtensionDO.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/dataobject/transfer/PayTransferExtensionDO.java @@ -11,7 +11,8 @@ import lombok.Data; import java.util.Map; // TODO @jason:转账是不是类似 refund,不用拓展单呀?支付做拓展单的原因,是因为它存在不确定性,可以切换多种;转账和退款,都是明确方式的; -// @芋艿 转账是不是也存在多种方式。 例如转账到银行卡。 可以使用微信,也可以使用支付宝。 支付宝账号余额不够,可以切换到微信 +// @芋艿 转账是不是也存在多种方式。 例如转账到银行卡。 可以使用微信,也可以使用支付宝。 支付宝账号余额不够,可以切换到微信; +// TODO @jason:发起了,就不允许调整了,类似退款哈; /** * 转账拓展单 DO * @@ -64,4 +65,4 @@ public class PayTransferExtensionDO extends BaseDO { */ private String channelNotifyData; -} \ No newline at end of file +} diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/wallet/PayWalletRechargePackageMapper.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/wallet/PayWalletRechargePackageMapper.java index f9c3aea65..b68b4c893 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/wallet/PayWalletRechargePackageMapper.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/wallet/PayWalletRechargePackageMapper.java @@ -19,7 +19,9 @@ public interface PayWalletRechargePackageMapper extends BaseMapperX