部门管理更细和删除接口
This commit is contained in:
@@ -4,6 +4,7 @@ import cn.iocoder.common.framework.vo.PageResult;
|
||||
import cn.iocoder.mall.admin.api.bo.deptment.DeptmentBO;
|
||||
import cn.iocoder.mall.admin.api.dto.depetment.DeptmentAddDTO;
|
||||
import cn.iocoder.mall.admin.api.dto.depetment.DeptmentPageDTO;
|
||||
import cn.iocoder.mall.admin.api.dto.depetment.DeptmentUpdateDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -18,6 +19,10 @@ public interface DeptmentService {
|
||||
|
||||
DeptmentBO addDeptment(Integer adminId, DeptmentAddDTO deptmentAddDTO);
|
||||
|
||||
Boolean deleteDeptment(Integer adminId, Integer deptmentId);
|
||||
|
||||
Boolean updateDeptment(Integer adminId, DeptmentUpdateDTO deptmentUpdateDTO);
|
||||
|
||||
PageResult<DeptmentBO> getPageRootDeptment(DeptmentPageDTO deptmentPageDTO);
|
||||
|
||||
List<DeptmentBO> getAllDeptments();
|
||||
|
||||
@@ -60,8 +60,10 @@ public enum AdminErrorCodeEnum {
|
||||
|
||||
// ========== 部门模块 1002007000 ==========
|
||||
DEPT_SAME_LEVEL_NAME_EXITS(1002007001,"当前级别部门名字已存在"),
|
||||
DEPT_PARENT_NOT_EXITS(1002007002,"父级部门不存在")
|
||||
|
||||
DEPT_PARENT_NOT_EXITS(1002007002,"父级部门不存在"),
|
||||
DEPT_NOT_EXITS(1002007003, "当前部门不存在"),
|
||||
DEPT_EXITS_CHILDREN(1002007004, "当前部门存在子部门"),
|
||||
DEPT_PARENT_NOT_LEGAL(1002007005, "父级部门不合法"),
|
||||
;
|
||||
|
||||
private final int code;
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
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.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
*
|
||||
* @author: zhenxianyimeng
|
||||
* @date: 2019-06-26
|
||||
* @time: 22:37
|
||||
*/
|
||||
@ApiModel("部门更新DTO")
|
||||
@Data
|
||||
public class DeptmentUpdateDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 8905970407110374395L;
|
||||
|
||||
@ApiModelProperty(value = "部门id", required = true, example = "1")
|
||||
@NotNull(message = "部门id不能为空")
|
||||
private Integer id;
|
||||
|
||||
@ApiModelProperty(value = "部门名字", required = true, example = "销售部")
|
||||
@NotEmpty(message = "部门名字不为空")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = "部门排序", required = true, example = "1")
|
||||
@NotNull(message = "部门排序不为空")
|
||||
private Integer sort;
|
||||
|
||||
@ApiModelProperty(value = "父级部门id", required = true, example = "1")
|
||||
private Integer pid;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user