|
@@ -1,9 +1,13 @@
|
|
package cn.iselab.mooctest.site.web.ctrl;
|
|
package cn.iselab.mooctest.site.web.ctrl;
|
|
|
|
|
|
import cn.iselab.mooctest.site.common.constant.UrlConstants;
|
|
import cn.iselab.mooctest.site.common.constant.UrlConstants;
|
|
|
|
+import cn.iselab.mooctest.site.service.TargetGraphService;
|
|
|
|
+import cn.iselab.mooctest.site.web.data.forMongo.TargetGraphDTO;
|
|
|
|
+import cn.iselab.mooctest.site.web.data.forMongo.caseGraph.Category;
|
|
import cn.iselab.mooctest.site.web.data.internal.*;
|
|
import cn.iselab.mooctest.site.web.data.internal.*;
|
|
import cn.iselab.mooctest.site.web.logic.ApiLogic;
|
|
import cn.iselab.mooctest.site.web.logic.ApiLogic;
|
|
import cn.iselab.mooctest.site.web.logic.WechatLogic;
|
|
import cn.iselab.mooctest.site.web.logic.WechatLogic;
|
|
|
|
+import com.google.gson.Gson;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -11,6 +15,8 @@ import org.springframework.web.bind.annotation.RequestMethod;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @author sean
|
|
* @author sean
|
|
@@ -26,7 +32,8 @@ public class WechatController extends BaseController {
|
|
@Autowired
|
|
@Autowired
|
|
private WechatLogic wechatLogic;
|
|
private WechatLogic wechatLogic;
|
|
|
|
|
|
-
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private TargetGraphService targetGraphService;
|
|
/**
|
|
/**
|
|
*
|
|
*
|
|
* GET methods
|
|
* GET methods
|
|
@@ -111,4 +118,246 @@ public class WechatController extends BaseController {
|
|
public String joinGroup(HttpServletRequest request, @RequestBody JoinGroupWechatVO body) {
|
|
public String joinGroup(HttpServletRequest request, @RequestBody JoinGroupWechatVO body) {
|
|
return wechatLogic.joinGroup(request, body);
|
|
return wechatLogic.joinGroup(request, body);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @RequestMapping(value = UrlConstants.API_WECHAT + "test", method = RequestMethod.GET)
|
|
|
|
+ public String Test(){
|
|
|
|
+ String str="{\n" +
|
|
|
|
+ " \"categories\": [\n" +
|
|
|
|
+ " {\n" +
|
|
|
|
+ " \"name\": \"mutation\"\n" +
|
|
|
|
+ " }\n" +
|
|
|
|
+ " ],\n" +
|
|
|
|
+ " \"nodes\": [\n" +
|
|
|
|
+ " {\n" +
|
|
|
|
+ " \"name\": \"Triangle.java_1\",\n" +
|
|
|
|
+ " \"description\": \"changed conditional boundary \",\n" +
|
|
|
|
+ " \"location\": \"Triangle.java/29\",\n" +
|
|
|
|
+ " \"category\": \"mutation\",\n" +
|
|
|
|
+ " \"img\": null\n" +
|
|
|
|
+ " },\n" +
|
|
|
|
+ " {\n" +
|
|
|
|
+ " \"name\": \"Triangle.java_2\",\n" +
|
|
|
|
+ " \"description\": \"changed conditional boundary \",\n" +
|
|
|
|
+ " \"location\": \"Triangle.java/29\",\n" +
|
|
|
|
+ " \"category\": \"mutation\",\n" +
|
|
|
|
+ " \"img\": null\n" +
|
|
|
|
+ " },\n" +
|
|
|
|
+ " {\n" +
|
|
|
|
+ " \"name\": \"Triangle.java_3\",\n" +
|
|
|
|
+ " \"description\": \"changed conditional boundary \",\n" +
|
|
|
|
+ " \"location\": \"Triangle.java/29\",\n" +
|
|
|
|
+ " \"category\": \"mutation\",\n" +
|
|
|
|
+ " \"img\": null\n" +
|
|
|
|
+ " },\n" +
|
|
|
|
+ " {\n" +
|
|
|
|
+ " \"name\": \"Triangle.java_4\",\n" +
|
|
|
|
+ " \"description\": \"changed conditional boundary \",\n" +
|
|
|
|
+ " \"location\": \"Triangle.java/29\",\n" +
|
|
|
|
+ " \"category\": \"mutation\",\n" +
|
|
|
|
+ " \"img\": null\n" +
|
|
|
|
+ " },\n" +
|
|
|
|
+ " {\n" +
|
|
|
|
+ " \"name\": \"Triangle.java_5\",\n" +
|
|
|
|
+ " \"description\": \"changed conditional boundary \",\n" +
|
|
|
|
+ " \"location\": \"Triangle.java/29\",\n" +
|
|
|
|
+ " \"category\": \"mutation\",\n" +
|
|
|
|
+ " \"img\": null\n" +
|
|
|
|
+ " },\n" +
|
|
|
|
+ " {\n" +
|
|
|
|
+ " \"name\": \"Triangle.java_6\",\n" +
|
|
|
|
+ " \"description\": \"changed conditional boundary \",\n" +
|
|
|
|
+ " \"location\": \"Triangle.java/29\",\n" +
|
|
|
|
+ " \"category\": \"mutation\",\n" +
|
|
|
|
+ " \"img\": null\n" +
|
|
|
|
+ " },\n" +
|
|
|
|
+ " {\n" +
|
|
|
|
+ " \"name\": \"Triangle.java_7\",\n" +
|
|
|
|
+ " \"description\": \"negated conditional \",\n" +
|
|
|
|
+ " \"location\": \"Triangle.java/29\",\n" +
|
|
|
|
+ " \"category\": \"mutation\",\n" +
|
|
|
|
+ " \"img\": null\n" +
|
|
|
|
+ " },\n" +
|
|
|
|
+ " {\n" +
|
|
|
|
+ " \"name\": \"Triangle.java_8\",\n" +
|
|
|
|
+ " \"description\": \"negated conditional \",\n" +
|
|
|
|
+ " \"location\": \"Triangle.java/29\",\n" +
|
|
|
|
+ " \"category\": \"mutation\",\n" +
|
|
|
|
+ " \"img\": null\n" +
|
|
|
|
+ " },\n" +
|
|
|
|
+ " {\n" +
|
|
|
|
+ " \"name\": \"Triangle.java_9\",\n" +
|
|
|
|
+ " \"description\": \"negated conditional \",\n" +
|
|
|
|
+ " \"location\": \"Triangle.java/29\",\n" +
|
|
|
|
+ " \"category\": \"mutation\",\n" +
|
|
|
|
+ " \"img\": null\n" +
|
|
|
|
+ " },\n" +
|
|
|
|
+ " {\n" +
|
|
|
|
+ " \"name\": \"Triangle.java_10\",\n" +
|
|
|
|
+ " \"description\": \"negated conditional \",\n" +
|
|
|
|
+ " \"location\": \"Triangle.java/29\",\n" +
|
|
|
|
+ " \"category\": \"mutation\",\n" +
|
|
|
|
+ " \"img\": null\n" +
|
|
|
|
+ " },\n" +
|
|
|
|
+ " {\n" +
|
|
|
|
+ " \"name\": \"Triangle.java_11\",\n" +
|
|
|
|
+ " \"description\": \"negated conditional \",\n" +
|
|
|
|
+ " \"location\": \"Triangle.java/29\",\n" +
|
|
|
|
+ " \"category\": \"mutation\",\n" +
|
|
|
|
+ " \"img\": null\n" +
|
|
|
|
+ " },\n" +
|
|
|
|
+ " {\n" +
|
|
|
|
+ " \"name\": \"Triangle.java_12\",\n" +
|
|
|
|
+ " \"description\": \"negated conditional \",\n" +
|
|
|
|
+ " \"location\": \"Triangle.java/29\",\n" +
|
|
|
|
+ " \"category\": \"mutation\",\n" +
|
|
|
|
+ " \"img\": null\n" +
|
|
|
|
+ " },\n" +
|
|
|
|
+ " {\n" +
|
|
|
|
+ " \"name\": \"Triangle.java_14\",\n" +
|
|
|
|
+ " \"description\": \"changed conditional boundary \",\n" +
|
|
|
|
+ " \"location\": \"Triangle.java/34\",\n" +
|
|
|
|
+ " \"category\": \"mutation\",\n" +
|
|
|
|
+ " \"img\": null\n" +
|
|
|
|
+ " },\n" +
|
|
|
|
+ " {\n" +
|
|
|
|
+ " \"name\": \"Triangle.java_15\",\n" +
|
|
|
|
+ " \"description\": \"negated conditional \",\n" +
|
|
|
|
+ " \"location\": \"Triangle.java/34\",\n" +
|
|
|
|
+ " \"category\": \"mutation\",\n" +
|
|
|
|
+ " \"img\": null\n" +
|
|
|
|
+ " },\n" +
|
|
|
|
+ " {\n" +
|
|
|
|
+ " \"name\": \"Triangle.java_17\",\n" +
|
|
|
|
+ " \"description\": \"changed conditional boundary \",\n" +
|
|
|
|
+ " \"location\": \"Triangle.java/35\",\n" +
|
|
|
|
+ " \"category\": \"mutation\",\n" +
|
|
|
|
+ " \"img\": null\n" +
|
|
|
|
+ " },\n" +
|
|
|
|
+ " {\n" +
|
|
|
|
+ " \"name\": \"Triangle.java_18\",\n" +
|
|
|
|
+ " \"description\": \"negated conditional \",\n" +
|
|
|
|
+ " \"location\": \"Triangle.java/35\",\n" +
|
|
|
|
+ " \"category\": \"mutation\",\n" +
|
|
|
|
+ " \"img\": null\n" +
|
|
|
|
+ " },\n" +
|
|
|
|
+ " {\n" +
|
|
|
|
+ " \"name\": \"Triangle.java_20\",\n" +
|
|
|
|
+ " \"description\": \"changed conditional boundary \",\n" +
|
|
|
|
+ " \"location\": \"Triangle.java/36\",\n" +
|
|
|
|
+ " \"category\": \"mutation\",\n" +
|
|
|
|
+ " \"img\": null\n" +
|
|
|
|
+ " },\n" +
|
|
|
|
+ " {\n" +
|
|
|
|
+ " \"name\": \"Triangle.java_21\",\n" +
|
|
|
|
+ " \"description\": \"negated conditional \",\n" +
|
|
|
|
+ " \"location\": \"Triangle.java/36\",\n" +
|
|
|
|
+ " \"category\": \"mutation\",\n" +
|
|
|
|
+ " \"img\": null\n" +
|
|
|
|
+ " },\n" +
|
|
|
|
+ " {\n" +
|
|
|
|
+ " \"name\": \"Triangle.java_23\",\n" +
|
|
|
|
+ " \"description\": \"replaced return of integer sized value with (x == 0 ? 1 : 0) \",\n" +
|
|
|
|
+ " \"location\": \"Triangle.java/41\",\n" +
|
|
|
|
+ " \"category\": \"mutation\",\n" +
|
|
|
|
+ " \"img\": null\n" +
|
|
|
|
+ " },\n" +
|
|
|
|
+ " {\n" +
|
|
|
|
+ " \"name\": \"Triangle.java_25\",\n" +
|
|
|
|
+ " \"description\": \"negated conditional \",\n" +
|
|
|
|
+ " \"location\": \"Triangle.java/52\",\n" +
|
|
|
|
+ " \"category\": \"mutation\",\n" +
|
|
|
|
+ " \"img\": null\n" +
|
|
|
|
+ " },\n" +
|
|
|
|
+ " {\n" +
|
|
|
|
+ " \"name\": \"Triangle.java_27\",\n" +
|
|
|
|
+ " \"description\": \"negated conditional \",\n" +
|
|
|
|
+ " \"location\": \"Triangle.java/54\",\n" +
|
|
|
|
+ " \"category\": \"mutation\",\n" +
|
|
|
|
+ " \"img\": null\n" +
|
|
|
|
+ " },\n" +
|
|
|
|
+ " {\n" +
|
|
|
|
+ " \"name\": \"Triangle.java_28\",\n" +
|
|
|
|
+ " \"description\": \"negated conditional \",\n" +
|
|
|
|
+ " \"location\": \"Triangle.java/54\",\n" +
|
|
|
|
+ " \"category\": \"mutation\",\n" +
|
|
|
|
+ " \"img\": null\n" +
|
|
|
|
+ " },\n" +
|
|
|
|
+ " {\n" +
|
|
|
|
+ " \"name\": \"Triangle.java_30\",\n" +
|
|
|
|
+ " \"description\": \"negated conditional \",\n" +
|
|
|
|
+ " \"location\": \"Triangle.java/59\",\n" +
|
|
|
|
+ " \"category\": \"mutation\",\n" +
|
|
|
|
+ " \"img\": null\n" +
|
|
|
|
+ " },\n" +
|
|
|
|
+ " {\n" +
|
|
|
|
+ " \"name\": \"Triangle.java_31\",\n" +
|
|
|
|
+ " \"description\": \"negated conditional \",\n" +
|
|
|
|
+ " \"location\": \"Triangle.java/59\",\n" +
|
|
|
|
+ " \"category\": \"mutation\",\n" +
|
|
|
|
+ " \"img\": null\n" +
|
|
|
|
+ " },\n" +
|
|
|
|
+ " {\n" +
|
|
|
|
+ " \"name\": \"Triangle.java_32\",\n" +
|
|
|
|
+ " \"description\": \"negated conditional \",\n" +
|
|
|
|
+ " \"location\": \"Triangle.java/59\",\n" +
|
|
|
|
+ " \"category\": \"mutation\",\n" +
|
|
|
|
+ " \"img\": null\n" +
|
|
|
|
+ " },\n" +
|
|
|
|
+ " {\n" +
|
|
|
|
+ " \"name\": \"Triangle.java_34\",\n" +
|
|
|
|
+ " \"description\": \"mutated return of Object value for net/mooctest/mutation/analysis/Triangle::getType to ( if (x != null) null else throw new RuntimeException ) \",\n" +
|
|
|
|
+ " \"location\": \"Triangle.java/70\",\n" +
|
|
|
|
+ " \"category\": \"mutation\",\n" +
|
|
|
|
+ " \"img\": null\n" +
|
|
|
|
+ " },\n" +
|
|
|
|
+ " {\n" +
|
|
|
|
+ " \"name\": \"Triangle.java_36\",\n" +
|
|
|
|
+ " \"description\": \"changed conditional boundary \",\n" +
|
|
|
|
+ " \"location\": \"Triangle.java/78\",\n" +
|
|
|
|
+ " \"category\": \"mutation\",\n" +
|
|
|
|
+ " \"img\": null\n" +
|
|
|
|
+ " },\n" +
|
|
|
|
+ " {\n" +
|
|
|
|
+ " \"name\": \"Triangle.java_37\",\n" +
|
|
|
|
+ " \"description\": \"Replaced long subtraction with addition \",\n" +
|
|
|
|
+ " \"location\": \"Triangle.java/78\",\n" +
|
|
|
|
+ " \"category\": \"mutation\",\n" +
|
|
|
|
+ " \"img\": null\n" +
|
|
|
|
+ " },\n" +
|
|
|
|
+ " {\n" +
|
|
|
|
+ " \"name\": \"Triangle.java_38\",\n" +
|
|
|
|
+ " \"description\": \"Replaced long subtraction with addition \",\n" +
|
|
|
|
+ " \"location\": \"Triangle.java/78\",\n" +
|
|
|
|
+ " \"category\": \"mutation\",\n" +
|
|
|
|
+ " \"img\": null\n" +
|
|
|
|
+ " },\n" +
|
|
|
|
+ " {\n" +
|
|
|
|
+ " \"name\": \"Triangle.java_39\",\n" +
|
|
|
|
+ " \"description\": \"negated conditional \",\n" +
|
|
|
|
+ " \"location\": \"Triangle.java/78\",\n" +
|
|
|
|
+ " \"category\": \"mutation\",\n" +
|
|
|
|
+ " \"img\": null\n" +
|
|
|
|
+ " },\n" +
|
|
|
|
+ " {\n" +
|
|
|
|
+ " \"name\": \"Triangle.java_40\",\n" +
|
|
|
|
+ " \"description\": \"replaced return of long value with value + 1 for net/mooctest/mutation/analysis/Triangle::diffOfBorders \",\n" +
|
|
|
|
+ " \"location\": \"Triangle.java/78\",\n" +
|
|
|
|
+ " \"category\": \"mutation\",\n" +
|
|
|
|
+ " \"img\": null\n" +
|
|
|
|
+ " },\n" +
|
|
|
|
+ " {\n" +
|
|
|
|
+ " \"name\": \"Triangle.java_42\",\n" +
|
|
|
|
+ " \"description\": \"mutated return of Object value for net/mooctest/mutation/analysis/Triangle::getBorders to ( if (x != null) null else throw new RuntimeException ) \",\n" +
|
|
|
|
+ " \"location\": \"Triangle.java/89\",\n" +
|
|
|
|
+ " \"category\": \"mutation\",\n" +
|
|
|
|
+ " \"img\": null\n" +
|
|
|
|
+ " }\n" +
|
|
|
|
+ " ],\n" +
|
|
|
|
+ " \"edges\": null\n" +
|
|
|
|
+ "}";
|
|
|
|
+ TargetGraphDTO dto=new Gson().fromJson(str,TargetGraphDTO.class);
|
|
|
|
+ dto.setTargetId(419L);
|
|
|
|
+ targetGraphService.saveTargetGraphJson(dto);
|
|
|
|
+ return "ok";
|
|
|
|
+ }
|
|
}
|
|
}
|