uniapp:code review 商品分类、商品品牌

pull/2/head
YunaiV 2022-05-05 00:52:25 +08:00
parent a233ab1395
commit e6893db1c3
4 changed files with 12 additions and 2 deletions

View File

@ -68,6 +68,7 @@ public class BrandController {
return success(BrandConvert.INSTANCE.convert(brand));
}
// TODO @JeromeSoar这个接口是不是没用哈
@GetMapping("/list")
@ApiOperation("获得品牌列表")
@ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class)

View File

@ -68,6 +68,7 @@ public class CategoryController {
return success(CategoryConvert.INSTANCE.convert(category));
}
// TODO @JeromeSoar这个接口是不是没用哈
@GetMapping("/listByIds")
@ApiOperation("获得商品分类列表")
@PreAuthorize("@ss.hasPermission('product:category:query')")
@ -76,6 +77,7 @@ public class CategoryController {
return success(CategoryConvert.INSTANCE.convertList(list));
}
// TODO @JeromeSoar这应该是个 app 的接口,提供商品分类的树结构。这个调整下,后端只返回列表,前端构建 tree。注意不需要返回创建时间、是否开启等无关字段。
@GetMapping("/listByQuery")
@ApiOperation("获得商品分类列表")
@PreAuthorize("@ss.hasPermission('product:category:query')")

View File

@ -28,6 +28,7 @@ public class CategoryDO extends BaseDO {
/**
*
*/
// TODO @JeromeSoar改成 parentId 字段
private Long pid;
/**
*
@ -38,7 +39,9 @@ public class CategoryDO extends BaseDO {
*/
private String icon;
/**
*
* Banner
*
* App
*/
private String bannerUrl;
/**
@ -51,7 +54,7 @@ public class CategoryDO extends BaseDO {
private String description;
/**
*
* <p>
*
* {@link CommonStatusEnum}
*/
private Integer status;

View File

@ -29,6 +29,7 @@ public class CategoryServiceImpl implements CategoryService {
@Override
public Long createCategory(CategoryCreateReqVO createReqVO) {
// TODO JeromeSoar校验父分类
// 插入
CategoryDO category = CategoryConvert.INSTANCE.convert(createReqVO);
categoryMapper.insert(category);
@ -38,6 +39,7 @@ public class CategoryServiceImpl implements CategoryService {
@Override
public void updateCategory(CategoryUpdateReqVO updateReqVO) {
// TODO JeromeSoar校验父分类
// 校验存在
this.validateCategoryExists(updateReqVO.getId());
// 更新
@ -47,6 +49,8 @@ public class CategoryServiceImpl implements CategoryService {
@Override
public void deleteCategory(Long id) {
// TODO JeromeSoar校验删除的商品分类是否存在
// TODO 芋艿 补充只有不存在商品才可以删除
// 校验存在
this.validateCategoryExists(id);
// 删除