增加新增部门接口
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package cn.iocoder.mall.admin.api;
|
||||
|
||||
import cn.iocoder.mall.admin.api.bo.deptment.DeptmentBO;
|
||||
import cn.iocoder.mall.admin.api.dto.depetment.DeptmentAddDTO;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
*
|
||||
* @author: zhenxianyimeng
|
||||
* @date: 2019-06-14
|
||||
* @time: 19:35
|
||||
*/
|
||||
public interface DeptmentService {
|
||||
|
||||
DeptmentBO addDeptment(Integer adminId, DeptmentAddDTO deptmentAddDTO);
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package cn.iocoder.mall.admin.api.bo.deptment;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
*
|
||||
* @author: zhenxianyimeng
|
||||
* @date: 2019-06-14
|
||||
* @time: 19:49
|
||||
*/
|
||||
@ApiModel("部门 BO")
|
||||
@Data
|
||||
public class DeptmentBO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 7656901281539594453L;
|
||||
|
||||
/**
|
||||
* 部门编号
|
||||
*/
|
||||
private Integer id;
|
||||
/**
|
||||
* 部门名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 部门排序字段
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 父级部门id
|
||||
*/
|
||||
private Integer pid;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
}
|
||||
@@ -57,6 +57,11 @@ public enum AdminErrorCodeEnum {
|
||||
SMS_TEMPLATE_NOT_EXISTENT(1002006020, "短信签名不存在"),
|
||||
SMS_TEMPLATE_IS_EXISTENT(1002006021, "短信签名不存在"),
|
||||
SMS_NOT_SEND_CLIENT(1002006030, "短信没有发送的client"),
|
||||
|
||||
// ========== 部门模块 1002007000 ==========
|
||||
DEPT_SAME_LEVEL_NAME_EXITS(1002007001,"当前级别部门名字已存在"),
|
||||
DEPT_PARENT_NOT_EXITS(1002007002,"父级部门不存在")
|
||||
|
||||
;
|
||||
|
||||
private final int code;
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package cn.iocoder.mall.admin.api.dto.depetment;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
*
|
||||
* @author: zhenxianyimeng
|
||||
* @date: 2019-06-14
|
||||
* @time: 19:55
|
||||
*/
|
||||
@ApiModel("添加部门 DTO")
|
||||
@Data
|
||||
public class DeptmentAddDTO {
|
||||
|
||||
@ApiModelProperty(value = "名字", required = true, example = "销售一组")
|
||||
@NotNull(message = "不能为空")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "排序", required = true, example = "1")
|
||||
@NotNull(message = "不能为空")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty(value = "父级id", required = true, example = "1")
|
||||
@NotNull(message = "可以为空,默认0,顶层")
|
||||
@Min(value = 0,message = "父id不能小于0")
|
||||
private Integer pid = 0;
|
||||
}
|
||||
Reference in New Issue
Block a user