📖 code review:店铺装修逻辑

This commit is contained in:
YunaiV 2023-12-19 23:11:09 +08:00
parent cd45fc35ea
commit 106c1ecf4c
6 changed files with 10 additions and 2 deletions

View File

@ -82,6 +82,7 @@ public class DiyTemplateController {
return success(DiyTemplateConvert.INSTANCE.convertPage(pageResult)); return success(DiyTemplateConvert.INSTANCE.convertPage(pageResult));
} }
// TODO @疯狂这个要不和 getDiyTemplate 合并然后 DiyTemplateRespVO 里面直接把 DiyPagePropertyRespVO 也加上减少 VO 好了管理后台 get 多返回点数据也问题不大的目的还是想尽可能降低大家的理解成本哈
@GetMapping("/get-property") @GetMapping("/get-property")
@Operation(summary = "获得装修模板属性") @Operation(summary = "获得装修模板属性")
@Parameter(name = "id", description = "编号", required = true, example = "1024") @Parameter(name = "id", description = "编号", required = true, example = "1024")
@ -92,6 +93,7 @@ public class DiyTemplateController {
return success(DiyTemplateConvert.INSTANCE.convertPropertyVo(diyTemplate, pages)); return success(DiyTemplateConvert.INSTANCE.convertPropertyVo(diyTemplate, pages));
} }
// TODO @疯狂这个接口要不和 useDiyTemplate 合并成一个然后 VO 改成我们新的 VO 规范不改的字段就不传递
@PutMapping("/update-property") @PutMapping("/update-property")
@Operation(summary = "更新装修模板属性") @Operation(summary = "更新装修模板属性")
@PreAuthorize("@ss.hasPermission('promotion:diy-template:update')") @PreAuthorize("@ss.hasPermission('promotion:diy-template:update')")

View File

@ -25,6 +25,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@RestController @RestController
@RequestMapping("/promotion/decorate") @RequestMapping("/promotion/decorate")
@Validated @Validated
@Deprecated // 废弃
public class AppDecorateController { public class AppDecorateController {
@Resource @Resource

View File

@ -33,6 +33,7 @@ public class AppDiyTemplateController {
@Resource @Resource
private DiyPageService diyPageService; private DiyPageService diyPageService;
// TODO @疯狂要不要把 used get 接口合并哈不传递 id直接拿默认
@GetMapping("/used") @GetMapping("/used")
@Operation(summary = "使用中的装修模板") @Operation(summary = "使用中的装修模板")
public CommonResult<AppDiyTemplatePropertyRespVO> getUsedDiyTemplate() { public CommonResult<AppDiyTemplatePropertyRespVO> getUsedDiyTemplate() {
@ -54,6 +55,7 @@ public class AppDiyTemplateController {
} }
// 查询模板下的页面 // 查询模板下的页面
List<DiyPageDO> pages = diyPageService.getDiyPageByTemplateId(diyTemplate.getId()); List<DiyPageDO> pages = diyPageService.getDiyPageByTemplateId(diyTemplate.getId());
// TODO @疯狂首页我的要不枚举到 DiyPageDO 例如说 NAME_USERNAME_HOME 类似这种哈
String home = findFirst(pages, page -> "首页".equals(page.getName()), DiyPageDO::getProperty); String home = findFirst(pages, page -> "首页".equals(page.getName()), DiyPageDO::getProperty);
String user = findFirst(pages, page -> "我的".equals(page.getName()), DiyPageDO::getProperty); String user = findFirst(pages, page -> "我的".equals(page.getName()), DiyPageDO::getProperty);
// 拼接返回 // 拼接返回

View File

@ -44,6 +44,7 @@ public class DiyPageDO extends BaseDO {
* 备注 * 备注
*/ */
private String remark; private String remark;
// TODO @疯狂这个字段要不改成 previewPicUrls和别的模块一样用 pic 作为图片哇
/** /**
* 预览图多个逗号分隔 * 预览图多个逗号分隔
*/ */

View File

@ -50,13 +50,14 @@ public class DiyTemplateDO extends BaseDO {
* 备注 * 备注
*/ */
private String remark; private String remark;
// TODO @疯狂这个字段要不改成 previewPicUrls和别的模块一样用 pic 作为图片哇
/** /**
* 预览图 * 预览图
*/ */
@TableField(typeHandler = StringListTypeHandler.class) @TableField(typeHandler = StringListTypeHandler.class)
private List<String> previewImageUrls; private List<String> previewImageUrls;
/** /**
* 底部导航属性JSON 格式 * uni-app 底部导航属性JSON 格式
*/ */
private String property; private String property;

View File

@ -24,7 +24,8 @@ public interface PayWalletRechargeMapper extends BaseMapperX<PayWalletRechargeDO
default PageResult<PayWalletRechargeDO> selectPage(PageParam pageReqVO, Long walletId, Boolean payStatus) { default PageResult<PayWalletRechargeDO> selectPage(PageParam pageReqVO, Long walletId, Boolean payStatus) {
return selectPage(pageReqVO, new LambdaQueryWrapperX<PayWalletRechargeDO>() return selectPage(pageReqVO, new LambdaQueryWrapperX<PayWalletRechargeDO>()
.eq(PayWalletRechargeDO::getWalletId, walletId) .eq(PayWalletRechargeDO::getWalletId, walletId)
.eq(PayWalletRechargeDO::getPayStatus, payStatus)); .eq(PayWalletRechargeDO::getPayStatus, payStatus)
.orderByDesc(PayWalletRechargeDO::getId));
} }
} }