Commit 22b90e6a by zhangxingmin

push

parent a50e6eba
......@@ -127,6 +127,7 @@ public class ApiCoSessionServiceImpl implements ApiCoSessionService {
// 获取 Token(调用 /user/generate/token)
String token = null;
GenerateTokenResponse tokenResp =null;
try {
// 构建请求体
GenerateTokenRequest tokenRequest = new GenerateTokenRequest();
......@@ -159,7 +160,7 @@ public class ApiCoSessionServiceImpl implements ApiCoSessionService {
// 或者直接使用 fastjson 转换
Object data = body.getData();
if (data != null) {
GenerateTokenResponse tokenResp = JSONObject.parseObject(JSONObject.toJSONString(data), GenerateTokenResponse.class);
tokenResp = JSONObject.parseObject(JSONObject.toJSONString(data), GenerateTokenResponse.class);
token = tokenResp.getToken();
}
}
......@@ -178,6 +179,10 @@ public class ApiCoSessionServiceImpl implements ApiCoSessionService {
// 存入 Redis
RoomRedisInfoDTO roomRedisInfoDTO = new RoomRedisInfoDTO();
if (tokenResp != null) {
roomRedisInfoDTO.setName(tokenResp.getName());
roomRedisInfoDTO.setMobile(tokenResp.getMobile());
}
roomRedisInfoDTO.setToken(token); // 设置 token
roomRedisInfoDTO.setUserId(userId);
roomRedisInfoDTO.setControlHolderType(session.getControlHolderType());
......@@ -343,6 +348,8 @@ public class ApiCoSessionServiceImpl implements ApiCoSessionService {
}
joinResponse.setUserId(roomRedisInfoDTO.getUserId());
joinResponse.setToken(roomRedisInfoDTO.getToken());
joinResponse.setName(roomRedisInfoDTO.getName());
joinResponse.setMobile(roomRedisInfoDTO.getMobile());
log.info("【加入会话】成功, roomId={}, participantId={}, controlHolderType={}",
session.getRoomId(), session.getParticipantId(), session.getControlHolderType());
......
......@@ -41,4 +41,14 @@ public class RoomRedisInfoDTO implements Serializable {
* 资源所有者的登录token信息
*/
private String token;
/**
* 姓名
*/
private String name;
/**
* 手机号
*/
private String mobile;
}
......@@ -47,4 +47,14 @@ public class JoinResponse {
* 资源所有者的登录token信息
*/
private String token;
/**
* 姓名
*/
private String name;
/**
* 手机号
*/
private String mobile;
}
\ No newline at end of file
......@@ -6,17 +6,27 @@ import lombok.Data;
public class GenerateTokenResponse {
/**
* token
* SFP的token
*/
private String token;
/**
* 商城用户ID
* SFP商城用户ID
*/
private Long sfpUserId;
/**
* 分销用户ID
* SFP姓名
*/
private String name;
/**
* SFP手机号
*/
private String mobile;
/**
* CFFP分销用户ID
*/
private Long cffpUserId;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment