banner、商品、商品分类等代码的 REVIEW
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package cn.iocoder.mall.product.biz.enums.category;
|
||||
|
||||
// TODO FROM 芋艿 to sunderui:改到枚举类,我之前没弄对,哈哈哈
|
||||
public interface ProductCategoryConstants {
|
||||
|
||||
/**
|
||||
@@ -16,4 +17,4 @@ public interface ProductCategoryConstants {
|
||||
*/
|
||||
Integer PID_ROOT = 0;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,15 +40,9 @@ public interface ProductSpuConvert {
|
||||
})
|
||||
ProductSpuBO convert(ProductSpuDO spu);
|
||||
|
||||
@Named("translatePicUrlsFromString")
|
||||
default List<String> translatePicUrlsFromString(String picUrls) {
|
||||
return StringUtil.split(picUrls, ",");
|
||||
}
|
||||
|
||||
@Mappings({})
|
||||
List<ProductSpuBO> convert(List<ProductSpuDO> spus);
|
||||
|
||||
|
||||
@Mappings({
|
||||
@Mapping(source = "picUrls", target = "picUrls", ignore = true)
|
||||
})
|
||||
@@ -131,4 +125,9 @@ public interface ProductSpuConvert {
|
||||
return spuDetailList;
|
||||
}
|
||||
|
||||
@Named("translatePicUrlsFromString")
|
||||
default List<String> translatePicUrlsFromString(String picUrls) {
|
||||
return StringUtil.split(picUrls, ",");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import java.util.List;
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
// TODO FROM 芋艿 to sunderui && q2118cs:貌似重复了,只要保留一个哈
|
||||
public class ProductSpuAddDTO {
|
||||
|
||||
// ========== 基本信息 =========
|
||||
|
||||
@@ -114,6 +114,7 @@ public class ProductCategoryServiceImpl implements ProductCategoryService {
|
||||
throw ServiceExceptionUtil.exception(PRODUCT_CATEGORY_DELETE_ONLY_DISABLE);
|
||||
}
|
||||
// 只有不存在子分类才可以删除
|
||||
// TODO FROM 芋艿 to jiangweifan:Wrappers 只用在 Mapper 层
|
||||
Integer childCount = productCategoryMapper.selectCount(
|
||||
Wrappers.<ProductCategoryDO>lambdaQuery().eq(ProductCategoryDO::getPid, productCategoryId)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user