Commit f1424aa61e1e8e854dba1fddcc0e362ac7277fad

Authored by YunaiV
1 parent 4b5c1856

code review 支付应用的逻辑

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
41 41 * 支付应用信息 controller 组件
42 42 *
43 43 * @author aquan
44   - */
  44 + */ // TODO @aquan:一般 controller 上就不写注释了,因为有 swagger 注解,不然就重复啦
45 45 @Slf4j
46 46 @Api(tags = "支付应用信息")
47 47 @RestController
... ... @@ -51,11 +51,8 @@ public class PayAppController {
51 51  
52 52 @Resource
53 53 private PayAppService appService;
54   -
55 54 @Resource
56 55 private PayChannelService channelService;
57   -
58   -
59 56 @Resource
60 57 private PayMerchantService merchantService;
61 58  
... ... @@ -135,6 +132,7 @@ public class PayAppController {
135 132 // 写入商户的数据
136 133 respVO.setPayMerchant(PayAppConvert.INSTANCE.convert(deptMap.get(app.getMerchantId())));
137 134 // 写入支付渠道信息的数据
  135 + // TODO @aquan:VO 里返回的 payChannel,是不是用一个 Set 集合就好了,里面是渠道的枚举值
138 136 PayAppPageItemRespVO.PayChannel payChannel = new PayAppPageItemRespVO.PayChannel();
139 137 channels.forEach(c -> {
140 138 if (c.getAppId().equals(app.getId())) {
... ... @@ -177,5 +175,4 @@ public class PayAppController {
177 175 return success(PayAppConvert.INSTANCE.convertList(appListDO));
178 176 }
179 177  
180   -
181 178 }
... ...
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 {
72 72 @ApiModelProperty(value = "支付宝扫码支付", required = true, example = "1")
73 73 private Integer alipayQr = CommonStatusEnum.DISABLE.getStatus();
74 74 }
  75 +
75 76 }
... ...
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 {
36 36  
37 37 @Resource
38 38 private PayAppMapper appMapper;
39   -
40   - /**
41   - * 商户 service 组件
42   - */
43 39 @Resource
44 40 private PayMerchantMapper merchantMapper;
45 41  
... ... @@ -151,7 +147,6 @@ public class PayAppServiceImpl implements PayAppService {
151 147 */
152 148 @VisibleForTesting
153 149 public void checkAppExists(Long id) {
154   -
155 150 if (id == null) {
156 151 return;
157 152 }
... ... @@ -160,4 +155,5 @@ public class PayAppServiceImpl implements PayAppService {
160 155 throw exception(PAY_APP_NOT_FOUND);
161 156 }
162 157 }
  158 +
163 159 }
... ...
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 {
46 46  
47 47 @Override
48 48 public Long createChannel(PayChannelCreateReqVO reqVO) {
49   -
50 49 // 断言是否有重复的
51 50 PayChannelDO channelDO = this.getChannelByConditions(reqVO.getMerchantId(), reqVO.getAppId(), reqVO.getCode());
52 51 Assert.isNull(channelDO, CHANNEL_EXIST_SAME_CHANNEL_ERROR.getMsg());
... ...
yudao-admin-ui/src/views/pay/app/index.vue
... ... @@ -467,8 +467,6 @@ export default {
467 467 this.settingChannelParam(row, payCode, type)
468 468 this.channelParam.edit = false;
469 469 this.channelParam.loading = false;
470   -
471   -
472 470 },
473 471 /**
474 472 * 设置支付渠道信息
... ...