代码初始化

This commit is contained in:
wangxiangshun
2025-10-02 17:19:01 +08:00
commit 5cc31cfbbe
474 changed files with 53553 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
package com.vetti.common.enums;
/**
* 操作状态
*
* @author ruoyi
*
*/
public enum BusinessStatus
{
/**
* 成功
*/
SUCCESS,
/**
* 失败
*/
FAIL,
}

View File

@@ -0,0 +1,59 @@
package com.vetti.common.enums;
/**
* 业务操作类型
*
* @author ruoyi
*/
public enum BusinessType
{
/**
* 其它
*/
OTHER,
/**
* 新增
*/
INSERT,
/**
* 修改
*/
UPDATE,
/**
* 删除
*/
DELETE,
/**
* 授权
*/
GRANT,
/**
* 导出
*/
EXPORT,
/**
* 导入
*/
IMPORT,
/**
* 强退
*/
FORCE,
/**
* 生成代码
*/
GENCODE,
/**
* 清空数据
*/
CLEAN,
}

View File

@@ -0,0 +1,19 @@
package com.vetti.common.enums;
/**
* 数据源
*
* @author ruoyi
*/
public enum DataSourceType
{
/**
* 主库
*/
MASTER,
/**
* 从库
*/
SLAVE
}

View File

@@ -0,0 +1,59 @@
package com.vetti.common.enums;
import java.util.function.Function;
import com.vetti.common.utils.DesensitizedUtil;
/**
* 脱敏类型
*
* @author ruoyi
*/
public enum DesensitizedType
{
/**
* 姓名第2位星号替换
*/
USERNAME(s -> s.replaceAll("(\\S)\\S(\\S*)", "$1*$2")),
/**
* 密码,全部字符都用*代替
*/
PASSWORD(DesensitizedUtil::password),
/**
* 身份证中间10位星号替换
*/
ID_CARD(s -> s.replaceAll("(\\d{4})\\d{10}(\\d{3}[Xx]|\\d{4})", "$1** **** ****$2")),
/**
* 手机号中间4位星号替换
*/
PHONE(s -> s.replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2")),
/**
* 电子邮箱,仅显示第一个字母和@后面的地址显示,其他星号替换
*/
EMAIL(s -> s.replaceAll("(^.)[^@]*(@.*$)", "$1****$2")),
/**
* 银行卡号保留最后4位其他星号替换
*/
BANK_CARD(s -> s.replaceAll("\\d{15}(\\d{3})", "**** **** **** **** $1")),
/**
* 车牌号码,包含普通车辆、新能源车辆
*/
CAR_LICENSE(DesensitizedUtil::carLicense);
private final Function<String, String> desensitizer;
DesensitizedType(Function<String, String> desensitizer)
{
this.desensitizer = desensitizer;
}
public Function<String, String> desensitizer()
{
return desensitizer;
}
}

View File

@@ -0,0 +1,30 @@
package com.vetti.common.enums;
/**
* 填充类型CODE
* @author wangxiangshun
*/
public enum FillTypeEnum {
INSERT("INSERT", "新增"), UPDATE("UPDATE", "修改");
private final String code;
private final String info;
FillTypeEnum(String code, String info)
{
this.code = code;
this.info = info;
}
public String getCode()
{
return code;
}
public String getInfo()
{
return info;
}
}

View File

@@ -0,0 +1,36 @@
package com.vetti.common.enums;
import java.util.HashMap;
import java.util.Map;
import org.springframework.lang.Nullable;
/**
* 请求方式
*
* @author ruoyi
*/
public enum HttpMethod
{
GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS, TRACE;
private static final Map<String, HttpMethod> mappings = new HashMap<>(16);
static
{
for (HttpMethod httpMethod : values())
{
mappings.put(httpMethod.name(), httpMethod);
}
}
@Nullable
public static HttpMethod resolve(@Nullable String method)
{
return (method != null ? mappings.get(method) : null);
}
public boolean matches(String method)
{
return (this == resolve(method));
}
}

View File

@@ -0,0 +1,31 @@
package com.vetti.common.enums;
/**
* 国际化语言类型编号
* @author wangxiangshun
*/
public enum InternationalLangTypeEnum {
INTERNATIONAL_LANG_TYPE_ENUM_ZH("zh_CN", "中文"),
INTERNATIONAL_LANG_TYPE_ENUM_EN("en_US", "英文"),
;
private final String code;
private final String info;
InternationalLangTypeEnum(String code, String info)
{
this.code = code;
this.info = info;
}
public String getCode()
{
return code;
}
public String getInfo()
{
return info;
}
}

View File

@@ -0,0 +1,41 @@
package com.vetti.common.enums;
/**
* 国际化语言类型枚举
* @author Wangxiangshun
*/
public enum LanguageTypeEnum {
ZH("zh", "CN"),
EN("en", "US"),
JA("ja", "JP"),
;
private final String code;
private final String info;
LanguageTypeEnum(String code, String info)
{
this.code = code;
this.info = info;
}
public String getCode()
{
return code;
}
public String getInfo()
{
return info;
}
public static LanguageTypeEnum getByInfo(String code) {
LanguageTypeEnum[] statusEnums = values();
for (LanguageTypeEnum statusEnum : statusEnums) {
if (statusEnum.getCode().equals(code)) {
return statusEnum;
}
}
return null;
}
}

View File

@@ -0,0 +1,20 @@
package com.vetti.common.enums;
/**
* 限流类型
*
* @author ruoyi
*/
public enum LimitType
{
/**
* 默认策略全局限流
*/
DEFAULT,
/**
* 根据请求者IP进行限流
*/
IP
}

View File

@@ -0,0 +1,24 @@
package com.vetti.common.enums;
/**
* 操作人类别
*
* @author ruoyi
*/
public enum OperatorType
{
/**
* 其它
*/
OTHER,
/**
* 后台用户
*/
MANAGE,
/**
* 手机端用户
*/
MOBILE
}

View File

@@ -0,0 +1,31 @@
package com.vetti.common.enums;
/**
* 流水号业务类型
*/
public enum SerialNumberBusinessType {
FLEET_INFO("FLEET_INFO", "车队"),
PARTNER("partner", "合作方"),
TASK("task", "任务"),
;
private final String code;
private final String info;
SerialNumberBusinessType(String code, String info)
{
this.code = code;
this.info = info;
}
public String getCode()
{
return code;
}
public String getInfo()
{
return info;
}
}

View File

@@ -0,0 +1,30 @@
package com.vetti.common.enums;
/**
* 用户状态
*
* @author ruoyi
*/
public enum UserStatus
{
OK("0", "正常"), DISABLE("1", "停用"), DELETED("2", "删除");
private final String code;
private final String info;
UserStatus(String code, String info)
{
this.code = code;
this.info = info;
}
public String getCode()
{
return code;
}
public String getInfo()
{
return info;
}
}

View File

@@ -0,0 +1,33 @@
package com.vetti.common.enums.command;
/**
* 地址类型
*/
public enum AddressTypeEnum {
DEFAULT("default", "Default"),
WORK("work", "Work"),
;
private final String code;
private final String info;
AddressTypeEnum(String code, String info)
{
this.code = code;
this.info = info;
}
public String getCode()
{
return code;
}
public String getInfo()
{
return info;
}
}

View File

@@ -0,0 +1,34 @@
package com.vetti.common.enums.command;
/**
* 车辆状态
*/
public enum CarStatusEnum {
COMPLIANT("Compliant", "Compliant"),
INSPECTION_DUE("inspectionDue", "InspectionDue"),
SERVICE_REQUIRED("serviceRequired", "ServiceRequired"),
UNCHECKED("unchecked", "Unchecked"),
;
private final String code;
private final String info;
CarStatusEnum(String code, String info)
{
this.code = code;
this.info = info;
}
public String getCode()
{
return code;
}
public String getInfo()
{
return info;
}
}

View File

@@ -0,0 +1,31 @@
package com.vetti.common.enums.command;
/**
* 登录平台类型
*/
public enum LoginPlatformTypeEnum {
GOOGLE("google", "谷歌"),
APPLY("apply", "苹果"),
;
private final String code;
private final String info;
LoginPlatformTypeEnum(String code, String info)
{
this.code = code;
this.info = info;
}
public String getCode()
{
return code;
}
public String getInfo()
{
return info;
}
}

View File

@@ -0,0 +1,32 @@
package com.vetti.common.enums.command;
/**
* 检修项目记录状态
*/
public enum OverhaulItemRecordStatusEnum {
STATUS_0("0", "未通过"),
STATUS_1("1", "通过"),
;
private final String code;
private final String info;
OverhaulItemRecordStatusEnum(String code, String info)
{
this.code = code;
this.info = info;
}
public String getCode()
{
return code;
}
public String getInfo()
{
return info;
}
}

View File

@@ -0,0 +1,31 @@
package com.vetti.common.enums.command;
/**
* 检修状态
*/
public enum OverhaulStatusEnum {
STATUS_0("0", "未检修"),
STATUS_1("1", "已检修"),
;
private final String code;
private final String info;
OverhaulStatusEnum(String code, String info)
{
this.code = code;
this.info = info;
}
public String getCode()
{
return code;
}
public String getInfo()
{
return info;
}
}

View File

@@ -0,0 +1,32 @@
package com.vetti.common.enums.command;
/**
* 共通状态枚举
*/
public enum StatusEnum {
STATUS_0("0", "停用"),
STATUS_1("1", "启用"),
;
private final String code;
private final String info;
StatusEnum(String code, String info)
{
this.code = code;
this.info = info;
}
public String getCode()
{
return code;
}
public String getInfo()
{
return info;
}
}

View File

@@ -0,0 +1,31 @@
package com.vetti.common.enums.command;
/**
* 用户当前类型
*/
public enum UserNowTypeEnum {
USER_NOW_TYPE_ONE("ONE", "司机未完善"),
USER_NOW_TYPE_TWO("TWO", "车辆未完善"),
USER_NOW_TYPE_THREE("THREE", "全部完善"),
;
private final String code;
private final String info;
UserNowTypeEnum(String code, String info)
{
this.code = code;
this.info = info;
}
public String getCode()
{
return code;
}
public String getInfo()
{
return info;
}
}

View File

@@ -0,0 +1,33 @@
package com.vetti.common.enums.command;
/**
* 车辆类型枚举
*/
public enum VehicleTypesEnum {
PRIME_MOVERS("primeMovers", "Prime Movers"),
B_DOUBLES("bDoubles", "B-Doubles"),
ROAD_TRAINS("roadTrains", "Road Trains"),
RIGID_TRUCKS("rigidTrucks", "Rigid Trucks"),
;
private final String code;
private final String info;
VehicleTypesEnum(String code, String info)
{
this.code = code;
this.info = info;
}
public String getCode()
{
return code;
}
public String getInfo()
{
return info;
}
}

View File

@@ -0,0 +1,34 @@
package com.vetti.common.enums.command;
/**
* 工作状态枚举
*
*/
public enum WorkStatusEnum {
ACTIVE("active", "Active"),
MAINTENANCE("maintenance", "Maintenance"),
IDLE("idle", "Idle"),
LOADING("loading", "Loading"),
;
private final String code;
private final String info;
WorkStatusEnum(String code, String info)
{
this.code = code;
this.info = info;
}
public String getCode()
{
return code;
}
public String getInfo()
{
return info;
}
}

View File

@@ -0,0 +1,29 @@
package com.vetti.common.enums.hereMap;
public enum HereMapAvoidFeatures {
HIGHWAY("controlledAccessHighway", "高速公路"),
TOLLROAD("tollroad", "收费公路"),
FERRY("ferry", "渡轮"),
TUNNEL("tunnel", "隧道"),
DIFFICULT_TURNS("difficultTurns", "掉头"),
DIRT_ROAD("dirtRoad", "土路");
private String code;
private String name;
HereMapAvoidFeatures(String code, String name) {
this.code = code;
this.name = name;
}
public String getCode() {
return code;
}
public String getName() {
return name;
}
}

View File

@@ -0,0 +1,28 @@
package com.vetti.common.enums.hereMap;
public enum HereMapHazmatType {
EXPLOSIVE("explosive","爆炸品"),GAS("gas","气体"),FLAMMABLE("flammable","易燃液体"),
COMBUSTIBLE("combustible","易燃固体"),ORGANIC("organic","有机过氧化物"),POISON("poison","毒性物质"),
RADIOACTIVE("radioactive","放射性物质"),CORROSIVE("corrosive","腐蚀性物质"), POISONOUS_INHALATION("poisonousInhalation","吸入有毒物质"),
HARMFUL_TO_WATER("harmfulToWater","对水环境有害"),OTHER("other","其他危险品");
private String code;
private String name;
HereMapHazmatType(String code, String name) {
this.code = code;
this.name = name;
}
public String getCode() {
return code;
}
public String getName() {
return name;
}
}

View File

@@ -0,0 +1,25 @@
package com.vetti.common.enums.hereMap;
public enum HereMapRoutingMode {
FASTEST("fast", "最快路线"), SHORTEST("short", "最短路线");
private String code;
private String name;
HereMapRoutingMode(String code, String name) {
this.code = code;
this.name = name;
}
public String getCode() {
return code;
}
public String getName() {
return name;
}
}

View File

@@ -0,0 +1,26 @@
package com.vetti.common.enums.hereMap;
public enum HereMapTransportMode {
CAR("car","汽车"),TRUCK("truck","卡车"),PEDESTRIAN("pedestrian","行人"),
SCOOTER("scooter","踏板车"),BICYCLE("bicycle","自行车"),TAXI("taxi","出租车"),
BUS("bus","公交车"),PRIVATEBUS("privateBus","私人巴士");
private String code;
private String name;
HereMapTransportMode(String code, String name) {
this.code = code;
this.name = name;
}
public String getCode() {
return code;
}
public String getName() {
return name;
}
}