package com.doumee.core.constants; import lombok.AllArgsConstructor; import lombok.Getter; import java.util.*; /** * 框架级常量 * @author dm * @since 2025/03/31 16:44 */ public class Constants { public static final String FTP ="FTP" ; public static final String FTP_HOST ="FTP_HOST" ; public static final String FTP_PORT ="FTP_PORT" ; public static final String FTP_USERNAME ="FTP_USERNAME" ; public static final String FTP_PWD ="FTP_PWD" ; public static final String FTP_RESOURCE_PATH ="FTP_RESOURCE_PATH" ; public static final String FTP_LOCAL_RESOURCE_PATH ="FTP_LOCAL_RESOURCE_PATH" ; public static final String QYWX_CORPID = "QYWX_CORPID"; public static final String QYWX_SECRET = "QYWX_SECRET"; public static final String QYWX_TOKEN = "QYWX_TOKEN"; public static final String QYWX = "QYWX"; public static final Integer ONE = 1; public static final Integer TWO = 2; public static final Integer ZERO = 0; public static boolean DEALING_COMPANY_SYNC = false ; public static boolean DEALING_MEMBER_SYNC = false ; /** * 缓存Key */ interface CacheKey { } /** * 操作类型,用于做接口验证分组 */ public interface OperaType { /** * 创建 */ interface Create {} /** * 修改 */ interface Update {} /** * 修改状态 */ interface UpdateStatus {} } public static boolean equalsInteger(Integer a, Integer b) { if (formatIntegerNum(a) == formatIntegerNum(b)) { return true; } return false; } public static int formatIntegerNum(Integer d) { if (d == null) { d = 0; } return d.intValue(); } public static long formatLongNum(Long d) { if (d == null) { d = 0L; } return d.longValue(); } /** * Job常量 */ public interface Job { // jobId在JOB实例中的存储参数键 String JOB_DATA_MAP_JOB_ID = "JOB_ID"; /** * JOB状态 */ @Getter @AllArgsConstructor enum JobStatus { PAUSE( -1, "暂停"), READY( 0, "已准备"), RUNNING( 1, "运行中"), ; private int code; private String remark; } /** * 分片状态 */ @Getter @AllArgsConstructor enum SnippetStatus { READY((int) 0, "已准备"), RUNNING((int) 1, "运行中"), SUCCESS((int) 2, "执行成功"), FAILED((int) -2, "执行失败"), ; private int code; private String remark; } /** * 分片状态 */ @Getter @AllArgsConstructor enum LogStatus { FAILED((int) 0, "执行失败"), SUCCESS((int) 1, "执行成功"), IGNORE((int) 2, "跳过"), NONE((int) -1, "执行中"), ; private int code; private String remark; } /** * 触发类型 */ @Getter @AllArgsConstructor enum TriggerType { SYSTEM("SYSTEM", "系统"), MANUAL("MANUAL", "手动"), ; private String code; private String remark; } } /** * 跟踪日志异常等级 */ @Getter @AllArgsConstructor public enum ExceptionLevel { DANGER((int)10, "高"), WARN((int)5, "中"), LOW((int)0, "低"), ; private int level; private String remark; } /** * MyBatis自动注入忽略 */ public interface Ignore { /** * 忽略时间,当不需要更新createTime/updateTime时,可使用该常量进行填充。 */ Date IGNORE_TIME = new IgnoreDate(); /** * 忽略用户,当不需要更新createUser/updateUser时,可使用该常量进行填充。 */ Integer IGNORE_USER = -1; /** * 忽略时间类 */ class IgnoreDate extends Date {} } }