修改获取redis的方法,默认从2号库获取序列
This commit is contained in:
@@ -64,7 +64,7 @@ public class ConfigSourcesController extends BaseRestController {
|
||||
if (type == 1) {
|
||||
Map<String, String> map = new HashMap<String, String>();
|
||||
Integer service = 98;
|
||||
long id = configRedisService.getIncrId("seq_compileid", service);
|
||||
long id = configRedisService.getIncrId("seq_compileid");
|
||||
// int id=2;
|
||||
map.put("cfg_id", id + "");
|
||||
map.put("is_valid", "1");
|
||||
@@ -80,7 +80,7 @@ public class ConfigSourcesController extends BaseRestController {
|
||||
Integer service = 100;
|
||||
|
||||
Map<String, String> map = new HashMap<String, String>();
|
||||
long id = configRedisService.getIncrId("seq_compileid", service);
|
||||
long id = configRedisService.getIncrId("seq_compileid");
|
||||
// int id=2;
|
||||
map.put("cfg_id", id + "");
|
||||
map.put("is_valid", "1");
|
||||
@@ -118,9 +118,9 @@ public class ConfigSourcesController extends BaseRestController {
|
||||
public MaatConfig getMaatConfig(Integer service) {
|
||||
String time = new Date().getTime() + "";
|
||||
Map<String, String> configMap = new HashMap<String, String>();
|
||||
long seq_compileid = configRedisService.getIncrId("SEQ_COMPILEID", service);
|
||||
long seq_groupid = configRedisService.getIncrId("SEQ_GROUPID", service);
|
||||
long seq_regionid = configRedisService.getIncrId("SEQ_REGIONID", service);
|
||||
long seq_compileid = configRedisService.getIncrId("SEQ_COMPILEID");
|
||||
long seq_groupid = configRedisService.getIncrId("SEQ_GROUPID");
|
||||
long seq_regionid = configRedisService.getIncrId("SEQ_REGIONID");
|
||||
// int id=2;
|
||||
configMap.put("cfg_id", seq_compileid + "");
|
||||
configMap.put("service", service + "");
|
||||
|
||||
@@ -34,5 +34,5 @@ public interface ConfigRedisService {
|
||||
* @param key 需要自增的key
|
||||
* @return
|
||||
*/
|
||||
public Long getIncrId(String key, int service);
|
||||
public Long getIncrId(String key);
|
||||
}
|
||||
|
||||
@@ -289,8 +289,8 @@ public class ConfigRedisServiceimpl extends BaseRedisDao<String, String> impleme
|
||||
}
|
||||
}
|
||||
|
||||
public Long getIncrId(String key, int service) {
|
||||
DynamicJedisDataBase.setRedisDataBase(getRedisDBByService(service), redisTemplate);
|
||||
public Long getIncrId(String key) {
|
||||
//DynamicJedisDataBase.setRedisDataBase(getRedisDBByService(service), redisTemplate);
|
||||
// RedisAtomicLong atomicLong = new RedisAtomicLong(key,
|
||||
// redisTemplate.getConnectionFactory());
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user