generated from root/miduo_server
fix
parent
496da0a54d
commit
630968b0de
|
@ -31,7 +31,7 @@ public class Application {
|
|||
//redis初始化
|
||||
RedisAutoConfiguration redisAutoConfiguration = configurableApplicationContext.getBean(RedisAutoConfiguration.class);
|
||||
RedisUtil.getInstence().init(redisAutoConfiguration.getRedisProperties());
|
||||
JsonUtil.getInstence().initServerIPandProt();
|
||||
// JsonUtil.getInstence().initServerIPandProt();
|
||||
// Map<String, BaseHandler> commandHanderMap = configurableApplicationContext.getBeansOfType(BaseHandler.class);
|
||||
// for (BaseHandler handler : commandHanderMap.values()){
|
||||
// handlerManager.addHandler(handler);
|
||||
|
|
|
@ -12,7 +12,6 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import sun.security.provider.MD5;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
|
|
@ -2,7 +2,6 @@ package com.jmfy.controller;
|
|||
|
||||
import com.jmfy.dto.*;
|
||||
import com.jmfy.thrift.idl.RPCRequestIFace;
|
||||
import com.jmfy.thrift.idl.Result;
|
||||
import com.jmfy.thrift.pool.ClientAdapterPo;
|
||||
import com.jmfy.thrift.pool.ServiceKey;
|
||||
import com.jmfy.util.JsonUtil;
|
||||
|
@ -15,11 +14,8 @@ import org.springframework.web.bind.annotation.RestController;
|
|||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
public class SendMailController {
|
||||
|
|
|
@ -7,14 +7,12 @@ import com.jmfy.util.YsjConstant;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -49,7 +47,7 @@ public class UserController {
|
|||
}
|
||||
|
||||
public static void main (String [] args){
|
||||
String s = MD5Util.encrypByMd5(YsjConstant.TW_GameKey + "111111" + 10212);
|
||||
String s = MD5Util.encrypByMd5(YsjConstant.TW_GameKey + "9000709253" + 10074);
|
||||
System.out.println(s);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ public class CUserDaoImpl implements CUserDao {
|
|||
}
|
||||
|
||||
@Override
|
||||
public CUserInfo getUserInfobyNameAndServerId(String name, int serverId) throws Exception {
|
||||
public CUserInfo getUserInfobyNameAndServerId(String name, int serverId) throws Exception {
|
||||
Query query = new Query();
|
||||
Criteria cr = new Criteria();
|
||||
MongoTemplate mongoTemplate = connect.getMongoTemplete("ysj_core");
|
||||
|
|
|
@ -80,14 +80,14 @@ public class JsonUtil {
|
|||
return dayBefore;
|
||||
}
|
||||
|
||||
public void initServerIPandProt() {
|
||||
InetAddress ia=null;
|
||||
try {
|
||||
ia=ia.getLocalHost();
|
||||
String deliveryAddress = ia.getHostAddress() +":"+9991;
|
||||
RedisUtil.getInstence().putMapEntry(RedisUserKey.IP_AND_PROT_MAP, String.valueOf(9991),deliveryAddress,3,-1);
|
||||
} catch (UnknownHostException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
// public void initServerIPandProt() {
|
||||
// InetAddress ia=null;
|
||||
// try {
|
||||
// ia=ia.getLocalHost();
|
||||
// String deliveryAddress = ia.getHostAddress() +":"+9991;
|
||||
// RedisUtil.getInstence().putMapEntry(RedisUserKey.IP_AND_PROT_MAP, String.valueOf(9991),deliveryAddress,3,-1);
|
||||
// } catch (UnknownHostException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
|
|
@ -4,9 +4,9 @@ server.port=9991
|
|||
server.context-path=/delivery
|
||||
|
||||
# redis config
|
||||
spring.redis.host = 60.1.1.14
|
||||
spring.redis.host = 150.116.94.74
|
||||
spring.redis.port = 6379
|
||||
spring.redis.password =
|
||||
spring.redis.password = redis.ljsd.COM@
|
||||
spring.redis.expireTime = -1
|
||||
|
||||
spring.data.mongodb.uri = mongodb://60.1.1.14:27017/ysj_core
|
||||
|
|
Loading…
Reference in New Issue