略优化一点
This commit is contained in:
parent
5a0583a054
commit
57944609e7
@ -4,6 +4,7 @@ import javax.servlet.http.HttpServletRequest;
|
|||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@ -95,4 +96,47 @@ public class ContextInfo {
|
|||||||
//TODO: 这两天也看一下,是否直接从map转过去就够了,是不是还要再补一些其他的东西进去。
|
//TODO: 这两天也看一下,是否直接从map转过去就够了,是不是还要再补一些其他的东西进去。
|
||||||
return BeanUtil.toBean(this.userInfoMap.getMap(), clazz);
|
return BeanUtil.toBean(this.userInfoMap.getMap(), clazz);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Builder
|
||||||
|
@Data
|
||||||
|
public static class LiteSaasContext {
|
||||||
|
private Long workspaceId;
|
||||||
|
private Integer workspaceType;
|
||||||
|
|
||||||
|
private Long identityId;
|
||||||
|
private Integer identityType;
|
||||||
|
private Long acntId;
|
||||||
|
private Long personId;
|
||||||
|
|
||||||
|
private Long ouId;
|
||||||
|
private Integer ouType;
|
||||||
|
|
||||||
|
private Long saasTennantId;
|
||||||
|
|
||||||
|
private String terminal;
|
||||||
|
private String ipAddress; //for log
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 这个小DTO是为了方便传参。
|
||||||
|
* 主要是用在写方法上,这些方法需要记录完整操作日志。
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public LiteSaasContext lite() {
|
||||||
|
return LiteSaasContext.builder()
|
||||||
|
.workspaceId(this.workspaceId)
|
||||||
|
.workspaceType(this.workspaceType)
|
||||||
|
.identityId(this.getUserInfo().getIdentityId())
|
||||||
|
.identityType(this.getUserInfo().getIdentityType())
|
||||||
|
.personId(this.getUserInfo().getPersonId())
|
||||||
|
.acntId(this.getUserInfo().getAcntId())
|
||||||
|
.ouId(this.ouId)
|
||||||
|
.ouType(this.ouType)
|
||||||
|
.saasTennantId(this.saasTenantId)
|
||||||
|
.terminal(this.terminalInfo.NT())
|
||||||
|
.ipAddress(this.systemAndDeviceInfo.getIpAddress())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -95,13 +95,13 @@ public class TerminalInfo {
|
|||||||
public static final String STR_TERMINAL_PROJ = "proj";
|
public static final String STR_TERMINAL_PROJ = "proj";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 智能面板
|
* 智能面板 ???
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public static final String STR_TERMINAL_SM = "sm";
|
public static final String STR_TERMINAL_SM = "sm";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 智能面板
|
* 智能面板 ???
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public static final String STR_TERMINAL_SMP = "smp";
|
public static final String STR_TERMINAL_SMP = "smp";
|
||||||
@ -412,9 +412,7 @@ public class TerminalInfo {
|
|||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*
|
*
|
||||||
* @deprecated 只用来做历史代码兼容
|
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
|
||||||
public boolean isCMS() {
|
public boolean isCMS() {
|
||||||
if (this.newTerminalString == null)
|
if (this.newTerminalString == null)
|
||||||
return false;
|
return false;
|
||||||
@ -425,9 +423,7 @@ public class TerminalInfo {
|
|||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*
|
*
|
||||||
* @deprecated 只用来做历史代码兼容
|
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
|
||||||
public boolean isCMP() {
|
public boolean isCMP() {
|
||||||
if (this.newTerminalString == null)
|
if (this.newTerminalString == null)
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -12,22 +12,28 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
public class UserInfo {
|
public class UserInfo {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 账号ID,从原axzoId迁移过来的
|
* 自然人ID,从原axzoId迁移过来的,每个自然人有一个ID,后续这里的ID会被治理,不会和原axzoId一一对应。
|
||||||
*/
|
|
||||||
private Long acntId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 自然人ID,从原axzoId迁移过来的
|
|
||||||
*/
|
*/
|
||||||
private Long personId;
|
private Long personId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 身份ID,以后大家最常用的ID
|
* 身份ID,以后大家最常用的ID,用于各种具体的业务场景。
|
||||||
*/
|
*/
|
||||||
private Long identityId;
|
private Long identityId;
|
||||||
|
|
||||||
private Integer identityType;
|
private Integer identityType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 账号ID,从原axzoId迁移过来的,是用来登录、发消息、发手机短信等使用的账号。
|
||||||
|
*/
|
||||||
|
private Long acntId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号,是从账号表里取到的,用户登录、短信验证、消息推送都是这个phone
|
||||||
|
*/
|
||||||
|
private String phoneNumber;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 性别:0:未知;1-女;2-男
|
* 性别:0:未知;1-女;2-男
|
||||||
*/
|
*/
|
||||||
@ -59,11 +65,6 @@ public class UserInfo {
|
|||||||
*/
|
*/
|
||||||
private String avatarUrl;
|
private String avatarUrl;
|
||||||
|
|
||||||
/**
|
|
||||||
* 手机号
|
|
||||||
*/
|
|
||||||
private String phoneNumber;
|
|
||||||
|
|
||||||
///////
|
///////
|
||||||
/// 以下字段,不推荐使用,对历史进行兼容
|
/// 以下字段,不推荐使用,对历史进行兼容
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user