|
|
@@ -22,12 +22,18 @@ public class AnalysisServiceImpl implements AnalysisService {
|
|
|
|
|
|
final PlaygroundService playgroundService;
|
|
|
|
|
|
- public AnalysisServiceImpl(HelperService helperService, EvaluateService evaluateService, CoderService coderService, DevcloudService devcloudService, PlaygroundService playgroundService) {
|
|
|
+ final KnowledgeService knowledgeService;
|
|
|
+
|
|
|
+ final SonarqubeService sonarqubeService;
|
|
|
+
|
|
|
+ public AnalysisServiceImpl(HelperService helperService, EvaluateService evaluateService, CoderService coderService, DevcloudService devcloudService, PlaygroundService playgroundService, KnowledgeService knowledgeService, SonarqubeService sonarqubeService) {
|
|
|
this.helperService = helperService;
|
|
|
this.evaluateService = evaluateService;
|
|
|
this.coderService = coderService;
|
|
|
this.devcloudService = devcloudService;
|
|
|
this.playgroundService = playgroundService;
|
|
|
+ this.knowledgeService = knowledgeService;
|
|
|
+ this.sonarqubeService = sonarqubeService;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -48,14 +54,33 @@ public class AnalysisServiceImpl implements AnalysisService {
|
|
|
HashMap<String,Double> ans = new HashMap<>();
|
|
|
LocalDateTime end = LocalDateTime.now();
|
|
|
LocalDateTime start = end.minusDays(7);
|
|
|
- ans.put("evaluate",evaluateService.getEvaluationScoreByWeek(userId));
|
|
|
- ans.put("helper",helperService.getHelperQuestionScoreByIdByWeek(userId)*0.5+helperService.getHelperEventScoreByIdByWeek(userId)*0.5);
|
|
|
- ans.put("coder",coderService.getCoderGrade(userId,start,end));
|
|
|
- ans.put("devcloud", devcloudService.commitScoreCompute(userId,start,end));
|
|
|
- ans.put("playground", playgroundService.getQuestionScore(userId,start,end));
|
|
|
+ ans.put("Evaluate",evaluateService.getEvaluationScoreByWeek(userId));
|
|
|
+ ans.put("Helper",helperService.getHelperQuestionScoreByIdByWeek(userId)*0.5+helperService.getHelperEventScoreByIdByWeek(userId)*0.5);
|
|
|
+ ans.put("Coder",coderService.getCoderGrade(userId,start,end));
|
|
|
+ ans.put("Devcloud", devcloudService.commitScoreCompute(userId,start,end));
|
|
|
+ ans.put("Playground", playgroundService.getQuestionScore(userId,start,end));
|
|
|
+ return ans;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Map<String, Double> getDepositionScoreByUserId(Integer userId) {
|
|
|
+ HashMap<String,Double> ans = new HashMap<>();
|
|
|
+ ans.put("Activity", knowledgeService.getBokInteractionScore(userId)*0.5+helperService.getHelperEventScoreById(userId));
|
|
|
+ ans.put("Cooperation", devcloudService.commitScoreCompute(userId));
|
|
|
+ ans.put("Quality", sonarqubeService.getSonarScoreOfUser(userId));
|
|
|
return ans;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public Map<String, Double> getDepositionWeekScoreByUserId(Integer userId) {
|
|
|
+ HashMap<String,Double> ans = new HashMap<>();
|
|
|
+ LocalDateTime end = LocalDateTime.now();
|
|
|
+ LocalDateTime start = end.minusDays(7);
|
|
|
+ ans.put("Activity", helperService.getHelperEventScoreByIdByWeek(userId));
|
|
|
+ ans.put("Cooperation", devcloudService.commitScoreCompute(userId,start,end));
|
|
|
+ ans.put("Quality", sonarqubeService.getSonarScoreOfUser(userId,start,end));
|
|
|
+ return ans;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|