优化:部门新增类型字段,用于标识部门是系统内置或自定义

1.系统内置部门不允许禁用、删除、修改上级部门
2.抽取 getAncestors 方法,用于复用获取祖级列表
3.删除部门时,自动删除角色和部门关联
This commit is contained in:
2023-03-19 22:10:37 +08:00
parent 6b73aeb8a9
commit b345e4450d
16 changed files with 169 additions and 52 deletions

View File

@@ -0,0 +1,42 @@
/*
* Copyright (c) 2022-present Charles7c Authors. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package top.charles7c.cnadmin.common.enums;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import top.charles7c.cnadmin.common.base.BaseEnum;
/**
* 数据类型枚举
*
* @author Charles7c
* @since 2023/3/19 12:17
*/
@Getter
@RequiredArgsConstructor
public enum DataTypeEnum implements BaseEnum<Integer, String> {
/** 系统内置 */
SYSTEM(1, "系统内置"),
/** 自定义 */
CUSTOM(2, "自定义"),;
private final Integer value;
private final String description;
}