📖 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));
}
// 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')")

View File

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

View File

@ -33,6 +33,7 @@ public class AppDiyTemplateController {
@Resource
private DiyPageService diyPageService;
// TODO @疯狂:要不要把 used 和 get 接口合并哈;不传递 id直接拿默认
@GetMapping("/used")
@Operation(summary = "使用中的装修模板")
public CommonResult<AppDiyTemplatePropertyRespVO> getUsedDiyTemplate() {
@ -54,6 +55,7 @@ public class AppDiyTemplateController {
}
// 查询模板下的页面
List<DiyPageDO> pages = diyPageService.getDiyPageByTemplateId(diyTemplate.getId());
// TODO @疯狂:首页、我的,要不枚举到 DiyPageDO 例如说 NAME_USERNAME_HOME 类似这种哈;
String home = 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;
// TODO @疯狂:这个字段要不改成 previewPicUrls和别的模块一样用 pic 作为图片哇?
/**
* 预览图,多个逗号分隔
*/

View File

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