generated from root/miduo_server
更新查询用户信息接口
parent
aeb0aba0de
commit
469f44b4e2
|
|
@ -7,6 +7,7 @@ import com.alibaba.fastjson.JSONObject;
|
|||
import com.jmfy.Application;
|
||||
import com.jmfy.dao.MongoConnectDao;
|
||||
import com.jmfy.handler.PayHandler;
|
||||
import com.jmfy.model.CoreUserInfo;
|
||||
import com.jmfy.model.ServerInfo;
|
||||
import com.jmfy.modelVo.PayVo;
|
||||
import com.jmfy.modelVo.PlayerInfoCache;
|
||||
|
|
@ -19,7 +20,6 @@ import com.ljsd.jieling.thrift.idl.itemData;
|
|||
import com.mongodb.BasicDBObject;
|
||||
import com.mongodb.DBCollection;
|
||||
import com.mongodb.DBObject;
|
||||
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.slf4j.Logger;
|
||||
|
|
@ -34,7 +34,6 @@ import org.w3c.dom.NodeList;
|
|||
import org.xml.sax.InputSource;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.crypto.Cipher;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
|
@ -42,13 +41,11 @@ import javax.servlet.http.HttpServletResponse;
|
|||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.InetAddress;
|
||||
|
||||
import java.net.URLEncoder;
|
||||
import java.net.UnknownHostException;
|
||||
import java.security.KeyFactory;
|
||||
|
|
@ -57,7 +54,6 @@ import java.security.Signature;
|
|||
import java.security.spec.X509EncodedKeySpec;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
import static com.jmfy.util.MD5Util.encrypByMd5;
|
||||
import static com.jmfy.util.SdkUtil.getOrderIdByTime;
|
||||
|
||||
|
|
@ -2050,7 +2046,7 @@ public class PayController {
|
|||
MongoTemplate mongoTemplate = mongoConnectDao.getConnect().getMongoTemplete(Application.coreDb);
|
||||
//查询mongo:客户端传的serverId找到合服后的对应的真实的serverId
|
||||
BasicQuery query = new BasicQuery(new BasicDBObject("open_id", String.valueOf(userId)));
|
||||
List<DBObject> list = mongoTemplate.find(query, DBObject.class);
|
||||
List<CoreUserInfo> list = mongoTemplate.find(query, CoreUserInfo.class);
|
||||
if(list == null || list.isEmpty()){
|
||||
json.put("code", 404);
|
||||
json.put("msg", "user not exist");
|
||||
|
|
@ -2060,14 +2056,14 @@ public class PayController {
|
|||
return json.toString();
|
||||
}
|
||||
long loginTime = 0;
|
||||
for(DBObject obj : list){
|
||||
String serverId = obj.get("server_id").toString();
|
||||
for(CoreUserInfo user : list){
|
||||
String serverId = String.valueOf(user.getServerid());
|
||||
BasicQuery serverQuery = new BasicQuery(new BasicDBObject("server_id", serverId));
|
||||
ServerInfo serverInfo = mongoTemplate.findOne(query, ServerInfo.class, "server_info");
|
||||
if(serverInfo == null){
|
||||
continue;
|
||||
}
|
||||
String uid = obj.get("uid").toString();
|
||||
String uid = String.valueOf(user.getUid());
|
||||
PlayerInfoCache cache = RedisUtil.getInstence().getMapValue(RedisUserKey.PLAYER_INFO_CACHE + RedisUserKey.Delimiter_colon, "",uid, PlayerInfoCache.class,-1);
|
||||
if(cache == null){
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Reference in New Issue