banner、商品、商品分类等代码的 REVIEW

This commit is contained in:
YunaiV
2020-05-15 18:45:47 +08:00
parent 16a39255f9
commit c34c501fb8
15 changed files with 22 additions and 19 deletions

View File

@@ -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;
}
}

View File

@@ -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, ",");
}
}

View File

@@ -12,6 +12,7 @@ import java.util.List;
*/
@Data
@Accessors(chain = true)
// TODO FROM 芋艿 to sunderui && q2118cs貌似重复了只要保留一个哈
public class ProductSpuAddDTO {
// ========== 基本信息 =========

View File

@@ -114,6 +114,7 @@ public class ProductCategoryServiceImpl implements ProductCategoryService {
throw ServiceExceptionUtil.exception(PRODUCT_CATEGORY_DELETE_ONLY_DISABLE);
}
// 只有不存在子分类才可以删除
// TODO FROM 芋艿 to jiangweifanWrappers 只用在 Mapper 层
Integer childCount = productCategoryMapper.selectCount(
Wrappers.<ProductCategoryDO>lambdaQuery().eq(ProductCategoryDO::getPid, productCategoryId)
);