service common
This commit is contained in:
@@ -4,7 +4,7 @@ package org.xyzh.common.core.constant;
|
||||
* @description Constants.java文件描述
|
||||
* @filename Constants.java
|
||||
* @author yslg
|
||||
* @copyright yslg
|
||||
* @copyright xyzh
|
||||
* @since 2025-09-07
|
||||
*/
|
||||
public class Constants {
|
||||
|
||||
@@ -1,5 +1,273 @@
|
||||
package org.xyzh.common.core.domain;
|
||||
|
||||
public class LoginDomain {
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import org.xyzh.common.dto.user.TbSysUser;
|
||||
import org.xyzh.common.dto.user.TbSysUserInfo;
|
||||
import org.xyzh.common.dto.role.TbSysRole;
|
||||
import org.xyzh.common.dto.permission.TbSysPermission;
|
||||
import org.xyzh.common.dto.dept.TbSysDeptRole;
|
||||
import org.xyzh.common.dto.menu.TbSysMenu;
|
||||
|
||||
/**
|
||||
* @description LoginDomain.java文件描述 登录域对象
|
||||
* @filename LoginDomain.java
|
||||
* @author yslg
|
||||
* @copyright xyzh
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public class LoginDomain implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* @description 用户信息
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
private TbSysUser user;
|
||||
|
||||
/**
|
||||
* @description 用户详细信息
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
private TbSysUserInfo userInfo;
|
||||
|
||||
/**
|
||||
* @description 用户角色列表
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
private List<TbSysDeptRole> roles;
|
||||
|
||||
/**
|
||||
* @description 用户权限列表
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
private List<TbSysPermission> permissions;
|
||||
|
||||
/**
|
||||
* @description 用户菜单列表
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
private List<TbSysMenu> menus;
|
||||
|
||||
/**
|
||||
* @description JWT令牌
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
private String token;
|
||||
|
||||
/**
|
||||
* @description 令牌过期时间
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
private Date tokenExpireTime;
|
||||
|
||||
/**
|
||||
* @description 登录时间
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
private Date loginTime;
|
||||
|
||||
/**
|
||||
* @description 登录IP地址
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
private String ipAddress;
|
||||
|
||||
/**
|
||||
* @description 登录类型 (email/username/phone/wechat)
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
private String loginType;
|
||||
|
||||
/**
|
||||
* @description 获取用户
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public TbSysUser getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 设置用户
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public void setUser(TbSysUser user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 获取用户详细信息
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public TbSysUserInfo getUserInfo() {
|
||||
return userInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 设置用户详细信息
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public void setUserInfo(TbSysUserInfo userInfo) {
|
||||
this.userInfo = userInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 获取用户角色列表
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public List<TbSysDeptRole> getRoles() {
|
||||
return roles;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 设置用户角色列表
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public void setRoles(List<TbSysDeptRole> roles) {
|
||||
this.roles = roles;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 获取用户权限列表
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public List<TbSysPermission> getPermissions() {
|
||||
return permissions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 设置用户权限列表
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public void setPermissions(List<TbSysPermission> permissions) {
|
||||
this.permissions = permissions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 获取用户菜单列表
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public List<TbSysMenu> getMenus() {
|
||||
return menus;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 设置用户菜单列表
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public void setMenus(List<TbSysMenu> menus) {
|
||||
this.menus = menus;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 获取JWT令牌
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public String getToken() {
|
||||
return token;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 设置JWT令牌
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public void setToken(String token) {
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 获取令牌过期时间
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public Date getTokenExpireTime() {
|
||||
return tokenExpireTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 设置令牌过期时间
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public void setTokenExpireTime(Date tokenExpireTime) {
|
||||
this.tokenExpireTime = tokenExpireTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 获取登录时间
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public Date getLoginTime() {
|
||||
return loginTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 设置登录时间
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public void setLoginTime(Date loginTime) {
|
||||
this.loginTime = loginTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 获取登录IP地址
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public String getIpAddress() {
|
||||
return ipAddress;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 设置登录IP地址
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public void setIpAddress(String ipAddress) {
|
||||
this.ipAddress = ipAddress;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 获取登录类型
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public String getLoginType() {
|
||||
return loginType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 设置登录类型
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public void setLoginType(String loginType) {
|
||||
this.loginType = loginType;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,6 +16,27 @@ public class LoginParam {
|
||||
*/
|
||||
private String email;
|
||||
|
||||
/**
|
||||
* @description 用户名
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* @description 手机号
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* @description 微信ID
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
private String wechatID;
|
||||
|
||||
/**
|
||||
* @description 密码
|
||||
* @author yslg
|
||||
@@ -23,20 +44,168 @@ public class LoginParam {
|
||||
*/
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* @description 验证码
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
private String captcha;
|
||||
|
||||
/**
|
||||
* @description 登录类型 (email/username/phone/wechat)
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
private String loginType;
|
||||
|
||||
/**
|
||||
* @description 记住我
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
private boolean rememberMe;
|
||||
|
||||
/**
|
||||
* @description 获取邮箱
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 设置邮箱
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 获取用户名
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 设置用户名
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 获取手机号
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 设置手机号
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 获取微信ID
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public String getWechatID() {
|
||||
return wechatID;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 设置微信ID
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public void setWechatID(String wechatID) {
|
||||
this.wechatID = wechatID;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 获取密码
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 设置密码
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @description 获取验证码
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public String getCaptcha() {
|
||||
return captcha;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 设置验证码
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public void setCaptcha(String captcha) {
|
||||
this.captcha = captcha;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 获取登录类型
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public String getLoginType() {
|
||||
return loginType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 设置登录类型
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public void setLoginType(String loginType) {
|
||||
this.loginType = loginType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 获取记住我
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public boolean isRememberMe() {
|
||||
return rememberMe;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 设置记住我
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public void setRememberMe(boolean rememberMe) {
|
||||
this.rememberMe = rememberMe;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import org.xyzh.common.core.page.PageParam;
|
||||
* @description ResultDomain.java文件描述 统一返回结果实体类
|
||||
* @filename ResultDomain.java
|
||||
* @author yslg
|
||||
* @copyright yslg
|
||||
* @copyright xyzh
|
||||
* @since 2025-09-07
|
||||
*/
|
||||
public class ResultDomain<T> implements Serializable{
|
||||
|
||||
@@ -6,7 +6,7 @@ import java.io.Serializable;
|
||||
* @description BaseEntity.java文件描述 基础实体类
|
||||
* @filename BaseEntity.java
|
||||
* @author yslg
|
||||
* @copyright yslg
|
||||
* @copyright xyzh
|
||||
* @since 2025-09-07
|
||||
*/
|
||||
public class BaseEntity implements Serializable {
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.xyzh.common.core.enums.DataStatus;
|
||||
* @description DataEntity.java文件描述 数据实体类
|
||||
* @filename DataEntity.java
|
||||
* @author yslg
|
||||
* @copyright yslg
|
||||
* @copyright xyzh
|
||||
* @since 2025-09-07
|
||||
*/
|
||||
public class DataEntity<T> extends BaseEntity {
|
||||
|
||||
@@ -4,7 +4,7 @@ package org.xyzh.common.core.enums;
|
||||
* @description DataStatus枚举类 数据状态枚举类
|
||||
* @filename DataStatus.java
|
||||
* @author yslg
|
||||
* @copyright yslg
|
||||
* @copyright xyzh
|
||||
* @since 2025-09-07
|
||||
*/
|
||||
public enum DataStatus {
|
||||
|
||||
@@ -1,5 +1,73 @@
|
||||
package org.xyzh.common.core.enums;
|
||||
|
||||
/**
|
||||
* @description UserStatus枚举类 用户状态枚举类
|
||||
* @filename UserStatus.java
|
||||
* @author yslg
|
||||
* @copyright xyzh
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public enum UserStatus {
|
||||
|
||||
NORMAL("0", "正常", "用户状态正常"),
|
||||
DISABLED("1", "禁用", "用户被禁用"),
|
||||
LOCKED("2", "锁定", "用户被锁定"),
|
||||
EXPIRED("3", "过期", "用户已过期"),
|
||||
PENDING("4", "待激活", "用户待激活");
|
||||
|
||||
private final String code;
|
||||
private final String name;
|
||||
private final String description;
|
||||
|
||||
UserStatus(String code, String name, String description) {
|
||||
this.code = code;
|
||||
this.name = name;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 获取枚举值
|
||||
* @return String 枚举值
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 获取枚举名称
|
||||
* @return String 枚举名称
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 获取枚举描述
|
||||
* @return String 枚举描述
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 根据code获取枚举
|
||||
* @param code 状态码
|
||||
* @return UserStatus 用户状态枚举
|
||||
* @author yslg
|
||||
* @since 2025-09-28
|
||||
*/
|
||||
public static UserStatus fromCode(String code) {
|
||||
for (UserStatus status : UserStatus.values()) {
|
||||
if (status.getCode().equals(code)) {
|
||||
return status;
|
||||
}
|
||||
}
|
||||
return NORMAL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import java.util.List;
|
||||
* @description PageDomain.java文件描述 分页数据实体类
|
||||
* @filename PageDomain.java
|
||||
* @author yslg
|
||||
* @copyright yslg
|
||||
* @copyright xyzh
|
||||
* @since 2025-09-07
|
||||
*/
|
||||
public class PageDomain<T> implements Serializable{
|
||||
|
||||
@@ -6,7 +6,7 @@ import java.io.Serializable;
|
||||
* @description PageParam.java文件描述 分页参数
|
||||
* @filename PageParam.java
|
||||
* @author yslg
|
||||
* @copyright yslg
|
||||
* @copyright xyzh
|
||||
* @since 2025-09-07
|
||||
*/
|
||||
public class PageParam implements Serializable {
|
||||
|
||||
Reference in New Issue
Block a user