1:修改maat和非maat类配置下发为多数据源下发
2:修改servicetable.properties 3:添加配置下发模块
This commit is contained in:
@@ -20,7 +20,7 @@ public class DynamicJedisDataBase {
|
||||
* @param index
|
||||
* @param redisTemplate
|
||||
*/
|
||||
public static void setRedisDataBase1(int index, RedisTemplate redisTemplate) {
|
||||
public static void setRedisDataBase(int index, RedisTemplate redisTemplate) {
|
||||
JedisConnectionFactory connectionFactory = SpringContextHolder.getBean("connectionFactory"+index);
|
||||
connectionFactory.setDatabase(index);
|
||||
redisTemplate.setConnectionFactory(connectionFactory);
|
||||
|
||||
@@ -47,11 +47,11 @@ public class ConfigCompile implements Serializable {
|
||||
@ApiModelProperty(value = "保障期", required = false)
|
||||
private Integer guaranteeId;
|
||||
@ApiModelProperty(value = "事件", required = false)
|
||||
private Integer affAirId;
|
||||
private Integer affairId;
|
||||
@ApiModelProperty(value = "子话题", required = false)
|
||||
private Integer topIcId;
|
||||
private Integer topicId;
|
||||
@ApiModelProperty(value = "是否黑名单", required = true)
|
||||
private Long doBlackList;
|
||||
private Long doBlacklist;
|
||||
@ApiModelProperty(value = "是否生成日志", required = true)
|
||||
private Integer doLog;
|
||||
@ApiModelProperty(value = "生效范围", required = true)
|
||||
@@ -180,16 +180,16 @@ public class ConfigCompile implements Serializable {
|
||||
/**
|
||||
* @return doBlackList
|
||||
*/
|
||||
public Long getDoBlackList() {
|
||||
return doBlackList;
|
||||
public Long getDoBlacklist() {
|
||||
return doBlacklist;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param doBlackList
|
||||
* 要设置的 doBlackList
|
||||
*/
|
||||
public void setDoBlackList(Long doBlackList) {
|
||||
this.doBlackList = doBlackList;
|
||||
public void setDoBlacklist(Long doBlacklist) {
|
||||
this.doBlacklist = doBlacklist;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -445,20 +445,20 @@ public class ConfigCompile implements Serializable {
|
||||
this.guaranteeId = guaranteeId;
|
||||
}
|
||||
|
||||
public Integer getAffAirId() {
|
||||
return affAirId;
|
||||
public Integer getAffairId() {
|
||||
return affairId;
|
||||
}
|
||||
|
||||
public void setAffAirId(Integer affAirId) {
|
||||
this.affAirId = affAirId;
|
||||
public void setAffairId(Integer affairId) {
|
||||
this.affairId = affairId;
|
||||
}
|
||||
|
||||
public Integer getTopIcId() {
|
||||
return topIcId;
|
||||
public Integer getTopicId() {
|
||||
return topicId;
|
||||
}
|
||||
|
||||
public void setTopIcId(Integer topIcId) {
|
||||
this.topIcId = topIcId;
|
||||
public void setTopicId(Integer topicId) {
|
||||
this.topicId = topicId;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
|
||||
56
src/main/java/com/nis/util/CamelUnderlineUtil.java
Normal file
56
src/main/java/com/nis/util/CamelUnderlineUtil.java
Normal file
@@ -0,0 +1,56 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package com.nis.util;
|
||||
|
||||
/**
|
||||
* @ClassName:CamelUnderlineUtil
|
||||
* @Description:TODO(这里用一句话描述这个类的作用)
|
||||
* @author (zdx)
|
||||
* @date 2018年5月25日 下午4:44:54
|
||||
* @version V1.0
|
||||
*/
|
||||
public class CamelUnderlineUtil {
|
||||
|
||||
private static final char UNDERLINE ='_';
|
||||
public static String camelToUnderline(String param) {
|
||||
|
||||
if (StringUtil.isEmpty(param)) {
|
||||
|
||||
return "";
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
int len = param.length();
|
||||
for (int i = 0; i < len; i++) {
|
||||
char c = param.charAt(i);
|
||||
if (Character.isUpperCase(c)) {
|
||||
sb.append(UNDERLINE);
|
||||
sb.append(Character.toLowerCase(c));
|
||||
} else {
|
||||
sb.append(c);
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public static String underlineToCamel(String param){
|
||||
|
||||
if (StringUtil.isEmpty(param)) {
|
||||
|
||||
return "";
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
int len = param.length();
|
||||
for (int i = 0; i < len; i++) {
|
||||
char c = param.charAt(i);
|
||||
if (c==UNDERLINE) {
|
||||
if(++i<len){
|
||||
sb.append(Character.toUpperCase(param.charAt(i)));
|
||||
}
|
||||
} else {
|
||||
sb.append(c);
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
@@ -447,8 +447,8 @@ public class CompileJudge {
|
||||
if (null == configCompile.getAction()) {
|
||||
return "id为" + compileId + "的编译配置中action不能为空";
|
||||
}
|
||||
if (null == configCompile.getDoBlackList()) {
|
||||
return "id为" + compileId + "的编译配置中doBlackList不能为空";
|
||||
if (null == configCompile.getDoBlacklist()) {
|
||||
return "id为" + compileId + "的编译配置中doBlacklist不能为空";
|
||||
}
|
||||
if (null == configCompile.getDoLog()) {
|
||||
return "id为" + compileId + "的编译配置中doLog不能为空";
|
||||
|
||||
@@ -423,8 +423,8 @@ public class CompileVal {
|
||||
if (null == configCompile.getAction()) {
|
||||
return "id为" + compileId + "的编译配置中action不能为空";
|
||||
}
|
||||
if (null == configCompile.getDoBlackList()) {
|
||||
return "id为" + compileId + "的编译配置中doBlackList不能为空";
|
||||
if (null == configCompile.getDoBlacklist()) {
|
||||
return "id为" + compileId + "的编译配置中doBlacklist不能为空";
|
||||
}
|
||||
if (null == configCompile.getDoLog()) {
|
||||
return "id为" + compileId + "的编译配置中doLog不能为空";
|
||||
@@ -686,8 +686,8 @@ public class CompileVal {
|
||||
&& configCompile.getAction() != 6 && configCompile.getAction() != 7) {
|
||||
return "编译配置id为" + compileId + "的配置中action的值只能是1(阻断),2(监测),5(封堵白名单),6(监测白名单),7(封堵监测都白名单)";
|
||||
}
|
||||
if (configCompile.getDoBlackList() != 1) {
|
||||
return "编译配置id为" + compileId + "的配置中doBlackList的值只能是1";
|
||||
if (configCompile.getDoBlacklist() != 1) {
|
||||
return "编译配置id为" + compileId + "的配置中doBlacklist的值只能是1";
|
||||
}
|
||||
|
||||
if (configCompile.getDoLog() != 0 && configCompile.getDoLog() != 1 && configCompile.getDoLog() != 2) {
|
||||
|
||||
@@ -45,9 +45,6 @@ public class ReadMaatXmlUtil {
|
||||
static {
|
||||
readXml();
|
||||
}
|
||||
|
||||
private static List<MaatXmlConfig> maatXmlConfigList = new ArrayList<MaatXmlConfig>();
|
||||
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
// validateXmlByXSD();
|
||||
|
||||
93
src/main/java/com/nis/util/ServiceAndRDBIndexReal.java
Normal file
93
src/main/java/com/nis/util/ServiceAndRDBIndexReal.java
Normal file
@@ -0,0 +1,93 @@
|
||||
package com.nis.util;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
* <p>Title: ServiceAndRDBIndexReal</p>
|
||||
* <p>Description: 业务类型与各个表名的对应关系,业务类型与redisDBIndex的对应关系</p>
|
||||
* <p>Company: IIE</p>
|
||||
* @author rkg
|
||||
* @date 2018年5月30日
|
||||
*
|
||||
*/
|
||||
public class ServiceAndRDBIndexReal {
|
||||
|
||||
/**
|
||||
* 第一个key是业务类型,第二个key是type(编译配置,分组配置,域配置)value是表名
|
||||
*/
|
||||
private static Map<Integer, Map<Integer, String>> sercieNameMap = new HashMap<Integer, Map<Integer, String>>();
|
||||
/**
|
||||
* key是业务类型,value是业务类型对应的redisdbIndex
|
||||
*/
|
||||
private static Map<Integer, Integer> serviceDBIndexmap = new HashMap<Integer, Integer>();
|
||||
|
||||
static {
|
||||
String service = Configurations.getStringProperty("service", "");
|
||||
if (service != null && !service.trim().equals("")) {
|
||||
String[] split = service.split(";");
|
||||
for (String str : split) {
|
||||
String type = Configurations.getStringProperty(str, "");
|
||||
if (type != null && !type.trim().equals("")) {
|
||||
Map<Integer, String> typeMap = new HashMap<Integer, String>();
|
||||
String[] typeArrs = type.split(";");
|
||||
for (String typeStr : typeArrs) {
|
||||
String[] typeArr = typeStr.split(":");
|
||||
String tableNameArr[] = typeArr[1].split(",");
|
||||
for (String tableName : tableNameArr) {
|
||||
typeMap.put(Integer.parseInt(typeArr[0]), tableName.toUpperCase());
|
||||
}
|
||||
}
|
||||
sercieNameMap.put(Integer.parseInt(str), typeMap);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
String serviceDBIndexs = Configurations.getStringProperty("serviceDBIndex", "");
|
||||
if (serviceDBIndexs != null && !serviceDBIndexs.trim().equals("")) {
|
||||
String[] serviceDBIndexArr = serviceDBIndexs.split(";");
|
||||
for (String serviceDBIndexStr : serviceDBIndexArr) {
|
||||
String[] serviceDBIndex = serviceDBIndexStr.split(":");
|
||||
|
||||
String[] redisDbArr = serviceDBIndex[1].split(",");
|
||||
for (String redisDBIndex : redisDbArr) {
|
||||
serviceDBIndexmap.put(Integer.parseInt(serviceDBIndex[0]), Integer.parseInt(redisDBIndex));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static Integer getRedisDBByService(Integer service) {
|
||||
Integer redisIndex = serviceDBIndexmap.get(service);
|
||||
if (redisIndex == null) {
|
||||
return 0;
|
||||
}
|
||||
return redisIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据业务类型和具体的type获取对应的表名
|
||||
* @param service 业务类型
|
||||
* @param type 10代表是编译配置,11代表是分组配置,12代表是ip类域配置,13代表是数值类配置,14代表是字符串类域配置,15代表是增强字符串类域配置
|
||||
* @return
|
||||
*/
|
||||
public static String getTableName(int service, int type) {
|
||||
Map<Integer, String> typeMap = sercieNameMap.get(service);
|
||||
if (typeMap != null && typeMap.size() > 0) {
|
||||
return typeMap.get(type);
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String str = "80:2";
|
||||
String[] serviceDBIndex = str.split(":");
|
||||
String[] redisDbArr = serviceDBIndex[1].split(",");
|
||||
for (String redisDBIndex : redisDbArr) {
|
||||
System.out.println(redisDBIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,24 +6,19 @@ import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import net.sf.json.JSONObject;
|
||||
|
||||
import org.apache.commons.codec.digest.DigestUtils;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import com.nis.datasource.DynamicJedisDataBase;
|
||||
import com.nis.domain.restful.ConfigCompile;
|
||||
import com.nis.domain.restful.ConfigSource;
|
||||
import com.nis.domain.restful.FileDesc;
|
||||
@@ -40,12 +35,13 @@ import com.nis.web.service.ServicesRequestLogService;
|
||||
import com.nis.web.service.fdfs.FastDFSFile;
|
||||
import com.nis.web.service.fdfs.FileManager;
|
||||
import com.nis.web.service.restful.ConfigRedisService;
|
||||
import com.nis.web.service.restful.ConfigRedisServiceimpl;
|
||||
import com.nis.web.service.restful.ConfigSourcesService;
|
||||
import com.wordnik.swagger.annotations.Api;
|
||||
import com.wordnik.swagger.annotations.ApiOperation;
|
||||
import com.wordnik.swagger.annotations.ApiParam;
|
||||
|
||||
import net.sf.json.JSONObject;
|
||||
|
||||
/**
|
||||
* @ClassName: ConfigSourcesController
|
||||
* @Description: 配置存储服务
|
||||
@@ -53,7 +49,7 @@ import com.wordnik.swagger.annotations.ApiParam;
|
||||
* @date 2016年9月5日 下午6:20:33
|
||||
* @version V1.0
|
||||
*/
|
||||
//@Scope("prototype")
|
||||
// @Scope("prototype")
|
||||
@RestController
|
||||
@RequestMapping("${servicePath}")
|
||||
@Api(value = "ConfigSourcesController", description = "配置存储服务,包括管控、监测、白名单的控制类")
|
||||
@@ -78,7 +74,7 @@ public class ConfigSourcesController extends BaseRestController {
|
||||
Integer service = 98;
|
||||
long id = configRedisService.getIncrId("seq_compileid");
|
||||
// int id=2;
|
||||
map.put("cfg_id", id + "");
|
||||
map.put("compile_id", id + "");
|
||||
map.put("is_valid", "1");
|
||||
map.put("dst_file", "home");
|
||||
map.put("dst_file_md5", "fasdfdasfsdafdsafadsf");
|
||||
@@ -87,20 +83,26 @@ public class ConfigSourcesController extends BaseRestController {
|
||||
map.put("file_id", id + "");
|
||||
map.put("service", service + "");
|
||||
listMap.add(map);
|
||||
configRedisService.saveUnMaatConfig(listMap, service);
|
||||
|
||||
Map<Integer, List<Map<String, String>>> configMap = new HashMap<Integer, List<Map<String, String>>>();
|
||||
configMap.put(1, listMap);
|
||||
configRedisService.saveUnMaatConfig(configMap);
|
||||
} else {
|
||||
Integer service = 100;
|
||||
Map<String, String> map = new HashMap<String, String>();
|
||||
long id = configRedisService.getIncrId("seq_compileid");
|
||||
// int id=2;
|
||||
map.put("cfg_id", id + "");
|
||||
map.put("compile_id", id + "");
|
||||
map.put("is_valid", "1");
|
||||
map.put("service", "100");
|
||||
map.put("description", "123" + id);
|
||||
map.put("level", "20");
|
||||
listMap.add(map);
|
||||
map.put("service", service + "");
|
||||
configRedisService.saveUnMaatConfig(listMap, service);
|
||||
|
||||
Map<Integer, List<Map<String, String>>> configMap = new HashMap<Integer, List<Map<String, String>>>();
|
||||
configMap.put(1, listMap);
|
||||
configRedisService.saveUnMaatConfig(configMap);
|
||||
}
|
||||
return "ok";
|
||||
} catch (Exception e) {
|
||||
@@ -116,8 +118,13 @@ public class ConfigSourcesController extends BaseRestController {
|
||||
try {
|
||||
List<MaatConfig> listMap = new ArrayList<MaatConfig>();
|
||||
listMap.add(getMaatConfig(service));
|
||||
Map<Integer, List<MaatConfig>> configMap = new HashMap<Integer, List<MaatConfig>>();
|
||||
configMap.put(1, listMap);
|
||||
listMap = new ArrayList<MaatConfig>();
|
||||
listMap.add(getMaatConfig(service));
|
||||
configRedisService.saveMaatConfig(listMap, service);
|
||||
configMap.put(2, listMap);
|
||||
configRedisService.saveMaatConfig(configMap);
|
||||
// configRedisService.saveMaatConfig(listMap, service);
|
||||
// new ConfigRedisServiceimpl().GETMaatConfig(listMap);
|
||||
return "ok";
|
||||
} catch (Exception e) {
|
||||
@@ -134,7 +141,7 @@ public class ConfigSourcesController extends BaseRestController {
|
||||
long seq_regionid1 = configRedisService.getIncrId("SEQ_REGIONID");
|
||||
long seq_regionid2 = configRedisService.getIncrId("SEQ_REGIONID");
|
||||
// int id=2;
|
||||
configMap.put("cfg_id", seq_compileid + "");
|
||||
configMap.put("compile_id", seq_compileid + "");
|
||||
configMap.put("service", service + "");
|
||||
configMap.put("action", "0");
|
||||
configMap.put("do_blacklist", "1");
|
||||
@@ -143,13 +150,13 @@ public class ConfigSourcesController extends BaseRestController {
|
||||
configMap.put("user_region", "0");
|
||||
configMap.put("is_valid", "1");
|
||||
configMap.put("group_num", "1");
|
||||
configMap.put("father_cfg_id", "0");
|
||||
configMap.put("father_compile_id", "0");
|
||||
configMap.put("op_time", time);
|
||||
|
||||
List<Map<String, String>> groupMapList = new ArrayList<Map<String, String>>();
|
||||
Map<String, String> groupMap = new HashMap<String, String>();
|
||||
groupMap.put("group_id", seq_groupid + "");
|
||||
groupMap.put("cfg_id", seq_compileid + "");
|
||||
groupMap.put("compile_id", seq_compileid + "");
|
||||
groupMap.put("is_valid", "1");
|
||||
groupMap.put("op_time", time);
|
||||
groupMap.put("service", service + "");
|
||||
@@ -204,6 +211,7 @@ public class ConfigSourcesController extends BaseRestController {
|
||||
maatConfig.setIpRegionMapList(ipRegionMapList);
|
||||
return maatConfig;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/cfg/v1/configSources", method = RequestMethod.POST)
|
||||
@ApiOperation(value = "业务配置存储", httpMethod = "POST", response = Map.class, notes = "对有效的配置(封堵|监测|白名单)存储")
|
||||
@ApiParam(value = "业务配置数据源", name = "configSource", required = true)
|
||||
@@ -448,20 +456,22 @@ public class ConfigSourcesController extends BaseRestController {
|
||||
}
|
||||
|
||||
}
|
||||
@RequestMapping(value = "/cfg/v1/commonSources", method = RequestMethod.POST, produces=org.springframework.http.MediaType.APPLICATION_JSON_VALUE)
|
||||
|
||||
@RequestMapping(value = "/cfg/v1/commonSources", method = RequestMethod.POST, produces = org.springframework.http.MediaType.APPLICATION_JSON_VALUE)
|
||||
@ApiOperation(value = "回调配置存储", httpMethod = "POST", response = Map.class, notes = "回调配置存储服务")
|
||||
//@ApiParam(value = "回调配置数据源", name = "JSONObject", requirerue)
|
||||
public Map createCommonConfigSource(@RequestBody String jsonString , HttpServletRequest request,
|
||||
// @ApiParam(value = "回调配置数据源", name = "JSONObject", requirerue)
|
||||
public Map createCommonConfigSource(@RequestBody String jsonString, HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
ConfigSourcesService.setMsgList(new ArrayList<Exception>());// 清除上次记录的日志信息
|
||||
long start = System.currentTimeMillis();
|
||||
SaveRequestLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,null);
|
||||
SaveRequestLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
|
||||
null);
|
||||
StringBuffer sb = new StringBuffer();
|
||||
|
||||
configSourcesService.savaCommonSources(thread, start, jsonString, sb);
|
||||
|
||||
return compileServiceResponse(thread, System.currentTimeMillis() - start, request, response,
|
||||
"配置数据插入成功" , Constants.IS_DEBUG ? jsonString : null);
|
||||
return compileServiceResponse(thread, System.currentTimeMillis() - start, request, response, "配置数据插入成功",
|
||||
Constants.IS_DEBUG ? jsonString : null);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/cfg/v1/fileUploadSources", method = RequestMethod.POST)
|
||||
@@ -471,29 +481,32 @@ public class ConfigSourcesController extends BaseRestController {
|
||||
HttpServletResponse response) {
|
||||
ConfigSourcesService.setMsgList(new ArrayList<Exception>());// 清除上次记录的日志信息
|
||||
long start = System.currentTimeMillis();
|
||||
SaveRequestLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,null);
|
||||
String filePath ="";
|
||||
SaveRequestLogThread thread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_POST, request,
|
||||
null);
|
||||
String filePath = "";
|
||||
try {
|
||||
FileDesc fileDesc = (FileDesc) JSONObject.toBean(JSONObject.fromObject(request.getHeader("File-Desc")),FileDesc.class);
|
||||
FileDesc fileDesc = (FileDesc) JSONObject.toBean(JSONObject.fromObject(request.getHeader("File-Desc")),
|
||||
FileDesc.class);
|
||||
if (!StringUtil.isEmpty(fileDesc.getChecksum())) {
|
||||
//验证Md5
|
||||
// 验证Md5
|
||||
String md5 = DigestUtils.md5Hex(file.getBytes());
|
||||
System.out.println("----------------------------MD5:'"+md5+"'==='"+fileDesc.getChecksum()+"'");
|
||||
System.out.println("----------------------------MD5:'" + md5 + "'==='" + fileDesc.getChecksum() + "'");
|
||||
if (!md5.equals(fileDesc.getChecksum())) {
|
||||
thread.setExceptionInfo("checksum与文件MD5值不一致");
|
||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "checksum与文件MD5值不一致",
|
||||
RestBusinessCode.config_integrity_error.getValue());
|
||||
}
|
||||
String ext = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".") + 1);
|
||||
FastDFSFile fdsfile = new FastDFSFile(file.getBytes(),file.getOriginalFilename(), ext);
|
||||
// NameValuePair[] meta_list = new NameValuePair[5];
|
||||
// meta_list[0] = new NameValuePair("fileName", file.getOriginalFilename());
|
||||
// meta_list[1] = new NameValuePair("fileLength", String.valueOf(file.getSize()));
|
||||
// meta_list[2] = new NameValuePair("fileExt", ext);
|
||||
// meta_list[3] = new NameValuePair("fileAuthor", "rkg");
|
||||
// meta_list[4] = new NameValuePair("fileMd5", md5);
|
||||
FastDFSFile fdsfile = new FastDFSFile(file.getBytes(), file.getOriginalFilename(), ext);
|
||||
// NameValuePair[] meta_list = new NameValuePair[5];
|
||||
// meta_list[0] = new NameValuePair("fileName", file.getOriginalFilename());
|
||||
// meta_list[1] = new NameValuePair("fileLength",
|
||||
// String.valueOf(file.getSize()));
|
||||
// meta_list[2] = new NameValuePair("fileExt", ext);
|
||||
// meta_list[3] = new NameValuePair("fileAuthor", "rkg");
|
||||
// meta_list[4] = new NameValuePair("fileMd5", md5);
|
||||
filePath = FileManager.upload(fdsfile, null);
|
||||
}else{
|
||||
} else {
|
||||
thread.setExceptionInfo("请求头信息中缺少checksum参数");
|
||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "请求头信息中缺少checksum参数",
|
||||
RestBusinessCode.missing_args.getValue());
|
||||
@@ -504,8 +517,7 @@ public class ConfigSourcesController extends BaseRestController {
|
||||
}
|
||||
JSONObject jsonObj = new JSONObject();
|
||||
jsonObj.put("accessUrl", filePath.substring(filePath.indexOf("group")));
|
||||
return compileServiceResponse(thread, System.currentTimeMillis() - start, request, response,
|
||||
"文件上传成功" ,jsonObj);
|
||||
return compileServiceResponse(thread, System.currentTimeMillis() - start, request, response, "文件上传成功", jsonObj);
|
||||
}
|
||||
|
||||
private boolean isBlank(Date datetime) {
|
||||
|
||||
@@ -34,7 +34,7 @@ public class FastDFSController {
|
||||
public static void main(String[] args) {
|
||||
String path = new FastDFSController().testAdd();
|
||||
//String path = "M00/00/01/CgAGwFr786aAegOQAADz3NN2rlY283.jpg";
|
||||
new FastDFSController().testDelete(path);
|
||||
//new FastDFSController().testDelete(path);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -11,8 +11,8 @@ import com.nis.web.service.SpringContextHolder;
|
||||
@Repository
|
||||
public abstract class BaseRedisDao<K, V> {
|
||||
|
||||
@Autowired
|
||||
protected RedisTemplate<K, V> redisTemplate;
|
||||
//@Autowired
|
||||
protected RedisTemplate<K, V> redisTemplate1;
|
||||
|
||||
// public void setRedisTemplate(RedisTemplate<K, V> redisTemplate) {
|
||||
// StringRedisSerializer stringRedisSerializer = new StringRedisSerializer();
|
||||
|
||||
@@ -21,7 +21,7 @@ public class FileManagerConfig implements Serializable {
|
||||
|
||||
public static final String SEPARATOR = "/";
|
||||
// fdfs-tracker-nginx服务器
|
||||
public static final String TRACKER_NGNIX_ADDR = "10.0.6.192";
|
||||
public static final String TRACKER_NGNIX_ADDR = "10.0.6.249";
|
||||
|
||||
public static final String TRACKER_NGNIX_PORT = "";
|
||||
|
||||
|
||||
@@ -15,19 +15,18 @@ import com.nis.domain.restful.MaatConfig;
|
||||
*
|
||||
*/
|
||||
public interface ConfigRedisService {
|
||||
/**
|
||||
* 保存非maat配置接口,例如ysp文件样例,ysp标志样例
|
||||
* @param listMap 配置集合,一个map是一个集合
|
||||
* @param service 业务类型
|
||||
*/
|
||||
public void saveUnMaatConfig(List<Map<String, String>> listMap, int service);
|
||||
|
||||
/**
|
||||
* 保存maat配置接口,例如ysp配置,文本类配置
|
||||
* @param maatConfigList
|
||||
* @param service 业务类型
|
||||
* 下发非maat配置接口,key是redisDBIndex,value是配置集合
|
||||
* @param configMap
|
||||
*/
|
||||
public void saveMaatConfig(List<MaatConfig> maatConfigList, int service);
|
||||
public void saveUnMaatConfig(Map<Integer, List<Map<String, String>>> configMap);
|
||||
|
||||
/**
|
||||
* 保存 maat配置接口,key是redisDBIndex,value是配置集合
|
||||
* @param configMap
|
||||
*/
|
||||
public void saveMaatConfig(Map<Integer, List<MaatConfig>> configMap);
|
||||
|
||||
/**
|
||||
* 获取指定key的自增长值
|
||||
@@ -37,16 +36,31 @@ public interface ConfigRedisService {
|
||||
public Long getIncrId(String key);
|
||||
|
||||
/**
|
||||
* 删除非maat类配置
|
||||
* @param compileIdList 配置id集合
|
||||
* @param service 配置id所属的业务类型
|
||||
* 删除非maat类配置,第一个key是redisDBIndex,第二个key是业务类型,value是配置id集合
|
||||
* @param idMap
|
||||
*/
|
||||
public void delUnMaatConfig(List<Long> compileIdList, int service);
|
||||
public void delUnMaatConfig(Map<Integer, Map<Integer, List<Long>>> idMap);
|
||||
|
||||
/**
|
||||
* 删除maat类配置
|
||||
* @param compileIdList 配置id集合
|
||||
* @param service 配置id所属的业务类型
|
||||
* 删除maat类配置,第一个key是redisDBIndex,第二个key是业务类型,value是配置id集合
|
||||
* @param idMap
|
||||
*/
|
||||
public void delMaatConfig(List<Long> compileIdList, int service);
|
||||
public void delMaatConfig(Map<Integer, Map<Integer, List<Long>>> idMap);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 下发配置成功后,需要更新编译,组,域等配置id的对应关系
|
||||
* @param maatConfigList
|
||||
* @param service 业务类型
|
||||
*/
|
||||
public void addMaatRelation(List<MaatConfig> maatConfigList, int service);
|
||||
|
||||
/**
|
||||
* 删除配置成功后,需要更新编译,组,域等配置id的对应关系
|
||||
* @param maatConfigLis
|
||||
* @param service 业务类型
|
||||
*/
|
||||
public void delMaatRelation(List<Long> compileIdList, int service);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
package com.nis.web.service.restful;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.StringUtils;
|
||||
@@ -18,71 +20,40 @@ import com.nis.domain.MaatXmlSeq;
|
||||
import com.nis.domain.restful.MaatConfig;
|
||||
import com.nis.domain.restful.MaatRelation;
|
||||
import com.nis.listener.CompileGroupRegionRela;
|
||||
import com.nis.util.Configurations;
|
||||
import com.nis.util.ReadMaatXmlUtil;
|
||||
import com.nis.web.dao.impl.BaseRedisDao;
|
||||
import com.nis.util.ServiceAndRDBIndexReal;
|
||||
import com.nis.web.service.SpringContextHolder;
|
||||
|
||||
@Service()
|
||||
public class ConfigRedisServiceimpl extends BaseRedisDao<String, String> implements ConfigRedisService {
|
||||
public class ConfigRedisServiceimpl implements ConfigRedisService {
|
||||
private static Logger logger = LoggerFactory.getLogger(ConfigRedisServiceimpl.class);
|
||||
|
||||
/**
|
||||
* 第一个key是业务类型,第二个key是type(编译配置,分组配置,域配置)value是表名
|
||||
*/
|
||||
private static Map<Integer, Map<Integer, String>> sercieNameMap = new HashMap<Integer, Map<Integer, String>>();
|
||||
/**
|
||||
* key是业务类型,value是业务类型对应的redisdbIndex
|
||||
*/
|
||||
private static Map<Integer, Integer> serviceDBIndexmap = new HashMap<Integer, Integer>();
|
||||
|
||||
static {
|
||||
String service = Configurations.getStringProperty("service", "");
|
||||
if (service != null && !service.trim().equals("")) {
|
||||
String[] split = service.split(";");
|
||||
for (String str : split) {
|
||||
String type = Configurations.getStringProperty(str, "");
|
||||
if (type != null && !type.trim().equals("")) {
|
||||
Map<Integer, String> typeMap = new HashMap<Integer, String>();
|
||||
String[] typeArrs = type.split(";");
|
||||
for (String typeStr : typeArrs) {
|
||||
String[] typeArr = typeStr.split(":");
|
||||
typeMap.put(Integer.parseInt(typeArr[0]), typeArr[1]);
|
||||
}
|
||||
sercieNameMap.put(Integer.parseInt(str), typeMap);
|
||||
@Transactional
|
||||
public void saveTestConfig(List<Map<String, String>> listMap, int service) {
|
||||
RedisTemplate<String, String> redisTemplate0 = SpringContextHolder.getBean("redisTemplate2");
|
||||
RedisTemplate<String, String> redisTemplate1 = SpringContextHolder.getBean("redisTemplate1");
|
||||
System.out.println(redisTemplate0.opsForValue().get("MAAT_VERSION"));
|
||||
System.out.println(redisTemplate1.opsForValue().get("MAAT_VERSION"));
|
||||
redisTemplate0.boundValueOps("MAAT_VERSION").increment(2l);
|
||||
if (service == 2) {
|
||||
int i = service / 0;
|
||||
}
|
||||
redisTemplate1.boundValueOps("MAAT_VERSION").increment(1l);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
String serviceDBIndexs = Configurations.getStringProperty("serviceDBIndex", "");
|
||||
if (serviceDBIndexs != null && !serviceDBIndexs.trim().equals("")) {
|
||||
|
||||
String[] serviceDBIndexArr = serviceDBIndexs.split(";");
|
||||
for (String serviceDBIndexStr : serviceDBIndexArr) {
|
||||
String[] serviceDBIndex = serviceDBIndexStr.split(":");
|
||||
|
||||
serviceDBIndexmap.put(Integer.parseInt(serviceDBIndex[0]), Integer.parseInt(serviceDBIndex[1]));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void saveUnMaatConfig2(List<Map<String, String>> listMap, int service) {
|
||||
System.out.println(redisTemplate.getConnectionFactory());
|
||||
setRedisDataBase(2, redisTemplate);
|
||||
System.out.println(redisTemplate.getConnectionFactory());
|
||||
String maatVersion = redisTemplate.opsForValue().get("MAAT_VERSION");
|
||||
System.out.println("maatVersion:" + maatVersion);
|
||||
redisTemplate.boundValueOps("MAAT_VERSION").increment(1l);
|
||||
// redisTemplate0.exec();
|
||||
// redisTemplate1.exec();
|
||||
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void saveUnMaatConfig(List<Map<String, String>> listMap, int service) {
|
||||
if (listMap != null && listMap.size() > 0) {
|
||||
setRedisDataBase(getRedisDBByService(service), redisTemplate);
|
||||
// String maatVersionStr =
|
||||
// operRedisService.getMaatVersion(getRedisDBByService(service));
|
||||
public void saveUnMaatConfig(Map<Integer, List<Map<String, String>>> configMap) {
|
||||
if (configMap != null && configMap.size() > 0) {
|
||||
for (Integer redisDBIndex : configMap.keySet()) {
|
||||
if (redisDBIndex >= 0 && redisDBIndex <= 15) {
|
||||
RedisTemplate<String, String> redisTemplate = SpringContextHolder
|
||||
.getBean("redisTemplate" + redisDBIndex);
|
||||
List<Map<String, String>> listMap = configMap.get(redisDBIndex);
|
||||
|
||||
String maatVersionStr = redisTemplate.opsForValue().get("MAAT_VERSION");
|
||||
if (maatVersionStr == null) {
|
||||
maatVersionStr = "0";
|
||||
@@ -90,8 +61,8 @@ public class ConfigRedisServiceimpl extends BaseRedisDao<String, String> impleme
|
||||
if (maatVersionStr != null) {
|
||||
Long maatVersion = Long.valueOf(maatVersionStr) + 1;
|
||||
for (Map<String, String> map : listMap) {
|
||||
// String serviceStr = map.get("service");
|
||||
// int service = Integer.parseInt(serviceStr);
|
||||
String serviceStr = map.get("service");
|
||||
int service = Integer.parseInt(serviceStr);
|
||||
MaatXmlConfig maatXmlConfig = ReadMaatXmlUtil.getMaatConfigByService(service);
|
||||
if (maatXmlConfig != null) {
|
||||
List<MaatXmlExpr> expressionList = maatXmlConfig.getExpressionList();
|
||||
@@ -122,14 +93,11 @@ public class ConfigRedisServiceimpl extends BaseRedisDao<String, String> impleme
|
||||
valBF.append("\n");
|
||||
}
|
||||
}
|
||||
// System.out.println(keyBF.toString());
|
||||
// System.out.println(valBF.toString());
|
||||
maatKey = keyBF.toString();
|
||||
redisTemplate.opsForValue().set(keyBF.toString().toUpperCase(), valBF.toString());
|
||||
redisTemplate.opsForValue().set(keyBF.toString().toUpperCase(),
|
||||
valBF.toString());
|
||||
break;
|
||||
}
|
||||
// redisTemplate.boundValueOps(keyBF.toString().toUpperCase()).set(valBF.toString());
|
||||
|
||||
}
|
||||
for (MaatXmlExpr maatXmlExpr : expressionList) {
|
||||
if (maatXmlExpr.getKeyExpression().toUpperCase().equals("MAAT_UPDATE_STATUS")) {
|
||||
@@ -138,7 +106,8 @@ public class ConfigRedisServiceimpl extends BaseRedisDao<String, String> impleme
|
||||
} else if (maatXmlExpr.getKeyExpression().toUpperCase().equals("MAAT_RULE_TIMER")) {
|
||||
Double score = 0d;// 界面下发的配置没有超时时间所以这里设置为0
|
||||
redisTemplate.boundZSetOps("MAAT_RULE_TIMER").add(maatKey, score);
|
||||
} else if (maatXmlExpr.getKeyExpression().toUpperCase().equals("MAAT_VERSION_TIMER")) {
|
||||
} else if (maatXmlExpr.getKeyExpression().toUpperCase()
|
||||
.equals("MAAT_VERSION_TIMER")) {
|
||||
Long nowTime = new Date().getTime();
|
||||
nowTime = nowTime / 1000l;
|
||||
Double score = nowTime.doubleValue();// 使用redis自带的time,得到当前时间的秒
|
||||
@@ -165,110 +134,191 @@ public class ConfigRedisServiceimpl extends BaseRedisDao<String, String> impleme
|
||||
redisTemplate.boundValueOps("MAAT_VERSION").increment(1l);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void test() {
|
||||
}
|
||||
|
||||
setRedisDataBase(2, redisTemplate);
|
||||
for (int i = 0; i < 10; i++) {
|
||||
redisTemplate.boundZSetOps("1").add("a" + i, i);
|
||||
if (i == 5) {
|
||||
// int a = 1 / 0;
|
||||
@Override
|
||||
public void addMaatRelation(List<MaatConfig> maatConfigList, int service) {
|
||||
Integer redisDBIndex = ServiceAndRDBIndexReal.getRedisDBByService(service);
|
||||
MaatRelation maatRelation = CompileGroupRegionRela.getIdRelationMap().get(redisDBIndex);
|
||||
|
||||
for (MaatConfig maatConfig : maatConfigList) {
|
||||
// MaatXmlConfig maatXmlConfig =
|
||||
// ReadMaatXmlUtil.getMaatConfigByService(service);
|
||||
|
||||
List<Map<String, String>> groupMapList = maatConfig.getGroupMapList();
|
||||
if (groupMapList != null && groupMapList.size() > 0) {
|
||||
for (Map<String, String> map : groupMapList) {
|
||||
String compileIdStr = map.get("compile_id");
|
||||
String groupIdStr = map.get("group_id");
|
||||
if (compileIdStr != null && !compileIdStr.equals("") && groupIdStr != null
|
||||
&& !groupIdStr.equals("")) {
|
||||
Long groupId = Long.valueOf(groupIdStr);
|
||||
Long compileId = Long.valueOf(compileIdStr);
|
||||
Map<Long, Set<Long>> groupAndCompileMap = maatRelation.getGroupAndCompileMap();
|
||||
if (groupAndCompileMap != null) {
|
||||
if (groupAndCompileMap.containsKey(groupId)) {
|
||||
groupAndCompileMap.get(groupId).add(compileId);
|
||||
} else {
|
||||
Set<Long> set = new HashSet<Long>();
|
||||
set.add(compileId);
|
||||
groupAndCompileMap.put(groupId, set);
|
||||
}
|
||||
} else {
|
||||
Map<Long, Set<Long>> groupAndCompileMap1 = new ConcurrentHashMap<Long, Set<Long>>();
|
||||
Set<Long> set = new HashSet<Long>();
|
||||
set.add(compileId);
|
||||
groupAndCompileMap1.put(groupId, set);
|
||||
maatRelation.setGroupAndCompileMap(groupAndCompileMap1);
|
||||
}
|
||||
// 切换redis数据库
|
||||
setRedisDataBase(3, redisTemplate);
|
||||
for (int i = 10; i < 20; i++) {
|
||||
redisTemplate.boundZSetOps("1").add("a" + i, i);
|
||||
if (i == 5) {
|
||||
// int a = 1 / 0;
|
||||
|
||||
Map<Long, Set<Long>> compileAndGroupMap = maatRelation.getCompileAndGroupMap();
|
||||
if (compileAndGroupMap != null) {
|
||||
if (compileAndGroupMap.containsKey(compileId)) {
|
||||
compileAndGroupMap.get(compileId).add(groupId);
|
||||
} else {
|
||||
Set<Long> set = new HashSet<Long>();
|
||||
set.add(groupId);
|
||||
compileAndGroupMap.put(compileId, set);
|
||||
}
|
||||
} else {
|
||||
Map<Long, Set<Long>> compileAndGroupMap1 = new ConcurrentHashMap<Long, Set<Long>>();
|
||||
Set<Long> set = new HashSet<Long>();
|
||||
set.add(groupId);
|
||||
compileAndGroupMap1.put(compileId, set);
|
||||
maatRelation.setCompileAndGroupMap(compileAndGroupMap1);
|
||||
}
|
||||
setRedisDataBase(4, redisTemplate);
|
||||
for (int i = 20; i < 30; i++) {
|
||||
redisTemplate.boundZSetOps("1").add("a" + i, i);
|
||||
if (i == 25) {
|
||||
// int a = 1 / 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public void saveMaatConfig(List<MaatConfig> maatConfigList, int service) {
|
||||
if (maatConfigList != null && maatConfigList.size() > 0) {
|
||||
Integer redisDBIndex = getRedisDBByService(service);
|
||||
setRedisDataBase(redisDBIndex, redisTemplate);
|
||||
List<Map<String, String>> ipRegionMapList = maatConfig.getIpRegionMapList();
|
||||
setReionAndGroupRela(ipRegionMapList, maatRelation);
|
||||
List<Map<String, String>> numRegionMapList = maatConfig.getNumRegionMapList();
|
||||
setReionAndGroupRela(numRegionMapList, maatRelation);
|
||||
List<Map<String, String>> strRegionMapList = maatConfig.getStrRegionMapList();
|
||||
setReionAndGroupRela(strRegionMapList, maatRelation);
|
||||
List<Map<String, String>> strStrRegionMapList = maatConfig.getStrStrRegionMapList();
|
||||
setReionAndGroupRela(strStrRegionMapList, maatRelation);
|
||||
List<Map<String, String>> fileDigestRegionMapList = maatConfig.getFileDigestRegionMapList();
|
||||
setReionAndGroupRela(fileDigestRegionMapList, maatRelation);
|
||||
List<Map<String, String>> fileLikeRegionMapList = maatConfig.getFileLikeRegionMapList();
|
||||
setReionAndGroupRela(fileLikeRegionMapList, maatRelation);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void setReionAndGroupRela(List<Map<String, String>> regionMapList, MaatRelation maatRelation) {
|
||||
if (regionMapList != null && regionMapList.size() > 0) {
|
||||
for (Map<String, String> map : regionMapList) {
|
||||
String regionIdStr = map.get("region_id");
|
||||
String groupIdStr = map.get("group_id");
|
||||
if (regionIdStr != null && !regionIdStr.equals("") && groupIdStr != null && !groupIdStr.equals("")) {
|
||||
Long groupId = Long.valueOf(groupIdStr);
|
||||
Long regionId = Long.valueOf(regionIdStr);
|
||||
Map<Long, Set<Long>> groupAndRegionMap = maatRelation.getGroupAndRegionMap();
|
||||
if (groupAndRegionMap != null) {
|
||||
if (groupAndRegionMap.containsKey(groupId)) {
|
||||
groupAndRegionMap.get(groupId).add(regionId);
|
||||
} else {
|
||||
Set<Long> set = new HashSet<Long>();
|
||||
set.add(regionId);
|
||||
groupAndRegionMap.put(groupId, set);
|
||||
}
|
||||
} else {
|
||||
Map<Long, Set<Long>> groupAndRegionMap1 = new ConcurrentHashMap<Long, Set<Long>>();
|
||||
Set<Long> set = new HashSet<Long>();
|
||||
set.add(regionId);
|
||||
groupAndRegionMap1.put(groupId, set);
|
||||
maatRelation.setGroupAndRegionMap(groupAndRegionMap1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveMaatConfig(Map<Integer, List<MaatConfig>> configMap) {
|
||||
if (configMap != null && configMap.size() > 0) {
|
||||
for (Integer redisDBIndex : configMap.keySet()) {
|
||||
if (redisDBIndex >= 0 && redisDBIndex <= 15) {
|
||||
RedisTemplate<String, String> redisTemplate = SpringContextHolder
|
||||
.getBean("redisTemplate" + redisDBIndex);
|
||||
String maatVersionStr = redisTemplate.opsForValue().get("MAAT_VERSION");
|
||||
if (maatVersionStr == null) {
|
||||
maatVersionStr = "0";
|
||||
}
|
||||
|
||||
MaatRelation maatRelation = CompileGroupRegionRela.getIdRelationMap().get(redisDBIndex);
|
||||
if (maatVersionStr != null) {
|
||||
Long maatVersion = Long.valueOf(maatVersionStr) + 1;
|
||||
List<MaatConfig> maatConfigList = configMap.get(redisDBIndex);
|
||||
if (maatConfigList != null && maatConfigList.size() > 0) {
|
||||
for (MaatConfig maatConfig : maatConfigList) {
|
||||
int service = maatConfig.getService();
|
||||
MaatXmlConfig maatXmlConfig = ReadMaatXmlUtil.getMaatConfigByService(service);
|
||||
setConfig(maatConfig, maatXmlConfig, maatVersion, service,maatRelation);
|
||||
setConfig(maatConfig, maatXmlConfig, maatVersion, service, redisTemplate);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
redisTemplate.boundValueOps("MAAT_VERSION").increment(1l);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setConfig(MaatConfig maatConfig, MaatXmlConfig maatXmlConfig, Long maatVersion, int service, MaatRelation maatRelation ) {
|
||||
public void setConfig(MaatConfig maatConfig, MaatXmlConfig maatXmlConfig, Long maatVersion, int service,
|
||||
RedisTemplate<String, String> redisTemplate) {
|
||||
Map<String, String> compileMap = maatConfig.getCompileMap();
|
||||
setCommonConfig(maatXmlConfig, compileMap, 10, maatVersion.doubleValue(), service);// 10代表是编译配置
|
||||
setCommonConfig(maatXmlConfig, compileMap, 10, maatVersion.doubleValue(), service, redisTemplate);// 10代表是编译配置
|
||||
List<Map<String, String>> groupMapList = maatConfig.getGroupMapList();
|
||||
if (groupMapList != null && groupMapList.size() > 0) {
|
||||
for (Map<String, String> map : groupMapList) {
|
||||
map.get("");
|
||||
Map<Long, Set<Long>> groupAndCompileMap = maatRelation.getGroupAndCompileMap();
|
||||
|
||||
|
||||
|
||||
setCommonConfig(maatXmlConfig, map, 11, maatVersion.doubleValue(), service);// 11代表是分组配置
|
||||
setCommonConfig(maatXmlConfig, map, 11, maatVersion.doubleValue(), service, redisTemplate);// 11代表是分组配置
|
||||
}
|
||||
}
|
||||
|
||||
List<Map<String, String>> ipRegionMapList = maatConfig.getIpRegionMapList();
|
||||
if (ipRegionMapList != null && ipRegionMapList.size() > 0) {
|
||||
for (Map<String, String> map : ipRegionMapList) {
|
||||
setCommonConfig(maatXmlConfig, map, 12, maatVersion.doubleValue(), service);// 12代表是ip类域配置
|
||||
setCommonConfig(maatXmlConfig, map, 12, maatVersion.doubleValue(), service, redisTemplate);// 12代表是ip类域配置
|
||||
}
|
||||
}
|
||||
List<Map<String, String>> numRegionMapList = maatConfig.getNumRegionMapList();
|
||||
if (numRegionMapList != null && numRegionMapList.size() > 0) {
|
||||
for (Map<String, String> map : numRegionMapList) {
|
||||
setCommonConfig(maatXmlConfig, map, 13, maatVersion.doubleValue(), service);// 13代表是数值类配置
|
||||
setCommonConfig(maatXmlConfig, map, 13, maatVersion.doubleValue(), service, redisTemplate);// 13代表是数值类配置
|
||||
}
|
||||
}
|
||||
List<Map<String, String>> strRegionMapList = maatConfig.getStrRegionMapList();
|
||||
if (strRegionMapList != null && strRegionMapList.size() > 0) {
|
||||
for (Map<String, String> map : strRegionMapList) {
|
||||
setCommonConfig(maatXmlConfig, map, 14, maatVersion.doubleValue(), service);// 14代表是字符串类域配置
|
||||
setCommonConfig(maatXmlConfig, map, 14, maatVersion.doubleValue(), service, redisTemplate);// 14代表是字符串类域配置
|
||||
}
|
||||
}
|
||||
List<Map<String, String>> strStrRegionMapList = maatConfig.getStrStrRegionMapList();
|
||||
if (strStrRegionMapList != null && strStrRegionMapList.size() > 0) {
|
||||
for (Map<String, String> map : strStrRegionMapList) {
|
||||
setCommonConfig(maatXmlConfig, map, 15, maatVersion.doubleValue(), service);// 15代表是增强字符串类域配置
|
||||
setCommonConfig(maatXmlConfig, map, 15, maatVersion.doubleValue(), service, redisTemplate);// 15代表是增强字符串类域配置
|
||||
}
|
||||
}
|
||||
List<Map<String, String>> fileDigestRegionMapList = maatConfig.getFileDigestRegionMapList();
|
||||
if (fileDigestRegionMapList != null && fileDigestRegionMapList.size() > 0) {
|
||||
for (Map<String, String> map : fileDigestRegionMapList) {
|
||||
setCommonConfig(maatXmlConfig, map, 16, maatVersion.doubleValue(), service);// 16代表是文件摘要类域配置
|
||||
setCommonConfig(maatXmlConfig, map, 16, maatVersion.doubleValue(), service, redisTemplate);// 16代表是文件摘要类域配置
|
||||
}
|
||||
}
|
||||
List<Map<String, String>> fileLikeRegionMapList = maatConfig.getFileLikeRegionMapList();
|
||||
if (fileLikeRegionMapList != null && fileLikeRegionMapList.size() > 0) {
|
||||
for (Map<String, String> map : fileLikeRegionMapList) {
|
||||
setCommonConfig(maatXmlConfig, map, 17, maatVersion.doubleValue(), service);// 17代表是文本相似性域配置
|
||||
setCommonConfig(maatXmlConfig, map, 17, maatVersion.doubleValue(), service, redisTemplate);// 17代表是文本相似性域配置
|
||||
}
|
||||
}
|
||||
// updateCommonKey(maatXmlConfig);
|
||||
}
|
||||
|
||||
public void setCommonConfig(MaatXmlConfig maatXmlConfig, Map<String, String> map, int type, Double maatVersion,
|
||||
int service) {
|
||||
int service, RedisTemplate<String, String> redisTemplate) {
|
||||
if (maatXmlConfig != null && map != null && map.size() > 0) {
|
||||
List<MaatXmlExpr> expressionList = maatXmlConfig.getExpressionList();
|
||||
String maatKey = "";
|
||||
@@ -283,7 +333,7 @@ public class ConfigRedisServiceimpl extends BaseRedisDao<String, String> impleme
|
||||
} else if (!StringUtils.isEmpty(keyStr) && keyStr.trim().startsWith("{")) {
|
||||
keyStr = keyStr.trim().replace("{", "").replace("}", "");
|
||||
if (keyStr.toLowerCase().contains("table_name")) {
|
||||
keyBF.append(getTableName(service, type));
|
||||
keyBF.append(ServiceAndRDBIndexReal.getTableName(service, type));
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -305,8 +355,8 @@ public class ConfigRedisServiceimpl extends BaseRedisDao<String, String> impleme
|
||||
}
|
||||
}
|
||||
maatKey = keyBF.toString();
|
||||
// System.out.println(keyBF.toString());
|
||||
// System.out.println(valBF.toString());
|
||||
System.out.println(keyBF.toString());
|
||||
System.out.println(valBF.toString());
|
||||
redisTemplate.opsForValue().set(maatKey.toUpperCase(), valBF.toString());
|
||||
// redisTemplate.boundValueOps(keyBF.toString()).set(valBF.toString());
|
||||
break;
|
||||
@@ -331,7 +381,7 @@ public class ConfigRedisServiceimpl extends BaseRedisDao<String, String> impleme
|
||||
}
|
||||
}
|
||||
|
||||
public void updateCommonKey(MaatXmlConfig maatXmlConfig) {
|
||||
public void updateCommonKey(MaatXmlConfig maatXmlConfig, RedisTemplate<String, String> redisTemplate) {
|
||||
List<MaatXmlSeq> seqList = maatXmlConfig.getSequenceList();
|
||||
for (MaatXmlSeq maatXmlSeq : seqList) {
|
||||
String seqKey = maatXmlSeq.getSequenceKey();
|
||||
@@ -345,69 +395,28 @@ public class ConfigRedisServiceimpl extends BaseRedisDao<String, String> impleme
|
||||
}
|
||||
|
||||
public Long getIncrId(String key) {
|
||||
//
|
||||
// connectionFactory.setDatabase(0);
|
||||
// redisTemplate.setConnectionFactory(connectionFactory);
|
||||
|
||||
// RedisAtomicLong atomicLong = new RedisAtomicLong(key,
|
||||
// redisTemplate.getConnectionFactory());
|
||||
//
|
||||
// Long id = atomicLong.getAndIncrement() + 1;
|
||||
// if ((id == null || id.longValue() == 0) && liveTime > 0) {
|
||||
// atomicLong.expire(liveTime, TimeUnit.SECONDS);
|
||||
// }
|
||||
// return id;
|
||||
setRedisDataBase(0, redisTemplate);
|
||||
// System.out.println(redisTemplate.getConnectionFactory());
|
||||
RedisTemplate<String, String> redisTemplate = SpringContextHolder.getBean("redisTemplate0");
|
||||
return redisTemplate.boundValueOps(key.toUpperCase()).increment(1l);
|
||||
// return redisTemplate.boundValueOps("MAAT_VERSION").increment(1l);
|
||||
}
|
||||
|
||||
public static Integer getRedisDBByService(Integer service) {
|
||||
Integer redisIndex = serviceDBIndexmap.get(service);
|
||||
if (redisIndex == null) {
|
||||
return 0;
|
||||
}
|
||||
return redisIndex;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据业务类型和具体的type获取对应的表名
|
||||
// * @param service 业务类型
|
||||
* @param type 10代表是编译配置,11代表是分组配置,12代表是ip类域配置,13代表是数值类配置,14代表是字符串类域配置,15代表是增强字符串类域配置
|
||||
* @return
|
||||
*/
|
||||
public static String getTableName(int service, int type) {
|
||||
Map<Integer, String> typeMap = sercieNameMap.get(service);
|
||||
if (typeMap != null && typeMap.size() > 0) {
|
||||
return typeMap.get(type);
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String filePath = "http://10.0.6.192/group1/M00/00/01/CgAGwFr9LriANfj6AADz3NN2rlY448.jpg";
|
||||
String substr = filePath.substring(filePath.indexOf("group"));
|
||||
String[] split = "maat_update_status".split(";");
|
||||
System.out.println(substr);
|
||||
|
||||
getRedisDBByService(80);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delUnMaatConfig(List<Long> compileIdList, int service) {
|
||||
if (compileIdList != null && compileIdList.size() > 0) {
|
||||
Integer redisDBIndex = getRedisDBByService(service);
|
||||
setRedisDataBase(redisDBIndex, redisTemplate);
|
||||
public void delUnMaatConfig(Map<Integer, Map<Integer, List<Long>>> idMap) {
|
||||
if (idMap != null && idMap.size() > 0) {
|
||||
for (Integer redisDBIndex : idMap.keySet()) {
|
||||
RedisTemplate<String, String> redisTemplate = SpringContextHolder
|
||||
.getBean("redisTemplate" + redisDBIndex);
|
||||
Map<Integer, List<Long>> serviceConfigMap = idMap.get(redisDBIndex);
|
||||
if (serviceConfigMap != null && serviceConfigMap.size() > 0) {
|
||||
String maatVersionStr = redisTemplate.opsForValue().get("MAAT_VERSION");
|
||||
if (maatVersionStr == null) {
|
||||
maatVersionStr = "0";
|
||||
}
|
||||
if (maatVersionStr != null) {
|
||||
Long maatVersion = Long.valueOf(maatVersionStr) + 1;
|
||||
for (Integer service : serviceConfigMap.keySet()) {
|
||||
List<Long> compileIdList = serviceConfigMap.get(service);
|
||||
if (compileIdList != null && compileIdList.size() > 0) {
|
||||
for (Long id : compileIdList) {
|
||||
MaatXmlConfig maatXmlConfig = ReadMaatXmlUtil.getMaatConfigByService(service);
|
||||
if (maatXmlConfig != null) {
|
||||
@@ -418,10 +427,12 @@ public class ConfigRedisServiceimpl extends BaseRedisDao<String, String> impleme
|
||||
StringBuffer keyBF = new StringBuffer();
|
||||
String[] keySplit = maatXmlExpr.getKeyExpression().split(";");
|
||||
for (String keyStr : keySplit) {
|
||||
if (!StringUtils.isEmpty(keyStr) && keyStr.toUpperCase().equals("EFFECTIVE_RULE")) {
|
||||
if (!StringUtils.isEmpty(keyStr)
|
||||
&& keyStr.toUpperCase().equals("EFFECTIVE_RULE")) {
|
||||
keyStr = "OBSOLETE_RULE";
|
||||
keyBF.append(keyStr.trim());
|
||||
} else if (!StringUtils.isEmpty(keyStr) && keyStr.trim().startsWith("[")) {
|
||||
} else if (!StringUtils.isEmpty(keyStr)
|
||||
&& keyStr.trim().startsWith("[")) {
|
||||
// keyStr = keyStr.trim().replace("[", "").replace("]", "");
|
||||
keyBF.append(id);
|
||||
} else {
|
||||
@@ -430,24 +441,29 @@ public class ConfigRedisServiceimpl extends BaseRedisDao<String, String> impleme
|
||||
}
|
||||
maatKey = keyBF.toString();
|
||||
String oldKey = maatKey.replace("OBSOLETE_RULE", "EFFECTIVE_RULE");
|
||||
redisTemplate.rename(oldKey.toString().toUpperCase(), keyBF.toString().toUpperCase());
|
||||
redisTemplate.rename(oldKey.toString().toUpperCase(),
|
||||
keyBF.toString().toUpperCase());
|
||||
break;
|
||||
}
|
||||
// redisTemplate.boundValueOps(keyBF.toString().toUpperCase()).set(valBF.toString());
|
||||
|
||||
}
|
||||
for (MaatXmlExpr maatXmlExpr : expressionList) {
|
||||
if (maatXmlExpr.getKeyExpression().toUpperCase().equals("MAAT_UPDATE_STATUS")) {
|
||||
if (maatXmlExpr.getKeyExpression().toUpperCase()
|
||||
.equals("MAAT_UPDATE_STATUS")) {
|
||||
String zset = maatKey.replace("OBSOLETE_RULE:", "DEL,");
|
||||
redisTemplate.boundZSetOps("MAAT_UPDATE_STATUS").add(zset, maatVersion);
|
||||
} else if (maatXmlExpr.getKeyExpression().toUpperCase().equals("MAAT_RULE_TIMER")) {
|
||||
} else if (maatXmlExpr.getKeyExpression().toUpperCase()
|
||||
.equals("MAAT_RULE_TIMER")) {
|
||||
Double score = 0d;// 界面下发的配置没有超时时间所以这里设置为0
|
||||
redisTemplate.boundZSetOps("MAAT_RULE_TIMER").add(maatKey, score);
|
||||
} else if (maatXmlExpr.getKeyExpression().toUpperCase().equals("MAAT_VERSION_TIMER")) {
|
||||
} else if (maatXmlExpr.getKeyExpression().toUpperCase()
|
||||
.equals("MAAT_VERSION_TIMER")) {
|
||||
Long nowTime = new Date().getTime();
|
||||
nowTime = nowTime / 1000l;
|
||||
Double score = nowTime.doubleValue();// 使用redis自带的time,得到当前时间的秒
|
||||
redisTemplate.boundZSetOps("MAAT_VERSION_TIMER").add(maatVersion + "", score);
|
||||
redisTemplate.boundZSetOps("MAAT_VERSION_TIMER").add(maatVersion + "",
|
||||
score);
|
||||
}
|
||||
}
|
||||
List<MaatXmlSeq> seqList = maatXmlConfig.getSequenceList();
|
||||
@@ -465,46 +481,49 @@ public class ConfigRedisServiceimpl extends BaseRedisDao<String, String> impleme
|
||||
}
|
||||
}
|
||||
}
|
||||
// redisTemplate.boundValueOps("MAAT_VERSION").set(maatVersion + "");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
redisTemplate.boundValueOps("MAAT_VERSION").increment(1l);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// @Override
|
||||
public void delMaatConfig(List<Long> compileIdList, int service) {
|
||||
if (compileIdList != null && compileIdList.size() > 0) {
|
||||
Integer redisDBIndex = getRedisDBByService(service);
|
||||
setRedisDataBase(redisDBIndex, redisTemplate);
|
||||
MaatRelation maatRelation = CompileGroupRegionRela.getIdRelationMap().get(redisDBIndex);
|
||||
|
||||
Map<Long, Set<Long>> compileAndGroupMap = maatRelation.getCompileAndGroupMap();
|
||||
Map<Long, Set<Long>> groupAndCompileMap = maatRelation.getGroupAndCompileMap();
|
||||
Map<Long, Set<Long>> groupAndRegionMap = maatRelation.getGroupAndRegionMap();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//
|
||||
// if (maatConfigList != null && maatConfigList.size() > 0) {
|
||||
// String maatVersionStr =
|
||||
// operRedisService.getMaatVersion(getRedisDBByService(service));
|
||||
// if (maatVersionStr != null) {
|
||||
// Long maatVersion = Long.valueOf(maatVersionStr) + 1;
|
||||
// for (MaatConfig maatConfig : maatConfigList) {
|
||||
// // Integer service = maatConfig.getService();
|
||||
// // if (service != null) {
|
||||
// setRedisDataBase(getRedisDBByService(service),
|
||||
// redisTemplate);
|
||||
// MaatXmlConfig maatXmlConfig =
|
||||
// ReadMaatXmlUtil.getMaatConfigByService(service);
|
||||
// setConfig(maatConfig, maatXmlConfig, maatVersion, service);
|
||||
// // }
|
||||
// }
|
||||
// redisTemplate.boundValueOps("MAAT_VERSION").set(maatVersion + "");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
@Override
|
||||
public void delMaatConfig(Map<Integer, Map<Integer, List<Long>>> idMap) {
|
||||
if (idMap != null && idMap.size() > 0) {
|
||||
for (Integer redisDBIndex : idMap.keySet()) {
|
||||
RedisTemplate<String, String> redisTemplate = SpringContextHolder
|
||||
.getBean("redisTemplate" + redisDBIndex);
|
||||
Map<Integer, List<Long>> serviceConfigMap = idMap.get(redisDBIndex);
|
||||
if (serviceConfigMap != null && serviceConfigMap.size() > 0) {
|
||||
String maatVersionStr = redisTemplate.opsForValue().get("MAAT_VERSION");
|
||||
if (maatVersionStr == null) {
|
||||
maatVersionStr = "0";
|
||||
}
|
||||
if (maatVersionStr != null) {
|
||||
Long maatVersion = Long.valueOf(maatVersionStr) + 1;
|
||||
for (Integer service : serviceConfigMap.keySet()) {
|
||||
|
||||
}
|
||||
|
||||
redisTemplate.boundValueOps("MAAT_VERSION").increment(1l);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delMaatRelation(List<Long> compileIdList, int service) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
package com.nis.web.service.restful;
|
||||
|
||||
import java.beans.IntrospectionException;
|
||||
import java.beans.PropertyDescriptor;
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.sql.Connection;
|
||||
import java.sql.SQLException;
|
||||
import java.text.ParseException;
|
||||
@@ -34,12 +40,14 @@ import com.nis.domain.restful.ConfigCompileTest;
|
||||
import com.nis.domain.restful.ConfigGroupRelation;
|
||||
import com.nis.domain.restful.DigestRegion;
|
||||
import com.nis.domain.restful.IpRegion;
|
||||
import com.nis.domain.restful.MaatConfig;
|
||||
import com.nis.domain.restful.NumRegion;
|
||||
import com.nis.domain.restful.StrRegion;
|
||||
import com.nis.restful.CompileJudgeCode;
|
||||
import com.nis.restful.RestBusinessCode;
|
||||
import com.nis.restful.RestServiceException;
|
||||
import com.nis.util.BasicProvingUtil;
|
||||
import com.nis.util.CamelUnderlineUtil;
|
||||
import com.nis.util.CompileVal;
|
||||
import com.nis.util.Configurations;
|
||||
import com.nis.util.OracleErrorCodeUtil;
|
||||
@@ -100,6 +108,36 @@ public class ConfigSourcesService extends BaseService {
|
||||
public static Map<Integer, Map<String, String>> getTableRelation() {
|
||||
Map<Integer, Map<String, String>> tableMap = new HashMap<Integer, Map<String, String>>();
|
||||
Map<String, String> typeMap = new HashMap<String, String>();
|
||||
typeMap.put("AV_CONT_IP_PORT", "ip");
|
||||
tableMap.put(80, typeMap);
|
||||
tableMap.put(144, typeMap);
|
||||
|
||||
typeMap = new HashMap<String, String>();
|
||||
typeMap.put("AV_CONT_URL", "str");
|
||||
tableMap.put(81, typeMap);
|
||||
tableMap.put(145, typeMap);
|
||||
|
||||
typeMap = new HashMap<String, String>();
|
||||
typeMap.put("AV_PIC_IP_PORT", "ip");
|
||||
tableMap.put(82, typeMap);
|
||||
tableMap.put(146, typeMap);
|
||||
|
||||
typeMap = new HashMap<String, String>();
|
||||
typeMap.put("AV_PIC_URL", "str");
|
||||
tableMap.put(83, typeMap);
|
||||
tableMap.put(147, typeMap);
|
||||
|
||||
typeMap = new HashMap<String, String>();
|
||||
typeMap.put("AV_VoIP_IP_PORT", "ip");
|
||||
tableMap.put(84, typeMap);
|
||||
tableMap.put(148, typeMap);
|
||||
|
||||
typeMap = new HashMap<String, String>();
|
||||
typeMap.put("AV_VoIP_ACCOUNT", "str");
|
||||
tableMap.put(85, typeMap);
|
||||
tableMap.put(149, typeMap);
|
||||
|
||||
typeMap = new HashMap<String, String>();
|
||||
typeMap.put("REUSE_IP", "ip");
|
||||
typeMap.put("HID_CONTENT", "ip");
|
||||
typeMap.put("GSB_PZ_IP", "ip");
|
||||
@@ -1056,11 +1094,220 @@ public class ConfigSourcesService extends BaseService {
|
||||
this.map = map;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
* jdbc方式添加和修改
|
||||
*
|
||||
* @Description:
|
||||
* @author (zdx)
|
||||
* @date 2018年5月25日 下午3:49:46
|
||||
* @param thread
|
||||
* @param start
|
||||
* @param configCompileList
|
||||
* @param sb
|
||||
* @return
|
||||
*/
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
public String saveMaatConfig(SaveRequestLogThread thread, long start, List<ConfigCompile> configCompileList,
|
||||
StringBuffer sb) {
|
||||
List<MaatConfig> maatConfigList = new ArrayList<MaatConfig>();
|
||||
List<Integer> serviceList = new ArrayList<Integer>();
|
||||
|
||||
for (ConfigCompile configCompile : configCompileList) {
|
||||
serviceList.add(Integer.valueOf(configCompile.getService().toString()));
|
||||
MaatConfig maatConfig = new MaatConfig();
|
||||
List<ConfigGroupRelation> groupRelationList = new ArrayList<ConfigGroupRelation>();
|
||||
List<StrRegion> strRegionList = new ArrayList<StrRegion>();
|
||||
List<StrRegion> strStrongRegionList = new ArrayList<StrRegion>();
|
||||
List<IpRegion> ipRegionList =new ArrayList<IpRegion>();
|
||||
List<NumRegion> numRegionList = new ArrayList<NumRegion>();
|
||||
List<DigestRegion> digestRegionList = new ArrayList<DigestRegion>();
|
||||
String msg = CompileVal.compileIsOk(configCompile, false, sb);
|
||||
if (msg != CompileJudgeCode.CompileIsOk.getErrorReason()) {
|
||||
logger1.error(msg);
|
||||
thread.setExceptionInfo(msg + sb.toString());
|
||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, msg + sb.toString(),
|
||||
RestBusinessCode.config_integrity_error.getValue());
|
||||
}
|
||||
|
||||
|
||||
if (null != configCompile.getGroupRelationList() && configCompile.getGroupRelationList().size() > 0) {
|
||||
groupRelationList.addAll(configCompile.getGroupRelationList());
|
||||
} else {
|
||||
logger1.error("配置分组数量不能为空" + sb.toString());
|
||||
thread.setExceptionInfo("配置分组数量不能为空" + sb.toString());
|
||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, "配置分组数量不能为空" + sb.toString(),
|
||||
RestBusinessCode.missing_args.getValue());
|
||||
}
|
||||
if (null != configCompile.getStrRegionList() && configCompile.getStrRegionList().size() > 0) {
|
||||
for (StrRegion strRegion : configCompile.getStrRegionList()) {
|
||||
if (!isStrStrongRegion(strRegion.getTableName())) {
|
||||
if (strRegion.getRegionId() == null) {
|
||||
String errorMsg = "字符类域配置id不能为空 ,表名---" + strRegion.getTableName() + "" + sb.toString();
|
||||
logger1.error(errorMsg);
|
||||
thread.setExceptionInfo(errorMsg);
|
||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, errorMsg,
|
||||
RestBusinessCode.missing_args.getValue());
|
||||
}
|
||||
strRegionList.add(strRegion);
|
||||
} else {
|
||||
if (strRegion.getRegionId() == null) {
|
||||
String errorMsg = "增强字符类域配置id不能为空 ,表名---" + strRegion.getTableName() + "" + sb.toString();
|
||||
logger1.error(errorMsg);
|
||||
thread.setExceptionInfo(errorMsg);
|
||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, errorMsg,
|
||||
RestBusinessCode.missing_args.getValue());
|
||||
}
|
||||
strStrongRegionList.add(strRegion);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (null != configCompile.getIpRegionList() && configCompile.getIpRegionList().size() > 0) {
|
||||
for (IpRegion ipRegion : configCompile.getIpRegionList()) {
|
||||
if (!ipRegion.getTableName().toUpperCase().equals("DJ_IP_PORT")) {
|
||||
ipRegion.setProtocol(0);
|
||||
}
|
||||
|
||||
if (ipRegion.getRegionId() == null) {
|
||||
String errorMsg = "ip类域配置id不能为空 ,表名---" + ipRegion.getTableName() + "" + sb.toString();
|
||||
logger1.error(errorMsg);
|
||||
thread.setExceptionInfo(errorMsg);
|
||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, errorMsg,
|
||||
RestBusinessCode.missing_args.getValue());
|
||||
}
|
||||
|
||||
ipRegionList.add(ipRegion);
|
||||
}
|
||||
}
|
||||
|
||||
if (null != configCompile.getNumRegionList() && configCompile.getNumRegionList().size() > 0) {
|
||||
for (NumRegion numRegion : configCompile.getNumRegionList()) {
|
||||
if (numRegion.getRegionId() == null) {
|
||||
String errorMsg = "数值类域配置id不能为空 ,表名---" + numRegion.getTableName() + "" + sb.toString();
|
||||
logger1.error(errorMsg);
|
||||
thread.setExceptionInfo(errorMsg);
|
||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, errorMsg,
|
||||
RestBusinessCode.missing_args.getValue());
|
||||
}
|
||||
numRegionList.add(numRegion);
|
||||
}
|
||||
}
|
||||
if (null != configCompile.getDigestRegionList() && configCompile.getDigestRegionList().size() > 0) {
|
||||
for (DigestRegion digestRegion : configCompile.getDigestRegionList()) {
|
||||
if (digestRegion.getRegionId() == null) {
|
||||
String errorMsg = "摘要类域配置id不能为空 ,表名---" + digestRegion.getTableName() + "" + sb.toString();
|
||||
logger1.error(errorMsg);
|
||||
thread.setExceptionInfo(errorMsg);
|
||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, errorMsg,
|
||||
RestBusinessCode.missing_args.getValue());
|
||||
}
|
||||
|
||||
digestRegionList.add(digestRegion);
|
||||
}
|
||||
}
|
||||
|
||||
maatConfig.setService(Integer.valueOf(configCompile.getService().toString()));
|
||||
//编译
|
||||
maatConfig.setCompileMap(convertObjectToMap(configCompile, ConfigCompile.class));
|
||||
//分组
|
||||
List<Map<String, String>> dstMaplList = null;
|
||||
if (!StringUtil.isEmpty(groupRelationList)) {
|
||||
dstMaplList = new ArrayList<Map<String,String>>();
|
||||
for (ConfigGroupRelation group : groupRelationList) {
|
||||
dstMaplList.add(convertObjectToMap(group, ConfigGroupRelation.class));
|
||||
}
|
||||
}
|
||||
maatConfig.setGroupMapList(dstMaplList);
|
||||
//字符串域
|
||||
dstMaplList = null;
|
||||
if (!StringUtil.isEmpty(strRegionList)) {
|
||||
dstMaplList = new ArrayList<Map<String,String>>();
|
||||
for (StrRegion region : strRegionList) {
|
||||
dstMaplList.add(convertObjectToMap(region, StrRegion.class));
|
||||
}
|
||||
}
|
||||
maatConfig.setStrRegionMapList(dstMaplList);
|
||||
//增强字符串域
|
||||
dstMaplList = null;
|
||||
if (!StringUtil.isEmpty(strStrongRegionList)) {
|
||||
dstMaplList = new ArrayList<Map<String,String>>();
|
||||
for (StrRegion region : strStrongRegionList) {
|
||||
dstMaplList.add(convertObjectToMap(region, StrRegion.class));
|
||||
}
|
||||
}
|
||||
maatConfig.setStrStrRegionMapList((dstMaplList));
|
||||
//数值域
|
||||
dstMaplList = null;
|
||||
if (!StringUtil.isEmpty(numRegionList)) {
|
||||
dstMaplList = new ArrayList<Map<String,String>>();
|
||||
for (NumRegion region : numRegionList) {
|
||||
dstMaplList.add(convertObjectToMap(region, NumRegion.class));
|
||||
}
|
||||
}
|
||||
maatConfig.setNumRegionMapList(dstMaplList);
|
||||
|
||||
//Ip域
|
||||
dstMaplList = null;
|
||||
if (!StringUtil.isEmpty(ipRegionList)) {
|
||||
dstMaplList = new ArrayList<Map<String,String>>();
|
||||
for (IpRegion region : ipRegionList) {
|
||||
dstMaplList.add(convertObjectToMap(region, IpRegion.class));
|
||||
}
|
||||
}
|
||||
maatConfig.setIpRegionMapList(dstMaplList);
|
||||
|
||||
//摘要类域
|
||||
dstMaplList = null;
|
||||
if (!StringUtil.isEmpty(digestRegionList)) {
|
||||
dstMaplList = new ArrayList<Map<String,String>>();
|
||||
for (DigestRegion region : digestRegionList) {
|
||||
dstMaplList.add(convertObjectToMap(region, DigestRegion.class));
|
||||
}
|
||||
}
|
||||
|
||||
maatConfig.setFileDigestRegionMapList(dstMaplList);
|
||||
dstMaplList = null;
|
||||
//文本相似性域
|
||||
maatConfig.setFileLikeRegionMapList(dstMaplList);
|
||||
maatConfigList.add(maatConfig);
|
||||
}
|
||||
if (!StringUtil.isEmpty(serviceList)&&serviceList.size()!=1) {
|
||||
String errorMsg = "只能添加单一service配置信息列表";
|
||||
logger1.error(errorMsg);
|
||||
thread.setExceptionInfo(errorMsg);
|
||||
throw new RestServiceException(thread, System.currentTimeMillis() - start, errorMsg,
|
||||
RestBusinessCode.op_action_error.getValue());
|
||||
}
|
||||
|
||||
//调用接口入redis
|
||||
configRedisService.saveMaatConfig(maatConfigList, serviceList.get(0));
|
||||
|
||||
return "ok";
|
||||
}
|
||||
private Map<String, String> convertObjectToMap(Object obj,Class clazz){
|
||||
Map<String,String> dstMap = new HashMap<String, String>();
|
||||
try {
|
||||
Field[] fields= obj.getClass().getDeclaredFields();
|
||||
for (Field field : fields) {
|
||||
if("serialVersionUID".equals(field.getName()))
|
||||
continue;
|
||||
String dstName = CamelUnderlineUtil.camelToUnderline(field.getName());
|
||||
PropertyDescriptor pd;
|
||||
pd = new PropertyDescriptor(field.getName(), clazz);
|
||||
Method method = pd.getReadMethod();
|
||||
Object dstObject = method.invoke(obj);
|
||||
if (dstObject instanceof Date) {
|
||||
dstObject = convertToTimeStamp16((Date)dstObject);
|
||||
}if(dstObject instanceof ArrayList){
|
||||
dstObject = "";
|
||||
}
|
||||
dstMap.put(dstName, StringUtil.isEmpty(dstObject)?"":dstObject.toString());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
logger1.error(e.getMessage());
|
||||
}
|
||||
return dstMap;
|
||||
}
|
||||
public String saveByJDBCThread(SaveRequestLogThread thread, long start, List<ConfigCompile> configCompileList,
|
||||
StringBuffer sb) {
|
||||
List<ConfigGroupRelation> groupRelationList = new ArrayList<ConfigGroupRelation>();
|
||||
@@ -1299,6 +1546,12 @@ public class ConfigSourcesService extends BaseService {
|
||||
return "ok";
|
||||
}
|
||||
|
||||
private String convertToTimeStamp16(Date date){
|
||||
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
return date.getTime()+"000";
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
* 批量(jdbc多线程方式)修改配置业务逻辑-->1:先进行基础配置验证传过来的json串是否符合格式(配置分组关系前端不能设置为无效,程序会根据传过来的编译配置和域配置等信息自动设置为无效).
|
||||
|
||||
@@ -35,7 +35,7 @@ public class JDBCTest {
|
||||
count++;
|
||||
Object[] obj = new Object[] { compile.getCompileId(), compile.getService(), compile.getAction(),
|
||||
compile.getContType(), compile.getAttrType(), compile.getContLabel(), compile.getTaskId(),
|
||||
compile.getGuaranteeId(), compile.getAffAirId(), compile.getTopIcId(), compile.getDoBlackList(),
|
||||
compile.getGuaranteeId(), compile.getAffairId(), compile.getTopicId(), compile.getDoBlacklist(),
|
||||
compile.getDoLog(), compile.getEffectiveRange(), compile.getActiveSys(), compile.getConfigPercent(),
|
||||
compile.getConfigOption(), compile.getStartTime(), compile.getEndTime(), compile.getUserRegion(),
|
||||
compile.getIsValid(), compile.getGroupNum(), compile.getFatherCfgId(), compile.getOpTime() };
|
||||
|
||||
@@ -181,8 +181,8 @@ public class JDBCThreadTest implements Runnable {
|
||||
count++;
|
||||
Object[] obj = new Object[] { compile.getCompileId(), compile.getService(), compile.getAction(),
|
||||
compile.getContType(), compile.getAttrType(), compile.getContLabel(), compile.getTaskId(),
|
||||
compile.getGuaranteeId(), compile.getAffAirId(), compile.getTopIcId(),
|
||||
compile.getDoBlackList(), compile.getDoLog(), compile.getEffectiveRange(),
|
||||
compile.getGuaranteeId(), compile.getAffairId(), compile.getTopicId(),
|
||||
compile.getDoBlacklist(), compile.getDoLog(), compile.getEffectiveRange(),
|
||||
compile.getActiveSys(), compile.getConfigPercent(), compile.getConfigOption(),
|
||||
compile.getStartTime(), compile.getEndTime(), compile.getUserRegion(), compile.getIsValid(),
|
||||
compile.getGroupNum(), compile.getFatherCfgId(), compile.getOpTime() };
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
package com.nis.web.service.restful;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.nis.datasource.DynamicJedisDataBase;
|
||||
import com.nis.web.dao.impl.BaseRedisDao;
|
||||
|
||||
@Service()
|
||||
public class OperRedisService extends BaseRedisDao<String, String> {
|
||||
|
||||
public String getMaatVersion1(int redisIndex) {
|
||||
//DynamicJedisDataBase.setRedisDataBase(redisIndex, redisTemplate);
|
||||
// RedisAtomicLong atomicLong = new RedisAtomicLong(key,
|
||||
// redisTemplate.getConnectionFactory());
|
||||
//
|
||||
// Long id = atomicLong.getAndIncrement() + 1;
|
||||
// if ((id == null || id.longValue() == 0) && liveTime > 0) {
|
||||
// atomicLong.expire(liveTime, TimeUnit.SECONDS);
|
||||
// }
|
||||
// return id;
|
||||
|
||||
return redisTemplate.opsForValue().get("MAAT_VERSION");
|
||||
|
||||
// return redisTemplate.boundValueOps("MAAT_VERSION").increment(1l);
|
||||
// return redisTemplate.boundValueOps("MAAT_VERSION").increment(1l);
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,7 @@ public class SpringJDBCTest {
|
||||
for (ConfigCompile compile : compileList) {
|
||||
bsu.update(new Object[] { compile.getCompileId(), compile.getService(), compile.getAction(),
|
||||
compile.getContType(), compile.getAttrType(), compile.getContLabel(), compile.getTaskId(),
|
||||
compile.getGuaranteeId(), compile.getAffAirId(), compile.getTopIcId(), compile.getDoBlackList(),
|
||||
compile.getGuaranteeId(), compile.getAffairId(), compile.getTopicId(), compile.getDoBlacklist(),
|
||||
compile.getDoLog(), compile.getEffectiveRange(), compile.getActiveSys(), compile.getConfigPercent(),
|
||||
compile.getConfigOption(), compile.getStartTime(), compile.getEndTime(), compile.getUserRegion(),
|
||||
compile.getIsValid(), compile.getGroupNum(), compile.getFatherCfgId(), compile.getOpTime() });
|
||||
|
||||
@@ -155,7 +155,7 @@ public class SpringJDBCThreadTest implements Runnable {
|
||||
for (ConfigCompile compile : compileList) {
|
||||
bsu.update(new Object[] { compile.getCompileId(), compile.getService(), compile.getAction(),
|
||||
compile.getContType(), compile.getAttrType(), compile.getContLabel(), compile.getTaskId(),
|
||||
compile.getGuaranteeId(), compile.getAffAirId(), compile.getTopIcId(), compile.getDoBlackList(),
|
||||
compile.getGuaranteeId(), compile.getAffairId(), compile.getTopicId(), compile.getDoBlacklist(),
|
||||
compile.getDoLog(), compile.getEffectiveRange(), compile.getActiveSys(), compile.getConfigPercent(),
|
||||
compile.getConfigOption(), compile.getStartTime(), compile.getEndTime(), compile.getUserRegion(),
|
||||
compile.getIsValid(), compile.getGroupNum(), compile.getFatherCfgId(), compile.getOpTime() });
|
||||
|
||||
@@ -155,7 +155,7 @@ public class SpringJDBCThreadTest2 implements Runnable {
|
||||
for (ConfigCompile compile : compileList) {
|
||||
bsu.update(new Object[] { compile.getCompileId(), compile.getService(), compile.getAction(),
|
||||
compile.getContType(), compile.getAttrType(), compile.getContLabel(), compile.getTaskId(),
|
||||
compile.getGuaranteeId(), compile.getAffAirId(), compile.getTopIcId(), compile.getDoBlackList(),
|
||||
compile.getGuaranteeId(), compile.getAffairId(), compile.getTopicId(), compile.getDoBlacklist(),
|
||||
compile.getDoLog(), compile.getEffectiveRange(), compile.getActiveSys(), compile.getConfigPercent(),
|
||||
compile.getConfigOption(), compile.getStartTime(), compile.getEndTime(), compile.getUserRegion(),
|
||||
compile.getIsValid(), compile.getGroupNum(), compile.getFatherCfgId(), compile.getOpTime() });
|
||||
|
||||
@@ -51,11 +51,23 @@
|
||||
class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory"
|
||||
p:host-name="${redis.host}" p:port="${redis.port}" p:pool-config-ref="poolConfig"
|
||||
p:database="4" />
|
||||
<bean id="connectionFactory5"
|
||||
class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory"
|
||||
p:host-name="${redis.host}" p:port="${redis.port}" p:pool-config-ref="poolConfig"
|
||||
p:database="5" />
|
||||
<bean id="connectionFactory6"
|
||||
class="org.springframework.data.redis.connection.jedis.JedisConnectionFactory"
|
||||
p:host-name="${redis.host}" p:port="${redis.port}" p:pool-config-ref="poolConfig"
|
||||
p:database="6" />
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<bean id="stringRedisSerializer"
|
||||
class="org.springframework.data.redis.serializer.StringRedisSerializer" />
|
||||
|
||||
<bean id="redisTemplate" class="org.springframework.data.redis.core.RedisTemplate">
|
||||
<bean id="redisTemplate0" class="org.springframework.data.redis.core.RedisTemplate">
|
||||
<property name="connectionFactory" ref="connectionFactory0" />
|
||||
<!-- 设置key和value的序列化方式,默认使用的是JdkSerializationRedisSerializer,key会被序列化为\xac\xed\x00\x056\x00 -->
|
||||
<property name="keySerializer" ref="stringRedisSerializer" />
|
||||
@@ -65,4 +77,75 @@
|
||||
<!-- 设置开启事务 -->
|
||||
<property name="enableTransactionSupport" value="true" />
|
||||
</bean>
|
||||
|
||||
|
||||
|
||||
|
||||
<bean id="redisTemplate1" class="org.springframework.data.redis.core.RedisTemplate">
|
||||
<property name="connectionFactory" ref="connectionFactory1" />
|
||||
<!-- 设置key和value的序列化方式,默认使用的是JdkSerializationRedisSerializer,key会被序列化为\xac\xed\x00\x056\x00 -->
|
||||
<property name="keySerializer" ref="stringRedisSerializer" />
|
||||
<property name="valueSerializer" ref="stringRedisSerializer" />
|
||||
<property name="hashKeySerializer" ref="stringRedisSerializer" />
|
||||
<property name="hashValueSerializer" ref="stringRedisSerializer" />
|
||||
<!-- 设置开启事务 -->
|
||||
<property name="enableTransactionSupport" value="true" />
|
||||
</bean>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<bean id="redisTemplate2" class="org.springframework.data.redis.core.RedisTemplate">
|
||||
<property name="connectionFactory" ref="connectionFactory2" />
|
||||
<!-- 设置key和value的序列化方式,默认使用的是JdkSerializationRedisSerializer,key会被序列化为\xac\xed\x00\x056\x00 -->
|
||||
<property name="keySerializer" ref="stringRedisSerializer" />
|
||||
<property name="valueSerializer" ref="stringRedisSerializer" />
|
||||
<property name="hashKeySerializer" ref="stringRedisSerializer" />
|
||||
<property name="hashValueSerializer" ref="stringRedisSerializer" />
|
||||
<!-- 设置开启事务 -->
|
||||
<property name="enableTransactionSupport" value="true" />
|
||||
</bean>
|
||||
|
||||
<bean id="redisTemplate3" class="org.springframework.data.redis.core.RedisTemplate">
|
||||
<property name="connectionFactory" ref="connectionFactory3" />
|
||||
<!-- 设置key和value的序列化方式,默认使用的是JdkSerializationRedisSerializer,key会被序列化为\xac\xed\x00\x056\x00 -->
|
||||
<property name="keySerializer" ref="stringRedisSerializer" />
|
||||
<property name="valueSerializer" ref="stringRedisSerializer" />
|
||||
<property name="hashKeySerializer" ref="stringRedisSerializer" />
|
||||
<property name="hashValueSerializer" ref="stringRedisSerializer" />
|
||||
<!-- 设置开启事务 -->
|
||||
<property name="enableTransactionSupport" value="true" />
|
||||
</bean>
|
||||
<bean id="redisTemplate4" class="org.springframework.data.redis.core.RedisTemplate">
|
||||
<property name="connectionFactory" ref="connectionFactory4" />
|
||||
<!-- 设置key和value的序列化方式,默认使用的是JdkSerializationRedisSerializer,key会被序列化为\xac\xed\x00\x056\x00 -->
|
||||
<property name="keySerializer" ref="stringRedisSerializer" />
|
||||
<property name="valueSerializer" ref="stringRedisSerializer" />
|
||||
<property name="hashKeySerializer" ref="stringRedisSerializer" />
|
||||
<property name="hashValueSerializer" ref="stringRedisSerializer" />
|
||||
<!-- 设置开启事务 -->
|
||||
<property name="enableTransactionSupport" value="true" />
|
||||
</bean>
|
||||
<bean id="redisTemplate5" class="org.springframework.data.redis.core.RedisTemplate">
|
||||
<property name="connectionFactory" ref="connectionFactory5" />
|
||||
<!-- 设置key和value的序列化方式,默认使用的是JdkSerializationRedisSerializer,key会被序列化为\xac\xed\x00\x056\x00 -->
|
||||
<property name="keySerializer" ref="stringRedisSerializer" />
|
||||
<property name="valueSerializer" ref="stringRedisSerializer" />
|
||||
<property name="hashKeySerializer" ref="stringRedisSerializer" />
|
||||
<property name="hashValueSerializer" ref="stringRedisSerializer" />
|
||||
<!-- 设置开启事务 -->
|
||||
<property name="enableTransactionSupport" value="true" />
|
||||
</bean>
|
||||
<bean id="redisTemplate6" class="org.springframework.data.redis.core.RedisTemplate">
|
||||
<property name="connectionFactory" ref="connectionFactory6" />
|
||||
<!-- 设置key和value的序列化方式,默认使用的是JdkSerializationRedisSerializer,key会被序列化为\xac\xed\x00\x056\x00 -->
|
||||
<property name="keySerializer" ref="stringRedisSerializer" />
|
||||
<property name="valueSerializer" ref="stringRedisSerializer" />
|
||||
<property name="hashKeySerializer" ref="stringRedisSerializer" />
|
||||
<property name="hashValueSerializer" ref="stringRedisSerializer" />
|
||||
<!-- 设置开启事务 -->
|
||||
<property name="enableTransactionSupport" value="true" />
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
|
||||
@@ -10,5 +10,5 @@ fastdfs.http_secret_key = FastDFS1234567890
|
||||
fastdfs.http_tracker_http_port = 80
|
||||
|
||||
#fastdfs.tracker_servers = 10.0.11.201:22122,10.0.11.202:22122,10.0.11.203:22122
|
||||
fastdfs.tracker_servers = 10.0.6.192:22122
|
||||
|
||||
#fastdfs.tracker_servers = 10.0.6.192:22122
|
||||
fastdfs.tracker_servers = 10.0.6.249:22122
|
||||
|
||||
@@ -5,6 +5,6 @@ http.tracker_http_port = 8080
|
||||
http.anti_steal_token = no
|
||||
http.secret_key = FastDFS1234567890
|
||||
|
||||
tracker_server = 10.0.6.192:22122
|
||||
tracker_server = 10.0.6.249:22122
|
||||
#tracker_server = 10.0.11.248:22122
|
||||
#tracker_server = 10.0.11.249:22122
|
||||
|
||||
@@ -132,7 +132,7 @@ jdbc.test.password=OrTu/cLwlduYPW/tmxqNgQ==
|
||||
redis.host=10.0.6.249
|
||||
redis.port=6379
|
||||
redis.pass=
|
||||
redis.maxIdle=100
|
||||
redis.maxTotal=150
|
||||
redis.maxIdle=200
|
||||
redis.maxTotal=250
|
||||
redis.maxWaitMillis=1000
|
||||
redis.testOnBorrow=true
|
||||
|
||||
@@ -10,7 +10,7 @@ service=80;81;82;83;84;85;144;145;146;147;148;149
|
||||
|
||||
|
||||
|
||||
80=10:AV_CONFIG_COMPILE;11:AV_CONFIG_GROUP;12:AV_CONT_IP_PORT
|
||||
80=10:AV_CONFIG_COMPILE;11:AV_CONFIG_GROUP;12:AV_CONT_IP_PORT,AV_CONT_URL
|
||||
81=10:AV_CONFIG_COMPILE;11:AV_CONFIG_GROUP;14:AV_CONT_URL
|
||||
82=10:AV_CONFIG_COMPILE;11:AV_CONFIG_GROUP;12:AV_PIC_IP_PORT
|
||||
83=10:AV_CONFIG_COMPILE;11:AV_CONFIG_GROUP;13:AV_PIC_URL
|
||||
|
||||
Reference in New Issue
Block a user