refactor: 优化枚举字典处理,增加颜色类型

1.重构 useDict 方法,同时支持枚举和查询字典,对应后端接口增加缓存处理
2.优化 BaseEnum 处理,增加 color 字段可用于设置对应枚举背景颜色(同字典背景颜色)
This commit is contained in:
2023-09-17 18:03:14 +08:00
parent 3a3a5d6b71
commit 1f73aa732d
33 changed files with 234 additions and 191 deletions

View File

@@ -53,6 +53,11 @@ public class CacheConsts {
*/
public static final String MENU_KEY_PREFIX = "MENU";
/**
* 字典缓存键前缀
*/
public static final String DICT_KEY_PREFIX = "DICT";
/**
* 仪表盘缓存键前缀
*/

View File

@@ -0,0 +1,55 @@
/*
* 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.constant;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
/**
* UI 相关常量
*
* @author Charles7c
* @since 2023/9/17 14:12
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class UIConsts {
/**
* 主色(极致蓝)
*/
public static final String COLOR_PRIMARY = "arcoblue";
/**
* 成功色(仙野绿)
*/
public static final String COLOR_SUCCESS = "green";
/**
* 警告色(活力橙)
*/
public static final String COLOR_WARNING = "orangered";
/**
* 错误色(浪漫红)
*/
public static final String COLOR_ERROR = "red";
/**
* 默认色(中性灰)
*/
public static final String COLOR_DEFAULT = "gray";
}