37 lines
797 B
Java
37 lines
797 B
Java
package com.imyeyu.api.bean;
|
|
|
|
import com.imyeyu.api.annotation.SettingBizType;
|
|
import com.imyeyu.api.modules.common.entity.Setting;
|
|
import com.imyeyu.utils.Text;
|
|
|
|
///
|
|
///
|
|
/// @author 夜雨
|
|
/// @since 2026-09-08 15:18
|
|
public interface SettingEnum {
|
|
|
|
default String getBizType() {
|
|
Class<? extends SettingEnum> implEnum = getClass();
|
|
SettingBizType bizType = implEnum.getAnnotation(SettingBizType.class);
|
|
if (bizType == null) {
|
|
return Text.bizClassName(implEnum);
|
|
}
|
|
return bizType.value();
|
|
}
|
|
|
|
String name();
|
|
|
|
String getDefaultValue();
|
|
|
|
Setting.ValueType getValueType();
|
|
|
|
/// 配置作用域
|
|
///
|
|
/// 业务级配置由业务对象自己维护,启动时不初始化记录
|
|
///
|
|
/// @return 配置作用域
|
|
default Setting.Scope getScope() {
|
|
return Setting.Scope.SYSTEM;
|
|
}
|
|
}
|