| 12345678910111213141516171819202122232425262728293031323334 |
- package cn.seecoder.data.server.controller;
- import cn.seecoder.data.server.repository.GeneralRecordRepository;
- import cn.seecoder.data.server.service.EvaluateService;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.PathVariable;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.RestController;
- import java.util.HashMap;
- import java.util.Map;
- @RestController
- public class AnalysisController {
- @Autowired
- GeneralRecordRepository generalRecordRepository;
- @Autowired
- EvaluateService evaluateService;
- @RequestMapping("/score/{id}")
- public Map<String,Double> getEvaluate(@PathVariable("id") Integer id){
- HashMap<String,Double> ans = new HashMap<>();
- ans.put("helper",evaluateService.getQuestionScore(id,"helper"));
- ans.put("evaluate",evaluateService.getQuestionScore(id,"evaluate"));
- ans.put("playground",evaluateService.getQuestionScore(id,"playground"));
- ans.put("helper-week",evaluateService.getQuestionScoreByWeek(id,"helper"));
- ans.put("evaluate-week",evaluateService.getQuestionScoreByWeek(id,"evaluate"));
- ans.put("playground-week",evaluateService.getQuestionScoreByWeek(id,"playground"));
- return ans;
- }
- }
|