商品分类,代码 REVIEW 完成

This commit is contained in:
YunaiV 2020-05-11 19:25:50 +08:00
parent 08f3d35573
commit b227928135
8 changed files with 8 additions and 8 deletions

View File

@ -35,6 +35,7 @@ public class OrderApplication {
* @return
*/
@Bean
// TODO FROM 芋艿 to 芋艿这个不太了解可能后续要放到 starter 统一处理
public ConfigurableServletWebServerFactory webServerFactory() {
TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory();
factory.addConnectorCustomizers(new TomcatConnectorCustomizer() {

View File

@ -2,7 +2,7 @@ package cn.iocoder.mall.product.biz.bo.category;
import lombok.Data;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
@ -12,7 +12,6 @@ import java.util.Date;
*/
@Data
@Accessors(chain = true)
// TODO FROM 芋艿 to 伟帆BO 可以不加 Serializable 接口因为没序列化的诉求哈一般 BO 可以创建一个统一的 ProductCategory可以把 ProductCategoryAllListBO 合并过来 [DONE]
public class ProductCategoryBO {
/**

View File

@ -17,7 +17,6 @@ public class ProductCategoryAddDTO {
/**
* 管理员id
*/
// TODO FROM 芋艿 to 伟帆传入 Service 要加下 Validation 的注解虽然 Controller 那也添加了 Validation但是相比来说Service 更应该被保护嘿嘿因为一些时候Service 也会被别人所调用所以要保护好自己[DONE]
@NotNull(message = "管理员id不能为空")
private Integer adminId;

View File

@ -16,11 +16,12 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import static cn.iocoder.mall.product.biz.enums.ProductErrorCodeEnum.*;
import javax.validation.Valid;
import java.util.Date;
import java.util.List;
import static cn.iocoder.mall.product.biz.enums.ProductErrorCodeEnum.*;
/**
* @Author: jiangweifan
* @Date: 2020/5/6
@ -166,7 +167,6 @@ public class ProductCategoryServiceImpl implements ProductCategoryService {
}
// 父分类必须是一级分类
if (!ProductCategoryConstants.PID_ROOT.equals(parentCategory.getPid())) {
// TODO FROM 芋艿 to 伟帆ProductErrorCodeEnum 去实现下 ServiceExceptionUtil.Enumerable 接口酱紫就不用 .getCode() 方法代码会更简洁同时可以把 ProductErrorCodeEnum static import [DONE]
throw ServiceExceptionUtil.exception(PRODUCT_CATEGORY_PARENT_CAN_NOT_BE_LEVEL2);
}
}

View File

@ -17,7 +17,6 @@ import javax.validation.constraints.NotNull;
@Accessors(chain = true)
public class AdminsProductCategoryAddRequest {
// TODO FROM 芋艿 to 伟帆写了 swagger 注解我们可以少写一份 Java 注释[DONE]
@ApiModelProperty(name = "pid", value = "父级分类编号", required = true, example = "1")
@NotNull(message = "父分类编号不能为空")
private Integer pid;

View File

@ -11,6 +11,7 @@ import lombok.experimental.Accessors;
* @time 2019-04-06 13:22
*/
@Data
// TODO FROM 芋艿 to 小范如果继承了需要添加 @EqualsAndHashCode(callSuper = true) 注解
@Accessors(chain = true)
public class UsersUserAddressDO extends DeletableDO {

View File

@ -13,6 +13,7 @@ import java.io.Serializable;
*/
@Data
@Accessors(chain = true)
// TODO FROM 芋艿 to 小范service 要做 validation 其它同理
public class UserAddressUpdateDTO implements Serializable {
/**

View File

@ -24,7 +24,7 @@ import java.util.List;
* time: 2020/5/8 9:50
*/
@RestController
@Api(tags = "用户地址(user API)")
@Api(tags = "用户地址(user API)") // TODO FROM 芋艿 to 小范"管理员 - 管理员 API" 按照类似酱紫的格式哈= = 虽然我也没想太好格式
@RequestMapping("/users/user-address")
public class UsersUserAddressController {