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; package cn.iocoder.mall.product.biz.enums.category;
// TODO FROM 芋艿 to sunderui改到枚举类我之前没弄对哈哈哈
public interface ProductCategoryConstants { public interface ProductCategoryConstants {
/** /**

View File

@ -40,15 +40,9 @@ public interface ProductSpuConvert {
}) })
ProductSpuBO convert(ProductSpuDO spu); ProductSpuBO convert(ProductSpuDO spu);
@Named("translatePicUrlsFromString")
default List<String> translatePicUrlsFromString(String picUrls) {
return StringUtil.split(picUrls, ",");
}
@Mappings({}) @Mappings({})
List<ProductSpuBO> convert(List<ProductSpuDO> spus); List<ProductSpuBO> convert(List<ProductSpuDO> spus);
@Mappings({ @Mappings({
@Mapping(source = "picUrls", target = "picUrls", ignore = true) @Mapping(source = "picUrls", target = "picUrls", ignore = true)
}) })
@ -131,4 +125,9 @@ public interface ProductSpuConvert {
return spuDetailList; 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 @Data
@Accessors(chain = true) @Accessors(chain = true)
// TODO FROM 芋艿 to sunderui && q2118cs貌似重复了只要保留一个哈
public class ProductSpuAddDTO { public class ProductSpuAddDTO {
// ========== 基本信息 ========= // ========== 基本信息 =========

View File

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

View File

@ -15,6 +15,7 @@ import java.util.Date;
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
// TODO FROM 芋艿 to 小范捉摸是不是先统一的 BannerBO另外biz 不使用 swagger 注解哈其他 banner dto bo 也一起改改哈
public class BannerListBO implements Serializable { public class BannerListBO implements Serializable {

View File

@ -26,6 +26,7 @@ public interface BannerMapper extends BaseMapper<BannerDO> {
* @param dto * @param dto
* @return * @return
*/ */
// TODO FROM 芋艿 to 小范Page 方法哈
default IPage<BannerDO> selectBannerList(BannerListDTO dto) { default IPage<BannerDO> selectBannerList(BannerListDTO dto) {
LambdaQueryWrapper<BannerDO> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<BannerDO> queryWrapper = new LambdaQueryWrapper<>();
if (StringUtils.isEmpty(dto.getStatus())) { if (StringUtils.isEmpty(dto.getStatus())) {

View File

@ -48,6 +48,7 @@ public interface BannerService {
*/ */
void updateBanner(BannerUpdateDTO adminsBannerUpdateDTO); void updateBanner(BannerUpdateDTO adminsBannerUpdateDTO);
// TODO FROM 芋艿 to 小范貌似要把 dto 搞起来嘿嘿
/** /**
* 更新 - banner 状态 * 更新 - banner 状态
* *

View File

@ -17,7 +17,7 @@ import java.io.Serializable;
@Accessors(chain = true) @Accessors(chain = true)
public class BannerAddRequest implements Serializable { public class BannerAddRequest implements Serializable {
@NotNull @NotNull // TODO FROM 芋艿 to 小范提示要加下哈哈哈
@ApiModelProperty("跳转链接") @ApiModelProperty("跳转链接")
private Integer url; private Integer url;

View File

@ -6,7 +6,7 @@ import lombok.experimental.Accessors;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
/** /** // TODO FROM 芋艿 to 2447007062最好加下字段的注释哈
* @author:mac * @author:mac
* @descriptio * @descriptio
* @create: 2020-5-12 204300 * @create: 2020-5-12 204300

View File

@ -26,7 +26,7 @@ public interface UserMapper extends BaseMapper<UserDO> {
*/ */
default IPage<UserDO> selectUserPage(UserPageDTO userPageDTO) { default IPage<UserDO> selectUserPage(UserPageDTO userPageDTO) {
// TODO FROM 芋艿 to jwf1173看下 QueryWrapperX 已经提供判空啦 // TODO FROM 芋艿 to jwf1173看下 QueryWrapperX 已经提供判空啦
// TODO FROM 伟帆 to 芋艿 这里是使用MP原生的判空支持lambda好还是使用QueryWrapperX使用字段名字符串的好呢 // TODO FROM 伟帆 to 芋艿 这里是使用MP原生的判空支持lambda好还是使用QueryWrapperX使用字段名字符串的好呢reply没特别想好现在建议还是 QueryWrapperX
return this.selectPage(new Page<>(userPageDTO.getPageNo(), userPageDTO.getPageSize()), return this.selectPage(new Page<>(userPageDTO.getPageNo(), userPageDTO.getPageSize()),
Wrappers.<UserDO>query().lambda() Wrappers.<UserDO>query().lambda()
.eq(StringUtils.isNotBlank(userPageDTO.getNickname()), UserDO::getNickname, userPageDTO.getNickname()) .eq(StringUtils.isNotBlank(userPageDTO.getNickname()), UserDO::getNickname, userPageDTO.getNickname())

View File

@ -4,14 +4,13 @@ import lombok.Data;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import java.util.Date;
/** /**
* 访问日志添加 DTO * 访问日志添加 DTO
*/ */
@Data @Data
@Accessors(chain = true) @Accessors(chain = true)
public class AccessLogPageDTO { public class AccessLogPageDTO { // TODO FROM 芋艿 to 2447007062有个 PageParams 类哈可以继承
/** /**

View File

@ -48,7 +48,7 @@ public class SystemLogServiceImpl implements SystemLogService {
@SuppressWarnings("Duplicates") @SuppressWarnings("Duplicates")
public PageResult<AccessLogBO> getAccessLogPage(AccessLogPageDTO accessLogPageDTO) { public PageResult<AccessLogBO> getAccessLogPage(AccessLogPageDTO accessLogPageDTO) {
PageResult<AccessLogBO> accessLogPageBOPageResult = SystemLogConvert.INSTANCE.convertPage( PageResult<AccessLogBO> accessLogPageBOPageResult = SystemLogConvert.INSTANCE.convertPage(
accessLogMapper.selectPage(accessLogPageDTO)); accessLogMapper.selectPage(accessLogPageDTO)); // TODO FROM 芋艿 to 2447007062可以考虑直接 return简洁 + IDEA 不告警
return accessLogPageBOPageResult; return accessLogPageBOPageResult;
} }
} }

View File

@ -41,7 +41,8 @@ public class SystemLogController {
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) { @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
// TODO FROM 芋艿 to 2447007062不要留这么大的空行
// TODO FROM 芋艿 to 2447007062使用 Request 接收参数噢
AccessLogPageDTO accessLogPageDTO = new AccessLogPageDTO().setAccountId(accountId) AccessLogPageDTO accessLogPageDTO = new AccessLogPageDTO().setAccountId(accountId)
.setPageNo(pageNo).setPageSize(pageSize); .setPageNo(pageNo).setPageSize(pageSize);
// 查询分页 // 查询分页

View File

@ -19,7 +19,7 @@ public interface AccessLogConvert {
AccessLogConvert INSTANCE = Mappers.getMapper(AccessLogConvert.class); AccessLogConvert INSTANCE = Mappers.getMapper(AccessLogConvert.class);
@Mappings({}) @Mappings({}) // TODO FROM 芋艿 to 2447007062注意空行哟另外如果不需要专门 mapping可以不添加该注解嘿嘿
PageResult<AccessLogPageResponse> convert(PageResult<AccessLogBO> result); PageResult<AccessLogPageResponse> convert(PageResult<AccessLogBO> result);

View File

@ -3,7 +3,6 @@ package cn.iocoder.mall.user.rpc.convert.user;
import cn.iocoder.mall.user.biz.bo.user.UserAddressBO; import cn.iocoder.mall.user.biz.bo.user.UserAddressBO;
import cn.iocoder.mall.user.rpc.response.user.UserAddressResponse; import cn.iocoder.mall.user.rpc.response.user.UserAddressResponse;
import org.mapstruct.Mapper; import org.mapstruct.Mapper;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers; import org.mapstruct.factory.Mappers;
/** /**
@ -17,7 +16,6 @@ public interface UserAddressRPCConvert {
UserAddressRPCConvert INSTANCE = Mappers.getMapper(UserAddressRPCConvert.class); UserAddressRPCConvert INSTANCE = Mappers.getMapper(UserAddressRPCConvert.class);
// TODO DONE FROM 芋艿 to 小范如果不用映射可以不用 @Mappings
@Mappings({})
UserAddressResponse convert(UserAddressBO userAddressBO); UserAddressResponse convert(UserAddressBO userAddressBO);
} }