Commit 106c1ecf4c08c9f8b2e52d3e2f60408586a55be2
1 parent
cd45fc35
📖 code review:店铺装修逻辑
Showing
6 changed files
with
10 additions
and
2 deletions
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 { | @@ -82,6 +82,7 @@ public class DiyTemplateController { | ||
| 82 | return success(DiyTemplateConvert.INSTANCE.convertPage(pageResult)); | 82 | return success(DiyTemplateConvert.INSTANCE.convertPage(pageResult)); |
| 83 | } | 83 | } |
| 84 | 84 | ||
| 85 | + // TODO @疯狂:这个要不和 getDiyTemplate 合并,然后 DiyTemplateRespVO 里面直接把 DiyPagePropertyRespVO 也加上。减少 VO 好了,管理后台 get 多返回点数据,也问题不大的。目的,还是想尽可能降低大家的理解成本哈; | ||
| 85 | @GetMapping("/get-property") | 86 | @GetMapping("/get-property") |
| 86 | @Operation(summary = "获得装修模板属性") | 87 | @Operation(summary = "获得装修模板属性") |
| 87 | @Parameter(name = "id", description = "编号", required = true, example = "1024") | 88 | @Parameter(name = "id", description = "编号", required = true, example = "1024") |
| @@ -92,6 +93,7 @@ public class DiyTemplateController { | @@ -92,6 +93,7 @@ public class DiyTemplateController { | ||
| 92 | return success(DiyTemplateConvert.INSTANCE.convertPropertyVo(diyTemplate, pages)); | 93 | return success(DiyTemplateConvert.INSTANCE.convertPropertyVo(diyTemplate, pages)); |
| 93 | } | 94 | } |
| 94 | 95 | ||
| 96 | + // TODO @疯狂:这个接口,要不和 useDiyTemplate 合并成一个,然后 VO 改成我们新的 VO 规范。不改的字段,就不传递。 | ||
| 95 | @PutMapping("/update-property") | 97 | @PutMapping("/update-property") |
| 96 | @Operation(summary = "更新装修模板属性") | 98 | @Operation(summary = "更新装修模板属性") |
| 97 | @PreAuthorize("@ss.hasPermission('promotion:diy-template:update')") | 99 | @PreAuthorize("@ss.hasPermission('promotion:diy-template:update')") |
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; | @@ -25,6 +25,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | ||
| 25 | @RestController | 25 | @RestController |
| 26 | @RequestMapping("/promotion/decorate") | 26 | @RequestMapping("/promotion/decorate") |
| 27 | @Validated | 27 | @Validated |
| 28 | +@Deprecated // 废弃 | ||
| 28 | public class AppDecorateController { | 29 | public class AppDecorateController { |
| 29 | 30 | ||
| 30 | @Resource | 31 | @Resource |
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 { | @@ -33,6 +33,7 @@ public class AppDiyTemplateController { | ||
| 33 | @Resource | 33 | @Resource |
| 34 | private DiyPageService diyPageService; | 34 | private DiyPageService diyPageService; |
| 35 | 35 | ||
| 36 | + // TODO @疯狂:要不要把 used 和 get 接口合并哈;不传递 id,直接拿默认; | ||
| 36 | @GetMapping("/used") | 37 | @GetMapping("/used") |
| 37 | @Operation(summary = "使用中的装修模板") | 38 | @Operation(summary = "使用中的装修模板") |
| 38 | public CommonResult<AppDiyTemplatePropertyRespVO> getUsedDiyTemplate() { | 39 | public CommonResult<AppDiyTemplatePropertyRespVO> getUsedDiyTemplate() { |
| @@ -54,6 +55,7 @@ public class AppDiyTemplateController { | @@ -54,6 +55,7 @@ public class AppDiyTemplateController { | ||
| 54 | } | 55 | } |
| 55 | // 查询模板下的页面 | 56 | // 查询模板下的页面 |
| 56 | List<DiyPageDO> pages = diyPageService.getDiyPageByTemplateId(diyTemplate.getId()); | 57 | List<DiyPageDO> pages = diyPageService.getDiyPageByTemplateId(diyTemplate.getId()); |
| 58 | + // TODO @疯狂:首页、我的,要不枚举到 DiyPageDO 例如说 NAME_USER,NAME_HOME 类似这种哈; | ||
| 57 | String home = findFirst(pages, page -> "首页".equals(page.getName()), DiyPageDO::getProperty); | 59 | String home = findFirst(pages, page -> "首页".equals(page.getName()), DiyPageDO::getProperty); |
| 58 | String user = findFirst(pages, page -> "我的".equals(page.getName()), DiyPageDO::getProperty); | 60 | String user = findFirst(pages, page -> "我的".equals(page.getName()), DiyPageDO::getProperty); |
| 59 | // 拼接返回 | 61 | // 拼接返回 |
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 { | @@ -44,6 +44,7 @@ public class DiyPageDO extends BaseDO { | ||
| 44 | * 备注 | 44 | * 备注 |
| 45 | */ | 45 | */ |
| 46 | private String remark; | 46 | private String remark; |
| 47 | + // TODO @疯狂:这个字段要不改成 previewPicUrls,和别的模块一样用 pic 作为图片哇? | ||
| 47 | /** | 48 | /** |
| 48 | * 预览图,多个逗号分隔 | 49 | * 预览图,多个逗号分隔 |
| 49 | */ | 50 | */ |
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 { | @@ -50,13 +50,14 @@ public class DiyTemplateDO extends BaseDO { | ||
| 50 | * 备注 | 50 | * 备注 |
| 51 | */ | 51 | */ |
| 52 | private String remark; | 52 | private String remark; |
| 53 | + // TODO @疯狂:这个字段要不改成 previewPicUrls,和别的模块一样用 pic 作为图片哇? | ||
| 53 | /** | 54 | /** |
| 54 | * 预览图 | 55 | * 预览图 |
| 55 | */ | 56 | */ |
| 56 | @TableField(typeHandler = StringListTypeHandler.class) | 57 | @TableField(typeHandler = StringListTypeHandler.class) |
| 57 | private List<String> previewImageUrls; | 58 | private List<String> previewImageUrls; |
| 58 | /** | 59 | /** |
| 59 | - * 底部导航属性,JSON 格式 | 60 | + * uni-app 底部导航属性,JSON 格式 |
| 60 | */ | 61 | */ |
| 61 | private String property; | 62 | private String property; |
| 62 | 63 |
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<PayWalletRechargeDO | @@ -24,7 +24,8 @@ public interface PayWalletRechargeMapper extends BaseMapperX<PayWalletRechargeDO | ||
| 24 | default PageResult<PayWalletRechargeDO> selectPage(PageParam pageReqVO, Long walletId, Boolean payStatus) { | 24 | default PageResult<PayWalletRechargeDO> selectPage(PageParam pageReqVO, Long walletId, Boolean payStatus) { |
| 25 | return selectPage(pageReqVO, new LambdaQueryWrapperX<PayWalletRechargeDO>() | 25 | return selectPage(pageReqVO, new LambdaQueryWrapperX<PayWalletRechargeDO>() |
| 26 | .eq(PayWalletRechargeDO::getWalletId, walletId) | 26 | .eq(PayWalletRechargeDO::getWalletId, walletId) |
| 27 | - .eq(PayWalletRechargeDO::getPayStatus, payStatus)); | 27 | + .eq(PayWalletRechargeDO::getPayStatus, payStatus) |
| 28 | + .orderByDesc(PayWalletRechargeDO::getId)); | ||
| 28 | } | 29 | } |
| 29 | 30 | ||
| 30 | } | 31 | } |
| 31 | \ No newline at end of file | 32 | \ No newline at end of file |