商品分类,代码 REVIEW 完成
This commit is contained in:
parent
08f3d35573
commit
b227928135
@ -35,6 +35,7 @@ public class OrderApplication {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Bean
|
@Bean
|
||||||
|
// TODO FROM 芋艿 to 芋艿:这个不太了解,可能后续要放到 starter 里,统一处理。
|
||||||
public ConfigurableServletWebServerFactory webServerFactory() {
|
public ConfigurableServletWebServerFactory webServerFactory() {
|
||||||
TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory();
|
TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory();
|
||||||
factory.addConnectorCustomizers(new TomcatConnectorCustomizer() {
|
factory.addConnectorCustomizers(new TomcatConnectorCustomizer() {
|
||||||
|
@ -2,7 +2,7 @@ package cn.iocoder.mall.product.biz.bo.category;
|
|||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -12,7 +12,6 @@ import java.util.Date;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
// TODO FROM 芋艿 to 伟帆,BO 可以不加 Serializable 接口,因为没序列化的诉求哈。一般 BO 可以创建一个统一的 ProductCategory,可以把 ProductCategoryAllListBO 合并过来 [DONE]
|
|
||||||
public class ProductCategoryBO {
|
public class ProductCategoryBO {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -17,7 +17,6 @@ public class ProductCategoryAddDTO {
|
|||||||
/**
|
/**
|
||||||
* 管理员id
|
* 管理员id
|
||||||
*/
|
*/
|
||||||
// TODO FROM 芋艿 to 伟帆:传入 Service 的,要加下 Validation 的注解,虽然 Controller 那也添加了 Validation,但是相比来说,Service 更应该被保护,嘿嘿。因为一些时候,Service 也会被别人所调用,所以要保护好自己。[DONE]
|
|
||||||
@NotNull(message = "管理员id不能为空")
|
@NotNull(message = "管理员id不能为空")
|
||||||
private Integer adminId;
|
private Integer adminId;
|
||||||
|
|
||||||
|
@ -16,11 +16,12 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.validation.annotation.Validated;
|
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.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import static cn.iocoder.mall.product.biz.enums.ProductErrorCodeEnum.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author: jiangweifan
|
* @Author: jiangweifan
|
||||||
* @Date: 2020/5/6
|
* @Date: 2020/5/6
|
||||||
@ -166,7 +167,6 @@ public class ProductCategoryServiceImpl implements ProductCategoryService {
|
|||||||
}
|
}
|
||||||
// 父分类必须是一级分类
|
// 父分类必须是一级分类
|
||||||
if (!ProductCategoryConstants.PID_ROOT.equals(parentCategory.getPid())) {
|
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);
|
throw ServiceExceptionUtil.exception(PRODUCT_CATEGORY_PARENT_CAN_NOT_BE_LEVEL2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,6 @@ import javax.validation.constraints.NotNull;
|
|||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
public class AdminsProductCategoryAddRequest {
|
public class AdminsProductCategoryAddRequest {
|
||||||
|
|
||||||
// TODO FROM 芋艿 to 伟帆:写了 swagger 注解,我们可以少写一份 Java 注释。[DONE]
|
|
||||||
@ApiModelProperty(name = "pid", value = "父级分类编号", required = true, example = "1")
|
@ApiModelProperty(name = "pid", value = "父级分类编号", required = true, example = "1")
|
||||||
@NotNull(message = "父分类编号不能为空")
|
@NotNull(message = "父分类编号不能为空")
|
||||||
private Integer pid;
|
private Integer pid;
|
||||||
|
@ -11,6 +11,7 @@ import lombok.experimental.Accessors;
|
|||||||
* @time 2019-04-06 13:22
|
* @time 2019-04-06 13:22
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
// TODO FROM 芋艿 to 小范:如果继承了,需要添加 @EqualsAndHashCode(callSuper = true) 注解
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
public class UsersUserAddressDO extends DeletableDO {
|
public class UsersUserAddressDO extends DeletableDO {
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ import java.io.Serializable;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
|
// TODO FROM 芋艿 to 小范:service 要做 validation 哈。其它同理
|
||||||
public class UserAddressUpdateDTO implements Serializable {
|
public class UserAddressUpdateDTO implements Serializable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -24,7 +24,7 @@ import java.util.List;
|
|||||||
* time: 2020/5/8 9:50
|
* time: 2020/5/8 9:50
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "用户地址(user API)")
|
@Api(tags = "用户地址(user API)") // TODO FROM 芋艿 to 小范:"管理员 - 管理员 API" 按照类似酱紫的格式哈。= = 虽然我也没想太好格式。
|
||||||
@RequestMapping("/users/user-address")
|
@RequestMapping("/users/user-address")
|
||||||
public class UsersUserAddressController {
|
public class UsersUserAddressController {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user