diff --git a/RollCallServer/src/main/java/cc/aspark/constant/MessageConstant.java b/RollCallServer/src/main/java/cc/aspark/constant/MessageConstant.java new file mode 100644 index 0000000..6acf6a3 --- /dev/null +++ b/RollCallServer/src/main/java/cc/aspark/constant/MessageConstant.java @@ -0,0 +1,13 @@ +package cc.aspark.constant; + +public class MessageConstant { + + public static final String PASSWORD_ERROR = "密码错误"; + public static final String ACCOUNT_NOT_FOUND = "账号不存在"; + public static final String UNKNOWN_ERROR = "未知错误"; + public static final String USER_NOT_LOGIN = "用户未登录"; + public static final String LOGIN_FAILED = "登录失败"; + public static final String DELETE_FAILED = "删除失败"; + public static final String INVALID_INPUT = "输入无效"; + +} \ No newline at end of file diff --git a/RollCallServer/src/main/java/cc/aspark/context/BaseContext.java b/RollCallServer/src/main/java/cc/aspark/context/BaseContext.java new file mode 100644 index 0000000..368503e --- /dev/null +++ b/RollCallServer/src/main/java/cc/aspark/context/BaseContext.java @@ -0,0 +1,19 @@ +package cc.aspark.context; + +public class BaseContext { + + public static ThreadLocal threadLocal = new ThreadLocal<>(); + + public static void setCurrentId(Long id) { + threadLocal.set(id); + } + + public static Long getCurrentId() { + return threadLocal.get(); + } + + public static void removeCurrentId() { + threadLocal.remove(); + } + +} diff --git a/RollCallServer/src/main/java/cc/aspark/properties/JwtProperties.java b/RollCallServer/src/main/java/cc/aspark/properties/JwtProperties.java new file mode 100644 index 0000000..664cd60 --- /dev/null +++ b/RollCallServer/src/main/java/cc/aspark/properties/JwtProperties.java @@ -0,0 +1,19 @@ +package cc.aspark.properties; + +import lombok.Data; +import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.stereotype.Component; + +@Component +@ConfigurationProperties(prefix = "jwt") +@Data +public class JwtProperties { + + /** + * 管理端员工生成jwt令牌相关配置 + */ + private String secretKey; + private long ttl; + private String tokenName; + +}