From 106c1ecf4c08c9f8b2e52d3e2f60408586a55be2 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Tue, 19 Dec 2023 23:11:09 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=96=20code=20review=EF=BC=9A=E5=BA=97?= =?UTF-8?q?=E9=93=BA=E8=A3=85=E4=BF=AE=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../promotion/controller/admin/diy/DiyTemplateController.java | 2 ++ .../controller/app/decorate/AppDecorateController.java | 1 + .../promotion/controller/app/diy/AppDiyTemplateController.java | 2 ++ .../yudao/module/promotion/dal/dataobject/diy/DiyPageDO.java | 1 + .../module/promotion/dal/dataobject/diy/DiyTemplateDO.java | 3 ++- .../module/pay/dal/mysql/wallet/PayWalletRechargeMapper.java | 3 ++- 6 files changed, 10 insertions(+), 2 deletions(-) diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/diy/DiyTemplateController.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/diy/DiyTemplateController.java index f8aa3b180..7a3c85b9e 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/diy/DiyTemplateController.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/admin/diy/DiyTemplateController.java @@ -82,6 +82,7 @@ public class DiyTemplateController { return success(DiyTemplateConvert.INSTANCE.convertPage(pageResult)); } + // TODO @疯狂:这个要不和 getDiyTemplate 合并,然后 DiyTemplateRespVO 里面直接把 DiyPagePropertyRespVO 也加上。减少 VO 好了,管理后台 get 多返回点数据,也问题不大的。目的,还是想尽可能降低大家的理解成本哈; @GetMapping("/get-property") @Operation(summary = "获得装修模板属性") @Parameter(name = "id", description = "编号", required = true, example = "1024") @@ -92,6 +93,7 @@ public class DiyTemplateController { return success(DiyTemplateConvert.INSTANCE.convertPropertyVo(diyTemplate, pages)); } + // TODO @疯狂:这个接口,要不和 useDiyTemplate 合并成一个,然后 VO 改成我们新的 VO 规范。不改的字段,就不传递。 @PutMapping("/update-property") @Operation(summary = "更新装修模板属性") @PreAuthorize("@ss.hasPermission('promotion:diy-template:update')") diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/decorate/AppDecorateController.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/decorate/AppDecorateController.java index 36ae25b55..6f5b1ec68 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/decorate/AppDecorateController.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/decorate/AppDecorateController.java @@ -25,6 +25,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; @RestController @RequestMapping("/promotion/decorate") @Validated +@Deprecated // 废弃 public class AppDecorateController { @Resource diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/diy/AppDiyTemplateController.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/diy/AppDiyTemplateController.java index fa1ea2d5b..90ecbcac4 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/diy/AppDiyTemplateController.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/controller/app/diy/AppDiyTemplateController.java @@ -33,6 +33,7 @@ public class AppDiyTemplateController { @Resource private DiyPageService diyPageService; + // TODO @疯狂:要不要把 used 和 get 接口合并哈;不传递 id,直接拿默认; @GetMapping("/used") @Operation(summary = "使用中的装修模板") public CommonResult getUsedDiyTemplate() { @@ -54,6 +55,7 @@ public class AppDiyTemplateController { } // 查询模板下的页面 List pages = diyPageService.getDiyPageByTemplateId(diyTemplate.getId()); + // TODO @疯狂:首页、我的,要不枚举到 DiyPageDO 例如说 NAME_USER,NAME_HOME 类似这种哈; String home = findFirst(pages, page -> "首页".equals(page.getName()), DiyPageDO::getProperty); String user = findFirst(pages, page -> "我的".equals(page.getName()), DiyPageDO::getProperty); // 拼接返回 diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/diy/DiyPageDO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/diy/DiyPageDO.java index 7e1044104..4a9324dfc 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/diy/DiyPageDO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/diy/DiyPageDO.java @@ -44,6 +44,7 @@ public class DiyPageDO extends BaseDO { * 备注 */ private String remark; + // TODO @疯狂:这个字段要不改成 previewPicUrls,和别的模块一样用 pic 作为图片哇? /** * 预览图,多个逗号分隔 */ diff --git a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/diy/DiyTemplateDO.java b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/diy/DiyTemplateDO.java index 684a6f9cb..daf1f786d 100644 --- a/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/diy/DiyTemplateDO.java +++ b/yudao-module-mall/yudao-module-promotion-biz/src/main/java/cn/iocoder/yudao/module/promotion/dal/dataobject/diy/DiyTemplateDO.java @@ -50,13 +50,14 @@ public class DiyTemplateDO extends BaseDO { * 备注 */ private String remark; + // TODO @疯狂:这个字段要不改成 previewPicUrls,和别的模块一样用 pic 作为图片哇? /** * 预览图 */ @TableField(typeHandler = StringListTypeHandler.class) private List previewImageUrls; /** - * 底部导航属性,JSON 格式 + * uni-app 底部导航属性,JSON 格式 */ private String property; diff --git a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/wallet/PayWalletRechargeMapper.java b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/wallet/PayWalletRechargeMapper.java index e10d23d74..f82b88582 100644 --- a/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/wallet/PayWalletRechargeMapper.java +++ b/yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/dal/mysql/wallet/PayWalletRechargeMapper.java @@ -24,7 +24,8 @@ public interface PayWalletRechargeMapper extends BaseMapperX selectPage(PageParam pageReqVO, Long walletId, Boolean payStatus) { return selectPage(pageReqVO, new LambdaQueryWrapperX() .eq(PayWalletRechargeDO::getWalletId, walletId) - .eq(PayWalletRechargeDO::getPayStatus, payStatus)); + .eq(PayWalletRechargeDO::getPayStatus, payStatus) + .orderByDesc(PayWalletRechargeDO::getId)); } } \ No newline at end of file