feat: 新增编码生成相关枚举和错误码
This commit is contained in:
@@ -17,4 +17,11 @@ public interface ErrorCodeConstants {
|
||||
|
||||
// ========== 计量单位 ==========
|
||||
ErrorCode MEASURE_UNIT_NOT_EXISTS = new ErrorCode(8, "计量单位不存在");
|
||||
|
||||
// ========== 编码生成 ==========
|
||||
ErrorCode CODE_RULE_NOT_EXISTS = new ErrorCode(9, "编码规则不存在");
|
||||
ErrorCode CODE_RULE_CODE_DUPLICATE = new ErrorCode(10, "规则编码已存在");
|
||||
ErrorCode CODE_GEN_SEQ_EXCEED_MAX = new ErrorCode(11, "序号超出最大值上限");
|
||||
ErrorCode CODE_GEN_LENGTH_EXCEED = new ErrorCode(12, "生成的编码超出总长度限制");
|
||||
ErrorCode CODE_RULE_DISABLED = new ErrorCode(13, "编码规则已被禁用");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package cn.code.nl.module.base.service.codegen.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 字母大小写枚举
|
||||
*
|
||||
* @author zhouz
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum LetterCaseEnum {
|
||||
|
||||
NONE(0, "原样"),
|
||||
UPPER(1, "全大写"),
|
||||
LOWER(2, "全小写");
|
||||
|
||||
/**
|
||||
* 状态值
|
||||
*/
|
||||
private final Integer code;
|
||||
/**
|
||||
* 状态名称
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package cn.code.nl.module.base.service.codegen.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 序号重置维度枚举
|
||||
*
|
||||
* @author zhouz
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum ResetByEnum {
|
||||
|
||||
DAY("DAY", "按天重置"),
|
||||
MONTH("MONTH", "按月重置"),
|
||||
YEAR("YEAR", "按年重置"),
|
||||
GLOBAL("GLOBAL", "全局不重置");
|
||||
|
||||
/**
|
||||
* 维度编码
|
||||
*/
|
||||
private final String code;
|
||||
/**
|
||||
* 维度名称
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package cn.code.nl.module.base.service.codegen.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 编码段类型枚举
|
||||
*
|
||||
* @author zhouz
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum SegmentTypeEnum {
|
||||
|
||||
PREFIX("PREFIX", "固定前缀"),
|
||||
DATE("DATE", "日期"),
|
||||
SEQUENCE("SEQUENCE", "流水序号");
|
||||
|
||||
/**
|
||||
* 类型编码
|
||||
*/
|
||||
private final String code;
|
||||
/**
|
||||
* 类型名称
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package cn.code.nl.module.base.service.codegen.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* 序号并发策略枚举
|
||||
*
|
||||
* @author zhouz
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum SeqStrategyEnum {
|
||||
|
||||
SEGMENT("segment", "号段预分配"),
|
||||
LOCK("lock", "分布式锁实时");
|
||||
|
||||
/**
|
||||
* 策略编码
|
||||
*/
|
||||
private final String code;
|
||||
/**
|
||||
* 策略名称
|
||||
*/
|
||||
private final String name;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user