Commit 758c5c3e by caojingji

修改数据库连接为线上正式库地址

parent 71751c14
package com.founder.interservice.protogenesis.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.founder.interservice.VO.ResultVO;
......@@ -255,4 +256,70 @@ public class ProtoController {
}
return resultVO;
}
//多区域碰撞分析统计-发送任务
@RequestMapping(value = "/sendMultiResionalsAnalyTask",method = {RequestMethod.GET})
@ResponseBody
public ResultVO sendMultiResionalsAnalyTask(String param){
ResultVO resultVO = null;
try{
String result = protoService.doPostWaData("multiRegionalsAnalyseTask",param);
resultVO = ResultVOUtil.success(result);
}catch (InterServiceException e){
resultVO = ResultVOUtil.error(e.getCode(),e.getMessage(),e);
}
return resultVO;
}
//多区域碰撞分析统计-获取结果
@RequestMapping(value = "/getMultiResionalsAnalyTask",method = {RequestMethod.GET})
@ResponseBody
public ResultVO getMultiResionalsAnalyTask(String taskId){
ResultVO resultVO = null;
try{
JSONObject param = new JSONObject();
param.put("taskId",taskId);
String result = protoService.doPostWaData("multiRegionalsAnalyseTaskFetch",param.toJSONString());
resultVO = ResultVOUtil.success(result);
}catch (InterServiceException e){
resultVO = ResultVOUtil.error(e.getCode(),e.getMessage(),e);
}
return resultVO;
}
/**
* 获取任务状态
* @param taskId
* @return
*/
@RequestMapping(value = "/getTaskStatus",method = {RequestMethod.GET})
@ResponseBody
public ResultVO getTaskStatus(String taskId){
ResultVO resultVO = null;
try{
JSONObject param = new JSONObject();
param.put("taskId",taskId);
String result = protoService.doPostWaData("taskStatus",param.toJSONString());
resultVO = ResultVOUtil.success(result);
}catch (InterServiceException e){
resultVO = ResultVOUtil.error(e.getCode(),e.getMessage(),e);
}
return resultVO;
}
@RequestMapping(value = "/getObjectRelation",method = {RequestMethod.GET})
@ResponseBody
public ResultVO getObjectRelation(String caseId,String caseName,String username,String objectValue){
ResultVO resultVO = null;
try{
JSONObject param = new JSONObject();
param.put("caseId",caseId);
param.put("caseName", caseName);
param.put("username", username);
param.put("objectValue", objectValue);
String result = protoService.doPostWaData("objectRelation",param.toJSONString());
resultVO = ResultVOUtil.success(result);
}catch (InterServiceException e){
resultVO = ResultVOUtil.error(e.getCode(),e.getMessage(),e);
}
return resultVO;
}
}
......@@ -26,4 +26,6 @@ public interface ProtoService {
String getDzgzTaskStatus(String taskId);
String getDzgzTaskInfos(String taskId);
public String doPostWaData(String urlName,String param) throws InterServiceException;
}
......@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.founder.interservice.enums.ResultEnum;
import com.founder.interservice.exception.InterServiceException;
import com.founder.interservice.protogenesis.service.ProtoService;
import com.founder.interservice.util.HttpClientUtils;
import com.founder.interservice.util.HttpUtil;
import com.founder.interservice.util.StringUtil;
import org.springframework.beans.factory.annotation.Value;
......@@ -41,6 +42,9 @@ public class ProtoServiceImpl implements ProtoService {
@Value("${wabigdata.fixedEvidenceByRegionTaskFetch.url}")
private String DZGZ_INFO_URL;
@Value("${wabigdata.unified.url}")
private String UNIFIED_URL;
/**
* 获取远程的网安数据轨迹数据 不做任何操作
* @param obj
......@@ -262,4 +266,16 @@ public class ProtoServiceImpl implements ProtoService {
throw new InterServiceException(ResultEnum.RESULT_ERROR.getCode(),ResultEnum.RESULT_ERROR.getMessage());
}
}
@Override
public String doPostWaData(String urlName,String param) throws InterServiceException {
try{
String url = UNIFIED_URL + urlName;
String result = HttpClientUtils.doPostWaData(url,param);
return result;
}catch (InterServiceException e){
e.printStackTrace();
throw new InterServiceException(ResultEnum.RESULT_ERROR.getCode(),ResultEnum.RESULT_ERROR.getMessage());
}
}
}
......@@ -15,8 +15,6 @@ import org.apache.http.util.EntityUtils;
import java.io.*;
import java.net.URI;
import java.net.URL;
import java.net.URLEncoder;
import java.util.*;
public class HttpUtil {
......@@ -156,7 +154,7 @@ public class HttpUtil {
return resultString.trim();
}
public static void main(String[] args) {
try {
Date date1=new Date();
......
......@@ -51,6 +51,8 @@ xdhbigdata:
cjServiceId: XDHDS0004
getCjDataServiceId: XDHWS0022
wabigdata:
unified:
url: http://www.adu.cq:8071/doc/api/api/
objectrelation:
url: http://www.adu.cq:8608/api?name=objectRelation&key=88f3f909655065532073c41b0f1784df
gettrack:
......
apikey=fb5aaf49482721d6c495d3ae26796216
username=xjzd-fangzheng
token_url=http://www.adu.cq:8071/doc/token/token
token=
expiration=
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment