Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
Y
yudao-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
hblj
yudao-cloud
Commits
016600ab
提交
016600ab
authored
5月 07, 2020
作者:
jiangweifan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增- 商品分类更新,商品分类状态更新,商品分类删除接口
上级
20f2ad74
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
343 行增加
和
21 行删除
+343
-21
ProductErrorCodeEnum.java
.../iocoder/mall/product/biz/enums/ProductErrorCodeEnum.java
+2
-0
ProductCategoryConvert.java
.../product/biz/convert/category/ProductCategoryConvert.java
+10
-6
ProductCategoryDeleteDTO.java
...ll/product/biz/dto/category/ProductCategoryDeleteDTO.java
+24
-0
ProductCategoryUpdateDTO.java
...ll/product/biz/dto/category/ProductCategoryUpdateDTO.java
+8
-10
ProductCategoryUpdateStatusDTO.java
...duct/biz/dto/category/ProductCategoryUpdateStatusDTO.java
+28
-0
ProductCategoryService.java
...l/product/biz/service/product/ProductCategoryService.java
+25
-0
ProductCategoryServiceImpl.java
.../biz/service/product/impl/ProductCategoryServiceImpl.java
+99
-0
AdminsProductCategoryController.java
...st/controller/admins/AdminsProductCategoryController.java
+35
-2
ProductCategoryConvert.java
...product/rest/convert/category/ProductCategoryConvert.java
+27
-3
AdminsProductCategoryUpdateRequest.java
.../request/category/AdminsProductCategoryUpdateRequest.java
+54
-0
AdminsProductCategoryUpdateStatusRequest.java
...st/category/AdminsProductCategoryUpdateStatusRequest.java
+31
-0
没有找到文件。
product/product-biz-api/src/main/java/cn/iocoder/mall/product/biz/enums/ProductErrorCodeEnum.java
浏览文件 @
016600ab
...
...
@@ -10,9 +10,11 @@ public enum ProductErrorCodeEnum {
// ========== PRODUCT CATEGORY 模块 ==========
PRODUCT_CATEGORY_PARENT_NOT_EXISTS
(
1003001000
,
"父分类不存在"
),
PRODUCT_CATEGORY_NOT_EXISTS
(
1003001001
,
"商品分类不存在"
),
PRODUCT_CATEGORY_STATUS_NOT_EXISTS
(
1003001001
,
"商品分类状态不存在"
),
PRODUCT_CATEGORY_PARENT_NOT_SELF
(
1003001002
,
"不能设置自己为父分类"
),
PRODUCT_CATEGORY_STATUS_EQUALS
(
1002001003
,
"商品分类已经是该状态"
),
PRODUCT_CATEGORY_DELETE_ONLY_DISABLE
(
1002001004
,
"只有关闭的商品分类才可以删除"
),
PRODUCT_CATEGORY_DELETE_ONLY_NO_CHILD
(
1002001004
,
"只有无子分类的商品分类才可以删除"
),
PRODUCT_CATEGORY_MUST_ENABLE
(
1002001005
,
"只有开启的商品分类,才可以使用"
),
PRODUCT_CATEGORY_PARENT_CAN_NOT_BE_LEVEL2
(
1002001005
,
"父分类必须是一级分类"
),
...
...
product/product-biz/src/main/java/cn/iocoder/mall/product/biz/convert/category/ProductCategoryConvert.java
浏览文件 @
016600ab
...
...
@@ -4,6 +4,7 @@ import cn.iocoder.mall.product.biz.bo.category.ProductCategoryAddBO;
import
cn.iocoder.mall.product.biz.bo.category.ProductCategoryAllListBO
;
import
cn.iocoder.mall.product.biz.dataobject.product.ProductCategoryDO
;
import
cn.iocoder.mall.product.biz.dto.category.ProductCategoryAddDTO
;
import
cn.iocoder.mall.product.biz.dto.category.ProductCategoryUpdateDTO
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.Mappings
;
import
org.mapstruct.factory.Mappers
;
...
...
@@ -24,7 +25,6 @@ public interface ProductCategoryConvert {
* @param category
* @return
*/
@Mappings
({})
ProductCategoryAllListBO
convertToAllListBO
(
ProductCategoryDO
category
);
...
...
@@ -33,24 +33,27 @@ public interface ProductCategoryConvert {
* @param category
* @return
*/
@Mappings
({})
List
<
ProductCategoryAllListBO
>
convertToAllListBO
(
List
<
ProductCategoryDO
>
category
);
/**
*
商品分类新增
- DTO转换DO
*
新增商品分类
- DTO转换DO
* @param productCategoryAddDTO
* @return
*/
@Mappings
({})
ProductCategoryDO
convertToDO
(
ProductCategoryAddDTO
productCategoryAddDTO
);
/**
*
商品分类新增
- DO转换BO
*
新增商品分类
- DO转换BO
* @param category
* @return
*/
@Mappings
({})
ProductCategoryAddBO
convertToAddBO
(
ProductCategoryDO
category
);
/**
* 更新商品分类 - DTO转换DO
* @param productCategoryUpdateDTO
* @return
*/
ProductCategoryDO
convertToDO
(
ProductCategoryUpdateDTO
productCategoryUpdateDTO
);
}
\ No newline at end of file
product/product-biz/src/main/java/cn/iocoder/mall/product/biz/dto/category/ProductCategoryDeleteDTO.java
0 → 100644
浏览文件 @
016600ab
package
cn
.
iocoder
.
mall
.
product
.
biz
.
dto
.
category
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
/**
* @Author: jiangweifan
* @Date: 2020/5/6
* @Description: 商品分类 - 删除商品分类DTO
*/
@Data
@Accessors
(
chain
=
true
)
public
class
ProductCategoryDeleteDTO
{
/**
* 管理员id
*/
private
Integer
adminId
;
/**
* 商品分类编号
*/
private
Integer
id
;
}
product/product-biz/src/main/java/cn/iocoder/mall/product/biz/dto/
product
/ProductCategoryUpdateDTO.java
→
product/product-biz/src/main/java/cn/iocoder/mall/product/biz/dto/
category
/ProductCategoryUpdateDTO.java
浏览文件 @
016600ab
package
cn
.
iocoder
.
mall
.
product
.
biz
.
dto
.
product
;
package
cn
.
iocoder
.
mall
.
product
.
biz
.
dto
.
category
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
javax.validation.constraints.NotNull
;
/**
* 商品分类更新 DTO
* @Author: jiangweifan
* @Date: 2020/5/6
* @Description: 商品分类 - 更新商品分类DTO
*/
@Data
@Accessors
(
chain
=
true
)
public
class
ProductCategoryUpdateDTO
{
/**
* 管理员id
*/
private
Integer
adminId
;
/**
* 编号
*/
@NotNull
(
message
=
"编号不能为空"
)
private
Integer
id
;
/**
* 父分类编号
*/
@NotNull
(
message
=
"父分类编号不能为空"
)
private
Integer
pid
;
/**
* 名称
*/
@NotNull
(
message
=
"名称不能为空"
)
private
String
name
;
/**
* 描述
*/
@NotNull
(
message
=
"描述不能为空"
)
private
String
description
;
/**
* 分类图片
*/
// @NotNull(message = "分类图片不能为空")
private
String
picUrl
;
/**
* 排序值
*/
@NotNull
(
message
=
"排序值不能为空"
)
private
Integer
sort
;
}
product/product-biz/src/main/java/cn/iocoder/mall/product/biz/dto/category/ProductCategoryUpdateStatusDTO.java
0 → 100644
浏览文件 @
016600ab
package
cn
.
iocoder
.
mall
.
product
.
biz
.
dto
.
category
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
/**
* @Author: jiangweifan
* @Date: 2020/5/6
* @Description: 商品分类 - 更新商品分类状态DTO
*/
@Data
@Accessors
(
chain
=
true
)
public
class
ProductCategoryUpdateStatusDTO
{
/**
* 管理员id
*/
private
Integer
adminId
;
/**
* 商品分类编号
*/
private
Integer
id
;
/**
* 状态
*/
private
Integer
status
;
}
product/product-biz/src/main/java/cn/iocoder/mall/product/biz/service/product/ProductCategoryService.java
浏览文件 @
016600ab
...
...
@@ -3,6 +3,10 @@ package cn.iocoder.mall.product.biz.service.product;
import
cn.iocoder.mall.product.biz.bo.category.ProductCategoryAddBO
;
import
cn.iocoder.mall.product.biz.bo.category.ProductCategoryAllListBO
;
import
cn.iocoder.mall.product.biz.dto.category.ProductCategoryAddDTO
;
import
cn.iocoder.mall.product.biz.dto.category.ProductCategoryDeleteDTO
;
import
cn.iocoder.mall.product.biz.dto.category.ProductCategoryUpdateDTO
;
import
cn.iocoder.mall.product.biz.dto.category.ProductCategoryUpdateStatusDTO
;
import
java.util.List
;
...
...
@@ -25,4 +29,25 @@ public interface ProductCategoryService {
* @return
*/
ProductCategoryAddBO
addProductCategory
(
ProductCategoryAddDTO
productCategoryAddDTO
);
/**
* 更新商品分类
* @param productCategoryUpdateDTO
* @return
*/
Boolean
updateProductCategory
(
ProductCategoryUpdateDTO
productCategoryUpdateDTO
);
/**
* 更新商品分类状态
* @param productCategoryUpdateStatusDTO
* @return
*/
Boolean
updateProductCategoryStatus
(
ProductCategoryUpdateStatusDTO
productCategoryUpdateStatusDTO
);
/**
* 删除商品分类
* @param productCategoryDeleteDTO
* @return
*/
Boolean
deleteProductCategory
(
ProductCategoryDeleteDTO
productCategoryDeleteDTO
);
}
product/product-biz/src/main/java/cn/iocoder/mall/product/biz/service/product/impl/ProductCategoryServiceImpl.java
浏览文件 @
016600ab
...
...
@@ -8,11 +8,17 @@ import cn.iocoder.mall.product.biz.convert.category.ProductCategoryConvert;
import
cn.iocoder.mall.product.biz.dao.product.ProductCategoryMapper
;
import
cn.iocoder.mall.product.biz.dataobject.product.ProductCategoryDO
;
import
cn.iocoder.mall.product.biz.dto.category.ProductCategoryAddDTO
;
import
cn.iocoder.mall.product.biz.dto.category.ProductCategoryDeleteDTO
;
import
cn.iocoder.mall.product.biz.dto.category.ProductCategoryUpdateDTO
;
import
cn.iocoder.mall.product.biz.dto.category.ProductCategoryUpdateStatusDTO
;
import
cn.iocoder.mall.product.biz.enums.ProductErrorCodeEnum
;
import
cn.iocoder.mall.product.biz.enums.product.ProductCategoryConstants
;
import
cn.iocoder.mall.product.biz.service.product.ProductCategoryService
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.sql.Wrapper
;
import
java.util.*
;
/**
...
...
@@ -56,6 +62,99 @@ public class ProductCategoryServiceImpl implements ProductCategoryService {
return
ProductCategoryConvert
.
INSTANCE
.
convertToAddBO
(
productCategory
);
}
/**
* 更新商品分类
* @param productCategoryUpdateDTO
* @return
*/
@Override
public
Boolean
updateProductCategory
(
ProductCategoryUpdateDTO
productCategoryUpdateDTO
)
{
// 校验当前分类是否存在
if
(
productCategoryMapper
.
selectById
(
productCategoryUpdateDTO
.
getId
())
==
null
)
{
throw
ServiceExceptionUtil
.
exception
(
ProductErrorCodeEnum
.
PRODUCT_CATEGORY_NOT_EXISTS
.
getCode
());
}
// 校验父分类
validParent
(
productCategoryUpdateDTO
.
getPid
());
// 校验不能设置自己为父分类
if
(
productCategoryUpdateDTO
.
getId
().
equals
(
productCategoryUpdateDTO
.
getPid
()))
{
throw
ServiceExceptionUtil
.
exception
(
ProductErrorCodeEnum
.
PRODUCT_CATEGORY_PARENT_NOT_SELF
.
getCode
());
}
// 校验父分类是否存在
if
(!
ProductCategoryConstants
.
PID_ROOT
.
equals
(
productCategoryUpdateDTO
.
getPid
())
&&
productCategoryMapper
.
selectById
(
productCategoryUpdateDTO
.
getPid
())
==
null
)
{
throw
ServiceExceptionUtil
.
exception
(
ProductErrorCodeEnum
.
PRODUCT_CATEGORY_PARENT_NOT_EXISTS
.
getCode
());
}
// 更新到数据库
ProductCategoryDO
productCategoryDO
=
ProductCategoryConvert
.
INSTANCE
.
convertToDO
(
productCategoryUpdateDTO
);
productCategoryMapper
.
updateById
(
productCategoryDO
);
// TODO jiangweifan 操作日志
return
true
;
}
/**
* 更新商品分类状态
* @param productCategoryUpdateStatusDTO
* @return
*/
@Override
public
Boolean
updateProductCategoryStatus
(
ProductCategoryUpdateStatusDTO
productCategoryUpdateStatusDTO
)
{
Integer
productCategoryId
=
productCategoryUpdateStatusDTO
.
getId
();
Integer
status
=
productCategoryUpdateStatusDTO
.
getStatus
();
// 校验商品分类是否存在
ProductCategoryDO
productCategoryDO
=
productCategoryMapper
.
selectById
(
productCategoryId
);
if
(
productCategoryDO
==
null
)
{
throw
ServiceExceptionUtil
.
exception
(
ProductErrorCodeEnum
.
PRODUCT_CATEGORY_NOT_EXISTS
.
getCode
());
}
// 判断更新状态是否存在
if
(!
ProductCategoryConstants
.
STATUS_ENABLE
.
equals
(
status
)
&&
!
ProductCategoryConstants
.
STATUS_DISABLE
.
equals
(
status
))
{
throw
ServiceExceptionUtil
.
exception
(
ProductErrorCodeEnum
.
PRODUCT_CATEGORY_STATUS_NOT_EXISTS
.
getCode
());
}
// 如果状态相同,则返回错误
if
(
productCategoryDO
.
getStatus
().
equals
(
status
))
{
throw
ServiceExceptionUtil
.
exception
(
ProductErrorCodeEnum
.
PRODUCT_CATEGORY_STATUS_EQUALS
.
getCode
());
}
// 更新商品分类
productCategoryDO
.
setId
(
productCategoryId
).
setStatus
(
status
);
productCategoryMapper
.
updateById
(
productCategoryDO
);
// TODO jiangweifan 操作日志
return
true
;
}
/**
* 删除商品分类
* @param productCategoryDeleteDTO
* @return
*/
@Override
public
Boolean
deleteProductCategory
(
ProductCategoryDeleteDTO
productCategoryDeleteDTO
)
{
Integer
productCategoryId
=
productCategoryDeleteDTO
.
getId
();
// 校验分类是否存在
ProductCategoryDO
productCategory
=
productCategoryMapper
.
selectById
(
productCategoryId
);
if
(
productCategory
==
null
)
{
throw
ServiceExceptionUtil
.
exception
(
ProductErrorCodeEnum
.
PRODUCT_CATEGORY_NOT_EXISTS
.
getCode
());
}
// 只有禁用的商品分类才可以删除
if
(
ProductCategoryConstants
.
STATUS_ENABLE
.
equals
(
productCategory
.
getStatus
()))
{
throw
ServiceExceptionUtil
.
exception
(
ProductErrorCodeEnum
.
PRODUCT_CATEGORY_DELETE_ONLY_DISABLE
.
getCode
());
}
// 只有不存在子分类才可以删除
Integer
childCount
=
productCategoryMapper
.
selectCount
(
Wrappers
.<
ProductCategoryDO
>
lambdaQuery
().
eq
(
ProductCategoryDO:
:
getPid
,
productCategoryId
)
);
if
(
childCount
>
0
)
{
throw
ServiceExceptionUtil
.
exception
(
ProductErrorCodeEnum
.
PRODUCT_CATEGORY_DELETE_ONLY_NO_CHILD
.
getCode
());
}
// TODO jiangweifan 补充只有不存在商品才可以删除
// 标记删除商品分类
ProductCategoryDO
updateProductCategory
=
new
ProductCategoryDO
()
.
setId
(
productCategoryId
);
updateProductCategory
.
setDeleted
(
DeletedStatusEnum
.
DELETED_YES
.
getValue
());
productCategoryMapper
.
updateById
(
updateProductCategory
);
// TODO jiangweifan 操作日志
return
true
;
}
/**
* 校验商品分类的父分类
* @param pid
...
...
product/product-rest/src/main/java/cn/iocoder/mall/product/rest/controller/admins/AdminsProductCategoryController.java
浏览文件 @
016600ab
...
...
@@ -5,24 +5,28 @@ import cn.iocoder.common.framework.vo.CommonResult;
import
cn.iocoder.mall.product.biz.bo.category.ProductCategoryAddBO
;
import
cn.iocoder.mall.product.biz.bo.category.ProductCategoryAllListBO
;
import
cn.iocoder.mall.product.biz.dto.category.ProductCategoryAddDTO
;
import
cn.iocoder.mall.product.biz.dto.category.ProductCategoryDeleteDTO
;
import
cn.iocoder.mall.product.biz.dto.category.ProductCategoryUpdateDTO
;
import
cn.iocoder.mall.product.biz.dto.category.ProductCategoryUpdateStatusDTO
;
import
cn.iocoder.mall.product.biz.enums.product.ProductCategoryConstants
;
import
cn.iocoder.mall.product.biz.service.product.ProductCategoryService
;
import
cn.iocoder.mall.product.rest.convert.category.ProductCategoryConvert
;
import
cn.iocoder.mall.product.rest.request.category.AdminsProductCategoryAddRequest
;
import
cn.iocoder.mall.product.rest.request.category.AdminsProductCategoryUpdateRequest
;
import
cn.iocoder.mall.product.rest.request.category.AdminsProductCategoryUpdateStatusRequest
;
import
cn.iocoder.mall.product.rest.response.category.AdminsProductCategoryAddResponse
;
import
cn.iocoder.mall.product.rest.response.category.AdminsProductCategoryTreeNodeResponse
;
import
cn.iocoder.mall.security.core.context.AdminSecurityContextHolder
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
static
cn
.
iocoder
.
common
.
framework
.
vo
.
CommonResult
.
success
;
/**
...
...
@@ -75,4 +79,33 @@ public class AdminsProductCategoryController {
return
success
(
ProductCategoryConvert
.
INSTANCE
.
convertToAddResponse
(
addProductCategoryBO
));
}
@PostMapping
(
"/update"
)
@ApiOperation
(
value
=
"更新商品分类"
)
public
CommonResult
<
Boolean
>
update
(
@RequestBody
AdminsProductCategoryUpdateRequest
adminsProductCategoryUpdateRequest
)
{
// 创建 ProductCategoryUpdateDTO 对象
ProductCategoryUpdateDTO
productCategoryUpdateDTO
=
ProductCategoryConvert
.
INSTANCE
.
convertToUpdateDTO
(
AdminSecurityContextHolder
.
getContext
().
getAdminId
(),
adminsProductCategoryUpdateRequest
);
// 更新商品分类
return
success
(
productCategoryService
.
updateProductCategory
(
productCategoryUpdateDTO
));
}
@PostMapping
(
"/update_status"
)
@ApiOperation
(
value
=
"更新商品分类状态"
)
public
CommonResult
<
Boolean
>
updateStatus
(
@RequestBody
AdminsProductCategoryUpdateStatusRequest
adminsProductCategoryUpdateStatusRequest
)
{
// 创建 ProductCategoryUpdateStatusDTO 对象
ProductCategoryUpdateStatusDTO
productCategoryUpdateStatusDTO
=
ProductCategoryConvert
.
INSTANCE
.
convertToUpdateStatusDTO
(
AdminSecurityContextHolder
.
getContext
().
getAdminId
(),
adminsProductCategoryUpdateStatusRequest
);
// 更新商品分类状态
return
success
(
productCategoryService
.
updateProductCategoryStatus
(
productCategoryUpdateStatusDTO
));
}
@PostMapping
(
"/delete"
)
@ApiOperation
(
value
=
"删除商品分类"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"商品分类编号"
,
required
=
true
,
example
=
"1"
)
public
CommonResult
<
Boolean
>
delete
(
@RequestParam
(
"id"
)
Integer
id
)
{
// 创建 ProductCategoryDeleteDTO 对象
ProductCategoryDeleteDTO
productCategoryDeleteDTO
=
ProductCategoryConvert
.
INSTANCE
.
convertToDeleteDTO
(
AdminSecurityContextHolder
.
getContext
().
getAdminId
(),
id
);
// 删除商品分类
return
success
(
productCategoryService
.
deleteProductCategory
(
productCategoryDeleteDTO
));
}
}
product/product-rest/src/main/java/cn/iocoder/mall/product/rest/convert/category/ProductCategoryConvert.java
浏览文件 @
016600ab
...
...
@@ -3,7 +3,12 @@ package cn.iocoder.mall.product.rest.convert.category;
import
cn.iocoder.mall.product.biz.bo.category.ProductCategoryAddBO
;
import
cn.iocoder.mall.product.biz.bo.category.ProductCategoryAllListBO
;
import
cn.iocoder.mall.product.biz.dto.category.ProductCategoryAddDTO
;
import
cn.iocoder.mall.product.biz.dto.category.ProductCategoryDeleteDTO
;
import
cn.iocoder.mall.product.biz.dto.category.ProductCategoryUpdateDTO
;
import
cn.iocoder.mall.product.biz.dto.category.ProductCategoryUpdateStatusDTO
;
import
cn.iocoder.mall.product.rest.request.category.AdminsProductCategoryAddRequest
;
import
cn.iocoder.mall.product.rest.request.category.AdminsProductCategoryUpdateRequest
;
import
cn.iocoder.mall.product.rest.request.category.AdminsProductCategoryUpdateStatusRequest
;
import
cn.iocoder.mall.product.rest.response.category.AdminsProductCategoryAddResponse
;
import
cn.iocoder.mall.product.rest.response.category.AdminsProductCategoryTreeNodeResponse
;
import
org.mapstruct.Mapper
;
...
...
@@ -25,7 +30,6 @@ public interface ProductCategoryConvert {
* @param productCategoryAllListBO
* @return
*/
@Mappings
({})
AdminsProductCategoryTreeNodeResponse
convertToTreeNodeResponse
(
ProductCategoryAllListBO
productCategoryAllListBO
);
...
...
@@ -34,7 +38,6 @@ public interface ProductCategoryConvert {
* @param adminsProductCategoryAddRequest
* @return
*/
@Mappings
({})
ProductCategoryAddDTO
convertToAddDTO
(
Integer
adminId
,
AdminsProductCategoryAddRequest
adminsProductCategoryAddRequest
);
/**
...
...
@@ -42,6 +45,27 @@ public interface ProductCategoryConvert {
* @param productCategoryAddBO
* @return
*/
@Mappings
({})
AdminsProductCategoryAddResponse
convertToAddResponse
(
ProductCategoryAddBO
productCategoryAddBO
);
/**
* 更新商品分类 - Request转DTO
* @param adminsProductCategoryUpdateRequest
* @return
*/
ProductCategoryUpdateDTO
convertToUpdateDTO
(
Integer
adminId
,
AdminsProductCategoryUpdateRequest
adminsProductCategoryUpdateRequest
);
/**
* 更新商品分类状态 - Request转DTO
* @param adminsProductCategoryUpdateStatusRequest
* @return
*/
ProductCategoryUpdateStatusDTO
convertToUpdateStatusDTO
(
Integer
adminId
,
AdminsProductCategoryUpdateStatusRequest
adminsProductCategoryUpdateStatusRequest
);
/**
* 删除商品分类 - Request转DTO
* @param adminId 管理员id
* @param id 商品分类id
* @return
*/
ProductCategoryDeleteDTO
convertToDeleteDTO
(
Integer
adminId
,
Integer
id
);
}
product/product-rest/src/main/java/cn/iocoder/mall/product/rest/request/category/AdminsProductCategoryUpdateRequest.java
0 → 100644
浏览文件 @
016600ab
package
cn
.
iocoder
.
mall
.
product
.
rest
.
request
.
category
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
javax.validation.constraints.NotNull
;
/**
* @Author: jiangweifan
* @Date: 2020/5/6
* @Description: 商品分类 - 更新商品分类Request
*/
@ApiModel
(
"更新商品分类Request"
)
@Data
@Accessors
(
chain
=
true
)
public
class
AdminsProductCategoryUpdateRequest
{
/**
* 编号
*/
@ApiModelProperty
(
name
=
"id"
,
value
=
"分类编号"
,
required
=
true
,
example
=
"1"
)
@NotNull
(
message
=
"编号不能为空"
)
private
Integer
id
;
/**
* 父分类编号
*/
@ApiModelProperty
(
name
=
"pid"
,
value
=
"父级分类编号"
,
required
=
true
,
example
=
"1"
)
@NotNull
(
message
=
"父分类编号不能为空"
)
private
Integer
pid
;
/**
* 名称
*/
@ApiModelProperty
(
name
=
"name"
,
value
=
"分类名字(标识)"
,
required
=
true
,
example
=
"admin/info"
)
@NotNull
(
message
=
"名称不能为空"
)
private
String
name
;
/**
* 描述
*/
@ApiModelProperty
(
name
=
"description"
,
value
=
"描述"
,
required
=
true
,
example
=
"1"
)
@NotNull
(
message
=
"描述不能为空"
)
private
String
description
;
/**
* 分类图片
*/
@ApiModelProperty
(
name
=
"picUrl"
,
value
=
"分类图片"
,
example
=
"http://www.iocoder.cn/images/common/wechat_mp_2017_07_31_bak.jpg/"
)
private
String
picUrl
;
/**
* 排序值
*/
@ApiModelProperty
(
name
=
"sort"
,
value
=
"排序"
,
required
=
true
,
example
=
"1"
)
@NotNull
(
message
=
"排序值不能为空"
)
private
Integer
sort
;
}
product/product-rest/src/main/java/cn/iocoder/mall/product/rest/request/category/AdminsProductCategoryUpdateStatusRequest.java
0 → 100644
浏览文件 @
016600ab
package
cn
.
iocoder
.
mall
.
product
.
rest
.
request
.
category
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
javax.validation.constraints.NotNull
;
/**
* @Author: jiangweifan
* @Date: 2020/5/6
* @Description: 商品分类 - 更新商品分类状态Request
*/
@ApiModel
(
"更新商品分类状态Request"
)
@Data
@Accessors
(
chain
=
true
)
public
class
AdminsProductCategoryUpdateStatusRequest
{
/**
* 商品分类编号
*/
@ApiModelProperty
(
name
=
"id"
,
value
=
"分类编号"
,
required
=
true
,
example
=
"1"
)
@NotNull
(
message
=
"编号不能为空"
)
private
Integer
id
;
/**
* 更新状态
*/
@ApiModelProperty
(
name
=
"status"
,
value
=
"状态。1 - 开启;2 - 禁用"
,
required
=
true
,
example
=
"1"
)
@NotNull
(
message
=
"状态不能为空"
)
private
Integer
status
;
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论