|
@@ -1,37 +1,21 @@
|
|
|
-package org.diagbot.graphWeb.controller;
|
|
|
+package org.diagbot.graphWeb.work;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
-import org.diagbot.graph.jdbc.DriverManager;
|
|
|
-import org.diagbot.graph.jdbc.Neo4jAPI;
|
|
|
import org.diagbot.common.work.FeatureRate;
|
|
|
-import org.diagbot.graphWeb.work.ParamsDataProxy;
|
|
|
import org.diagbot.common.work.ResponseData;
|
|
|
import org.diagbot.common.work.SearchData;
|
|
|
-import org.diagbot.nlp.feature.FeatureAnalyze;
|
|
|
-import org.diagbot.nlp.feature.FeatureType;
|
|
|
-import org.diagbot.pub.api.Response;
|
|
|
-import org.springframework.stereotype.Controller;
|
|
|
-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.ResponseBody;
|
|
|
+import org.diagbot.graph.jdbc.DriverManager;
|
|
|
+import org.diagbot.graph.jdbc.Neo4jAPI;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
-import java.util.*;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+import java.util.Set;
|
|
|
|
|
|
-@Controller
|
|
|
-@RequestMapping("/graph")
|
|
|
-public class PushController {
|
|
|
- @RequestMapping(value = "/push", method = RequestMethod.POST)
|
|
|
- @ResponseBody
|
|
|
- public Response<ResponseData> bayesPageData(HttpServletRequest request, @RequestBody SearchData searchData) throws Exception {
|
|
|
- Response<ResponseData> response = new Response();
|
|
|
- ResponseData responseData = this.calculate(request, searchData);
|
|
|
- response.setData(responseData);
|
|
|
- return response;
|
|
|
- }
|
|
|
+public class GraphCalculate {
|
|
|
public ResponseData calculate(HttpServletRequest request, SearchData searchData) throws Exception {
|
|
|
ResponseData responseData = new ResponseData();
|
|
|
ParamsDataProxy paramsDataProxy = new ParamsDataProxy();
|
|
@@ -49,7 +33,7 @@ public class PushController {
|
|
|
Map<String, String> condition = neo4jAPI.getCondition((String[]) inputList.toArray(new String[inputList.size()]));
|
|
|
List<FeatureRate> featureRates = new ArrayList<>();
|
|
|
for (Map.Entry<String,String> d:condition.entrySet()
|
|
|
- ) {
|
|
|
+ ) {
|
|
|
FeatureRate featureRate = new FeatureRate();
|
|
|
featureRate.setFeatureName(d.getKey());
|
|
|
featureRate.setExtraProperty("");
|
|
@@ -70,4 +54,3 @@ public class PushController {
|
|
|
return responseData;
|
|
|
}
|
|
|
}
|
|
|
-
|