技威登录字段新增

This commit is contained in:
易焱 2019-06-20 00:44:09 +08:00
parent 4c6fe78903
commit 29cbed2be0
2 changed files with 71 additions and 24 deletions

View File

@ -13,6 +13,9 @@ public class GwellParamDto {
private String P2PVerifyCode1; private String P2PVerifyCode1;
//code2 //code2
private String P2PVerifyCode2; private String P2PVerifyCode2;
private String sessionID;
private String sessionID2;
//技威userID //技威userID
private String UserID; private String UserID;
@ -30,6 +33,15 @@ public class GwellParamDto {
this.UserID = userID; this.UserID = userID;
} }
public GwellParamDto(String isRegisterGwell, String p2pVerifyCode1,String p2pVerifyCode2, String userID,String sessionID,String sessionID2) {
this.isRegisterGwell = isRegisterGwell;
this.P2PVerifyCode1 = p2pVerifyCode1;
this.P2PVerifyCode2 = p2pVerifyCode2;
this.UserID = userID;
this.sessionID = sessionID;
this.sessionID2 = sessionID2;
}
public String getIsRegisterGwell() { public String getIsRegisterGwell() {
return isRegisterGwell; return isRegisterGwell;
@ -63,4 +75,19 @@ public class GwellParamDto {
UserID = userID; UserID = userID;
} }
public String getSessionID() {
return sessionID;
}
public void setSessionID(String sessionID) {
this.sessionID = sessionID;
}
public String getSessionID2() {
return sessionID2;
}
public void setSessionID2(String sessionID2) {
this.sessionID2 = sessionID2;
}
} }

View File

@ -232,7 +232,7 @@ public class UserServiceImpl implements UserService {
*/ */
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
//用户信息 //用户信息
jsonObject.put("user", getUserInfo(user)); jsonObject.put("user", getUserInfo(user,gwellParam));
//版本号 //版本号
if(ApiVersion.version1_0.equals(loginParam.getVersion())){ if(ApiVersion.version1_0.equals(loginParam.getVersion())){
//用户资产 //用户资产
@ -861,8 +861,6 @@ public class UserServiceImpl implements UserService {
* @return * @return
*/ */
public GwellParamDto getGwellInfo(String isRegisterGwell,String phoneNumber){ public GwellParamDto getGwellInfo(String isRegisterGwell,String phoneNumber){
//未注册技威
if(!BooleanEnum.YES.getKey().equals(isRegisterGwell)){
//注册技威 //注册技威
Map<String,String> registerMap = GwellApi.Register(phoneNumber); Map<String,String> registerMap = GwellApi.Register(phoneNumber);
String registerResult = registerMap.get("result"); String registerResult = registerMap.get("result");
@ -878,14 +876,13 @@ public class UserServiceImpl implements UserService {
String loginResult = loginMap.get("result"); String loginResult = loginMap.get("result");
//登陆成功 //登陆成功
if(GwellEnum.success.getKey().equals(loginResult)){ if(GwellEnum.success.getKey().equals(loginResult)){
return new GwellParamDto(BooleanEnum.YES.getKey(),loginMap.get("P2PVerifyCode1"),loginMap.get("P2PVerifyCode2"),loginMap.get("UserID")); return new GwellParamDto(BooleanEnum.YES.getKey(),loginMap.get("P2PVerifyCode1"),loginMap.get("P2PVerifyCode2"),loginMap.get("UserID"),loginMap.get("SessionID"),loginMap.get("SessionID2"));
} }
else{ else{
return new GwellParamDto(BooleanEnum.YES.getKey()); return new GwellParamDto(BooleanEnum.YES.getKey());
} }
} }
} }
}
return null; return null;
} }
@ -961,6 +958,30 @@ public class UserServiceImpl implements UserService {
json.put("shopsUserId", user.getShopsUserId()); json.put("shopsUserId", user.getShopsUserId());
return json; return json;
} }
/**
* 封装用户信息
* @param user
* @return
*/
public JSONObject getUserInfo(User user,GwellParamDto gwellParam){
JSONObject json = new JSONObject();
json.put("userId", user.getUserId());
json.put("phoneNumber", user.getPhoneNumber());
json.put("nickName", user.getNickName());
json.put("userSex", user.getUserSex());
json.put("signature", user.getSignature());
json.put("userImg", user.getUserImg());
json.put("P2PVerifyCode1", user.getP2PVerifyCode1());
json.put("P2PVerifyCode2", user.getP2PVerifyCode2());
json.put("sessionID", gwellParam != null ? gwellParam.getSessionID() : "");
json.put("sessionID2", gwellParam != null ? gwellParam.getSessionID2() : "");
json.put("gwellUserID", user.getGwellUserID());
json.put("neteaseToken", user.getNeteaseToken());
json.put("userType", user.getUserType());
json.put("shopsUserId", user.getShopsUserId());
return json;
}
/** /**
* 封装用户信息 * 封装用户信息
* @param user * @param user
@ -1061,7 +1082,6 @@ public class UserServiceImpl implements UserService {
/** /**
* 封装商家认证信息 * 封装商家认证信息
* @param shopsInfo
* @param userImg * @param userImg
* @return * @return
*/ */