From f1424aa61e1e8e854dba1fddcc0e362ac7277fad Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 25 Dec 2021 18:53:47 +0800 Subject: [PATCH] =?UTF-8?q?code=20review=20=E6=94=AF=E4=BB=98=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/pay/controller/app/PayAppController.java | 7 ++----- .../pay/controller/app/vo/PayAppPageItemRespVO.java | 1 + .../modules/pay/service/app/impl/PayAppServiceImpl.java | 6 +----- .../pay/service/channel/impl/PayChannelServiceImpl.java | 1 - yudao-admin-ui/src/views/pay/app/index.vue | 2 -- 5 files changed, 4 insertions(+), 13 deletions(-) diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/controller/app/PayAppController.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/controller/app/PayAppController.java index a517676de..e902eff35 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/controller/app/PayAppController.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/controller/app/PayAppController.java @@ -41,7 +41,7 @@ import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.E * 支付应用信息 controller 组件 * * @author aquan - */ + */ // TODO @aquan:一般 controller 上就不写注释了,因为有 swagger 注解,不然就重复啦 @Slf4j @Api(tags = "支付应用信息") @RestController @@ -51,11 +51,8 @@ public class PayAppController { @Resource private PayAppService appService; - @Resource private PayChannelService channelService; - - @Resource private PayMerchantService merchantService; @@ -135,6 +132,7 @@ public class PayAppController { // 写入商户的数据 respVO.setPayMerchant(PayAppConvert.INSTANCE.convert(deptMap.get(app.getMerchantId()))); // 写入支付渠道信息的数据 + // TODO @aquan:VO 里返回的 payChannel,是不是用一个 Set 集合就好了,里面是渠道的枚举值 PayAppPageItemRespVO.PayChannel payChannel = new PayAppPageItemRespVO.PayChannel(); channels.forEach(c -> { if (c.getAppId().equals(app.getId())) { @@ -177,5 +175,4 @@ public class PayAppController { return success(PayAppConvert.INSTANCE.convertList(appListDO)); } - } diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/controller/app/vo/PayAppPageItemRespVO.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/controller/app/vo/PayAppPageItemRespVO.java index 0261090e0..742ee62e3 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/controller/app/vo/PayAppPageItemRespVO.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/controller/app/vo/PayAppPageItemRespVO.java @@ -72,4 +72,5 @@ public class PayAppPageItemRespVO extends PayAppBaseVO { @ApiModelProperty(value = "支付宝扫码支付", required = true, example = "1") private Integer alipayQr = CommonStatusEnum.DISABLE.getStatus(); } + } diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/service/app/impl/PayAppServiceImpl.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/service/app/impl/PayAppServiceImpl.java index e631ae040..86d6a32f8 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/service/app/impl/PayAppServiceImpl.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/service/app/impl/PayAppServiceImpl.java @@ -36,10 +36,6 @@ public class PayAppServiceImpl implements PayAppService { @Resource private PayAppMapper appMapper; - - /** - * 商户 service 组件 - */ @Resource private PayMerchantMapper merchantMapper; @@ -151,7 +147,6 @@ public class PayAppServiceImpl implements PayAppService { */ @VisibleForTesting public void checkAppExists(Long id) { - if (id == null) { return; } @@ -160,4 +155,5 @@ public class PayAppServiceImpl implements PayAppService { throw exception(PAY_APP_NOT_FOUND); } } + } diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/service/channel/impl/PayChannelServiceImpl.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/service/channel/impl/PayChannelServiceImpl.java index c7b16f36c..df10b87bf 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/service/channel/impl/PayChannelServiceImpl.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/pay/service/channel/impl/PayChannelServiceImpl.java @@ -46,7 +46,6 @@ public class PayChannelServiceImpl implements PayChannelService { @Override public Long createChannel(PayChannelCreateReqVO reqVO) { - // 断言是否有重复的 PayChannelDO channelDO = this.getChannelByConditions(reqVO.getMerchantId(), reqVO.getAppId(), reqVO.getCode()); Assert.isNull(channelDO, CHANNEL_EXIST_SAME_CHANNEL_ERROR.getMsg()); diff --git a/yudao-admin-ui/src/views/pay/app/index.vue b/yudao-admin-ui/src/views/pay/app/index.vue index 03c6f043d..4e9530f0d 100644 --- a/yudao-admin-ui/src/views/pay/app/index.vue +++ b/yudao-admin-ui/src/views/pay/app/index.vue @@ -467,8 +467,6 @@ export default { this.settingChannelParam(row, payCode, type) this.channelParam.edit = false; this.channelParam.loading = false; - - }, /** * 设置支付渠道信息