|
@@ -7,6 +7,8 @@ import java.util.*;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.servlet.http.HttpSession;
|
|
|
|
|
|
+import edu.nju.entities.BugSimilarScore;
|
|
|
+import edu.nju.service.*;
|
|
|
import org.json.JSONArray;
|
|
|
import org.json.JSONObject;
|
|
|
import org.slf4j.Logger;
|
|
@@ -19,10 +21,6 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
import edu.nju.entities.Bug;
|
|
|
import edu.nju.entities.BugMirror;
|
|
|
-import edu.nju.service.DivRecService;
|
|
|
-import edu.nju.service.HistoryService;
|
|
|
-import edu.nju.service.RecommendService;
|
|
|
-import edu.nju.service.UserBasedService;
|
|
|
|
|
|
import java.util.Map.Entry;
|
|
|
|
|
@@ -42,6 +40,10 @@ public class RecommendController {
|
|
|
|
|
|
@Autowired
|
|
|
DivRecService divservice;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ AnalyzeService analyzeService;
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 每次刷新或进入填写页面,都应该调用一次该方法,因为其中包含了一些初始化操作
|
|
@@ -93,9 +95,16 @@ public class RecommendController {
|
|
|
try {
|
|
|
Bug bug = recservice.getDetail(id);
|
|
|
if(bug != null) {
|
|
|
+ result.put("status","200");
|
|
|
result.put("detail", new JSONObject(bug));
|
|
|
result.put("history", new JSONObject(historyservice.getHistory(id)));
|
|
|
result.put("mirror", new JSONObject(recservice.getMirror(id)));
|
|
|
+ BugSimilarScore bugSimilarScore=analyzeService.getSimilarScore(id);
|
|
|
+ if(bugSimilarScore!=null){
|
|
|
+ result.put("similar_score",new JSONObject(bugSimilarScore));
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ result.put("status","500");
|
|
|
}
|
|
|
PrintWriter out = response.getWriter();
|
|
|
out.print(result);
|