From b227928135a20a780a762abd03d8ccfbca02b39a Mon Sep 17 00:00:00 2001 From: YunaiV <> Date: Mon, 11 May 2020 19:25:50 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E5=88=86=E7=B1=BB=EF=BC=8C?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=20REVIEW=20=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/iocoder/mall/order/application/OrderApplication.java | 1 + .../mall/product/biz/bo/category/ProductCategoryBO.java | 3 +-- .../product/biz/dto/category/ProductCategoryAddDTO.java | 1 - .../service/product/impl/ProductCategoryServiceImpl.java | 6 +++--- .../request/category/AdminsProductCategoryAddRequest.java | 1 - .../mall/user/biz/dataobject/user/UsersUserAddressDO.java | 1 + .../mall/user/biz/dto/user/UserAddressUpdateDTO.java | 1 + .../rest/controller/user/UsersUserAddressController.java | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/order/order-application/src/main/java/cn/iocoder/mall/order/application/OrderApplication.java b/order/order-application/src/main/java/cn/iocoder/mall/order/application/OrderApplication.java index ed0d910a0..5187d889e 100644 --- a/order/order-application/src/main/java/cn/iocoder/mall/order/application/OrderApplication.java +++ b/order/order-application/src/main/java/cn/iocoder/mall/order/application/OrderApplication.java @@ -35,6 +35,7 @@ public class OrderApplication { * @return */ @Bean + // TODO FROM 芋艿 to 芋艿:这个不太了解,可能后续要放到 starter 里,统一处理。 public ConfigurableServletWebServerFactory webServerFactory() { TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory(); factory.addConnectorCustomizers(new TomcatConnectorCustomizer() { diff --git a/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/category/ProductCategoryBO.java b/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/category/ProductCategoryBO.java index 1b918d4ab..556d42248 100644 --- a/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/category/ProductCategoryBO.java +++ b/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/bo/category/ProductCategoryBO.java @@ -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 { /** diff --git a/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/dto/category/ProductCategoryAddDTO.java b/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/dto/category/ProductCategoryAddDTO.java index 8d0a8f389..f997a9655 100644 --- a/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/dto/category/ProductCategoryAddDTO.java +++ b/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/dto/category/ProductCategoryAddDTO.java @@ -17,7 +17,6 @@ public class ProductCategoryAddDTO { /** * 管理员id */ - // TODO FROM 芋艿 to 伟帆:传入 Service 的,要加下 Validation 的注解,虽然 Controller 那也添加了 Validation,但是相比来说,Service 更应该被保护,嘿嘿。因为一些时候,Service 也会被别人所调用,所以要保护好自己。[DONE] @NotNull(message = "管理员id不能为空") private Integer adminId; diff --git a/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/service/product/impl/ProductCategoryServiceImpl.java b/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/service/product/impl/ProductCategoryServiceImpl.java index 6a9e63cab..deedebddc 100644 --- a/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/service/product/impl/ProductCategoryServiceImpl.java +++ b/product/product-biz/src/main/java/cn/iocoder/mall/product/biz/service/product/impl/ProductCategoryServiceImpl.java @@ -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); } } diff --git a/product/product-rest/src/main/java/cn/iocoder/mall/product/rest/request/category/AdminsProductCategoryAddRequest.java b/product/product-rest/src/main/java/cn/iocoder/mall/product/rest/request/category/AdminsProductCategoryAddRequest.java index 6b25daf69..367032123 100644 --- a/product/product-rest/src/main/java/cn/iocoder/mall/product/rest/request/category/AdminsProductCategoryAddRequest.java +++ b/product/product-rest/src/main/java/cn/iocoder/mall/product/rest/request/category/AdminsProductCategoryAddRequest.java @@ -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; diff --git a/user/user-biz/src/main/java/cn/iocoder/mall/user/biz/dataobject/user/UsersUserAddressDO.java b/user/user-biz/src/main/java/cn/iocoder/mall/user/biz/dataobject/user/UsersUserAddressDO.java index 3b49d0e9a..decc62027 100644 --- a/user/user-biz/src/main/java/cn/iocoder/mall/user/biz/dataobject/user/UsersUserAddressDO.java +++ b/user/user-biz/src/main/java/cn/iocoder/mall/user/biz/dataobject/user/UsersUserAddressDO.java @@ -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 { diff --git a/user/user-biz/src/main/java/cn/iocoder/mall/user/biz/dto/user/UserAddressUpdateDTO.java b/user/user-biz/src/main/java/cn/iocoder/mall/user/biz/dto/user/UserAddressUpdateDTO.java index f793d3de6..6144b31cf 100644 --- a/user/user-biz/src/main/java/cn/iocoder/mall/user/biz/dto/user/UserAddressUpdateDTO.java +++ b/user/user-biz/src/main/java/cn/iocoder/mall/user/biz/dto/user/UserAddressUpdateDTO.java @@ -13,6 +13,7 @@ import java.io.Serializable; */ @Data @Accessors(chain = true) +// TODO FROM 芋艿 to 小范:service 要做 validation 哈。其它同理 public class UserAddressUpdateDTO implements Serializable { /** diff --git a/user/user-rest/src/main/java/cn/iocoder/mall/user/rest/controller/user/UsersUserAddressController.java b/user/user-rest/src/main/java/cn/iocoder/mall/user/rest/controller/user/UsersUserAddressController.java index 8231dca7a..65d19c730 100644 --- a/user/user-rest/src/main/java/cn/iocoder/mall/user/rest/controller/user/UsersUserAddressController.java +++ b/user/user-rest/src/main/java/cn/iocoder/mall/user/rest/controller/user/UsersUserAddressController.java @@ -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 {