Browse Source

删除Commit实体及相关类

4228306 6 năm trước cách đây
mục cha
commit
2a3bbd43ae

+ 0 - 470
src/main/java/edu/math/diagnosis/controller/CommitController.java

@@ -1,470 +0,0 @@
-package edu.math.diagnosis.controller;
-
-import edu.math.diagnosis.cache.DbCacheFactory;
-import edu.math.diagnosis.cache.instance.OptionCache;
-import edu.math.diagnosis.cache.instance.QuestionCache;
-//import edu.math.diagnosis.dao.CommitRepo;
-import edu.math.diagnosis.dao.UserRepo;
-import edu.math.diagnosis.entity.*;
-import edu.math.diagnosis.model.AuthUser;
-import edu.math.diagnosis.model.ResponseMessage;
-import edu.math.diagnosis.util.NumberUtil;
-import edu.math.diagnosis.util.ObjectUtil;
-import edu.math.diagnosis.util.SecurityUtil;
-import io.swagger.annotations.Api;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.web.bind.annotation.*;
-
-import javax.annotation.Resource;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @AUTHOR: DaiFengWen
- * @DATE: Create in 2018/7/6 17:55
- * @DESCRIPTION:
- */
-@Api(tags = "试卷提交 马上废弃")
-@RestController
-@RequestMapping("/commit")
-public class CommitController {
-//    @Resource
-//    CommitRepo commitRepo;
-    @Resource
-    UserRepo userRepo;
-
-    private final OptionCache OptionCache = DbCacheFactory.INSTANCE.getCache(OptionCache.class);
-    private final QuestionCache QuestionCache = DbCacheFactory.INSTANCE.getCache(QuestionCache.class);
-
-//    @RequestMapping(value = "/paper", method = RequestMethod.POST)
-//    public ResponseMessage commitPaper(@RequestBody Paper paper) {
-//        AuthUser authUser = SecurityUtil.getCurrentUser();
-//        Commit commit = new Commit();
-//        paper.getQuestions().forEach((question -> {
-//            question.setOptions(null);
-//            question.setUpdatetime(null);
-//            question.setCreatetime(null);
-//            question.setContent(null);
-//            question.setWrongDesc(null);
-//        }));
-//        paper.setCreatetime(null);
-//        paper.setUpdatetime(null);
-//        String data = ObjectUtil.object2Json(paper);
-//        commit.setData(data);
-//        long uid = authUser.getUser().getId();
-//        long pid = paper.getId();
-//        commit.setUid(uid);
-//        commit.setPid(pid);
-//        double point = calculatePoint(paper);
-//        commit.setScore(point);
-//        commit.setCreatetime(new Date());
-//        commitRepo.saveAndFlush(commit);
-//        return ResponseMessage.getInstance(200, NumberUtil.formatDouble(point));
-//    }
-
-    private double calculatePoint(Paper paper) {
-        double result = 0.0;
-        List<Question> questions = paper.getQuestions();
-        double total = 0;
-        for (Question question : questions) {
-            double score = (question.getCalculation() + question.getConversion() + question.getInduction() + question.getLanguage() + question.getLogic() + question.getSpace());
-            total += score;
-            if (judgeQuestion(question)) {
-                result += score;
-            }
-        }
-        if (total == 0) {
-            return 0;
-        } else {
-            return (result / total) * 100;
-        }
-    }
-
-    private boolean judgeQuestion(Question question) {
-        String ans = question.getAnswer();
-        if (StringUtils.isEmpty(ans)) {
-            return false;
-        }
-        String[] options = StringUtils.splitByWholeSeparatorPreserveAllTokens(ans, ",");
-        if (options.length == question.getCorrectNum()) {
-            for (String option : options) {
-                long o = Long.parseLong(option);
-                QuestionOption questionOption = OptionCache.getById(o);
-                if (questionOption == null || !questionOption.isCorrect()) {
-                    return false;
-                }
-            }
-            return true;
-        } else {
-            return false;
-        }
-    }
-
-    @RequestMapping(value = "/check", method = RequestMethod.GET)
-    public boolean checkPaper(@RequestParam long pid) {
-        AuthUser authUser = SecurityUtil.getCurrentUser();
-        long uid = authUser.getUser().getId();
-//        int cnt = commitRepo.countByUidAndPid(uid, pid);
-        int cnt=0;
-        return cnt < 1;
-    }
-
-    public PaperReport generateReport(Paper paper, long uid) {
-        UserInfo userInfo = userRepo.getOne(uid);
-        PaperReport paperReport = new PaperReport();
-        paperReport.setName(userInfo.getName());
-        paperReport.setUid(uid);
-        paperReport.setPid(paper.getId());
-        paperReport.setPaperName(paper.getName());
-        paperReport.setGenerateTime(new Date());
-        Map<Integer, SectionReport> sectionReportMap = new HashMap<>(4);
-        sectionReportMap.put(1, new SectionReport(1));
-        sectionReportMap.put(2, new SectionReport(2));
-        sectionReportMap.put(3, new SectionReport(3));
-        paperReport.setSectionReportMap(sectionReportMap);
-        List<Question> questions = paper.getQuestions();
-        double total = 0;
-        double result = 0.0;
-        for (Question question : questions) {
-            int section = Math.abs(question.getSection());
-            SectionReport sectionReport = sectionReportMap.get(section);
-            double score = (question.getCalculation() + question.getConversion() + question.getInduction() + question.getLanguage() + question.getLogic() + question.getSpace());
-            fillReportTotalScore(question, paperReport);
-            fillReportTotalScore(question, sectionReport);
-            total += score;
-            double sectionTotalScore = sectionReport.getTotalScore();
-            sectionReport.setTotalScore(sectionTotalScore + score);
-            QuestionCommit questionCommit = new QuestionCommit();
-            questionCommit.setAns(question.getAnswer());
-            questionCommit.setQid(question.getId());
-            questionCommit.setUsetime(question.getUsetime());
-            questionCommit.setCorrect(false);
-            sectionReport.getMap().put(question.getId(), questionCommit);
-            if (judgeQuestion(question)) {
-                questionCommit.setCorrect(true);
-                result += score;
-                double setionScore = sectionReport.getScore();
-                sectionReport.setScore(setionScore + score);
-                fillReportScore(question, paperReport);
-                fillReportScore(question, sectionReport);
-            }
-        }
-        paperReport.setTotalScore(total);
-        paperReport.setScore(result);
-        return paperReport;
-    }
-
-    private double getDoubleValue(Double d) {
-        if (d == null) {
-            return 0;
-        } else {
-            return d;
-        }
-    }
-
-    private void fillReportTotalScore(Question question, BaseReport report) {
-        double totalCalculationScore = getDoubleValue(report.getTotalCalculationScore());
-        report.setTotalCalculationScore(totalCalculationScore + question.getCalculation());
-
-        double totalConversionScore = getDoubleValue(report.getTotalConversionScore());
-        report.setTotalConversionScore(totalConversionScore + question.getConversion());
-
-        double totalInductionScore = getDoubleValue(report.getTotalInductionScore());
-        report.setTotalInductionScore(totalInductionScore + question.getInduction());
-
-        double totalLanguageScore = getDoubleValue(report.getTotalLanguageScore());
-        report.setTotalLanguageScore(totalLanguageScore + question.getLanguage());
-
-        double totalLogicScore = getDoubleValue(report.getTotalLogicScore());
-        report.setTotalLogicScore(totalLogicScore + question.getLogic());
-
-        double totalSpaceScore = getDoubleValue(report.getTotalSpaceScore());
-        report.setTotalSpaceScore(totalSpaceScore + question.getSpace());
-    }
-
-    private void fillReportScore(Question question, BaseReport report) {
-        double calculationScore = getDoubleValue(report.getCalculationScore());
-        report.setCalculationScore(calculationScore + question.getCalculation());
-
-        double conversionScore = getDoubleValue(report.getConversionScore());
-        report.setConversionScore(conversionScore + question.getConversion());
-
-        double inductionScore = getDoubleValue(report.getInductionScore());
-        report.setInductionScore(inductionScore + question.getInduction());
-
-        double languageScore = getDoubleValue(report.getLanguageScore());
-        report.setLanguageScore(languageScore + question.getLanguage());
-
-        double logicScore = getDoubleValue(report.getLogicScore());
-        report.setLogicScore(logicScore + question.getLogic());
-
-        double spaceScore = getDoubleValue(report.getSpaceScore());
-        report.setSpaceScore(spaceScore + question.getSpace());
-    }
-}
-
-class BaseReport {
-    private Double totalScore = new Double(0);
-    private Double score = new Double(0);
-    private Double totalCalculationScore = new Double(0);
-    private Double calculationScore = new Double(0);
-    private Double totalInductionScore = new Double(0);
-    private Double inductionScore = new Double(0);
-    private Double totalLogicScore = new Double(0);
-    private Double logicScore = new Double(0);
-    private Double totalSpaceScore = new Double(0);
-    private Double spaceScore = new Double(0);
-    private Double totalLanguageScore = new Double(0);
-    private Double languageScore = new Double(0);
-    private Double totalConversionScore = new Double(0);
-    private Double conversionScore = new Double(0);
-
-    public Double getTotalScore() {
-        return totalScore;
-    }
-
-    public void setTotalScore(Double totalScore) {
-        this.totalScore = totalScore;
-    }
-
-    public Double getScore() {
-        return score;
-    }
-
-    public void setScore(Double score) {
-        this.score = score;
-    }
-
-    public Double getTotalCalculationScore() {
-        return totalCalculationScore;
-    }
-
-    public void setTotalCalculationScore(Double totalCalculationScore) {
-        this.totalCalculationScore = totalCalculationScore;
-    }
-
-    public Double getCalculationScore() {
-        return calculationScore;
-    }
-
-    public void setCalculationScore(Double calculationScore) {
-        this.calculationScore = calculationScore;
-    }
-
-    public Double getTotalInductionScore() {
-        return totalInductionScore;
-    }
-
-    public void setTotalInductionScore(Double totalInductionScore) {
-        this.totalInductionScore = totalInductionScore;
-    }
-
-    public Double getInductionScore() {
-        return inductionScore;
-    }
-
-    public void setInductionScore(Double inductionScore) {
-        this.inductionScore = inductionScore;
-    }
-
-    public Double getTotalLogicScore() {
-        return totalLogicScore;
-    }
-
-    public void setTotalLogicScore(Double totalLogicScore) {
-        this.totalLogicScore = totalLogicScore;
-    }
-
-    public Double getLogicScore() {
-        return logicScore;
-    }
-
-    public void setLogicScore(Double logicScore) {
-        this.logicScore = logicScore;
-    }
-
-    public Double getTotalSpaceScore() {
-        return totalSpaceScore;
-    }
-
-    public void setTotalSpaceScore(Double totalSpaceScore) {
-        this.totalSpaceScore = totalSpaceScore;
-    }
-
-    public Double getSpaceScore() {
-        return spaceScore;
-    }
-
-    public void setSpaceScore(Double spaceScore) {
-        this.spaceScore = spaceScore;
-    }
-
-    public Double getTotalLanguageScore() {
-        return totalLanguageScore;
-    }
-
-    public void setTotalLanguageScore(Double totalLanguageScore) {
-        this.totalLanguageScore = totalLanguageScore;
-    }
-
-    public Double getLanguageScore() {
-        return languageScore;
-    }
-
-    public void setLanguageScore(Double languageScore) {
-        this.languageScore = languageScore;
-    }
-
-    public Double getTotalConversionScore() {
-        return totalConversionScore;
-    }
-
-    public void setTotalConversionScore(Double totalConversionScore) {
-        this.totalConversionScore = totalConversionScore;
-    }
-
-    public Double getConversionScore() {
-        return conversionScore;
-    }
-
-    public void setConversionScore(Double conversionScore) {
-        this.conversionScore = conversionScore;
-    }
-}
-
-class PaperReport extends BaseReport {
-    private String name;
-    private Long uid;
-    private Long pid;
-    private String paperName;
-    private Date generateTime;
-    private Map<Integer, SectionReport> sectionReportMap;
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public Long getUid() {
-        return uid;
-    }
-
-    public void setUid(Long uid) {
-        this.uid = uid;
-    }
-
-    public Long getPid() {
-        return pid;
-    }
-
-    public void setPid(Long pid) {
-        this.pid = pid;
-    }
-
-    public String getPaperName() {
-        return paperName;
-    }
-
-    public void setPaperName(String paperName) {
-        this.paperName = paperName;
-    }
-
-    public Date getGenerateTime() {
-        return generateTime;
-    }
-
-    public void setGenerateTime(Date generateTime) {
-        this.generateTime = generateTime;
-    }
-
-    public Map<Integer, SectionReport> getSectionReportMap() {
-        return sectionReportMap;
-    }
-
-    public void setSectionReportMap(Map<Integer, SectionReport> sectionReportMap) {
-        this.sectionReportMap = sectionReportMap;
-    }
-}
-
-class SectionReport extends BaseReport {
-    private int section;
-
-    private Map<Long, QuestionCommit> map;
-
-    public SectionReport(int section) {
-        this.section = section;
-        map = new HashMap<>();
-    }
-
-    public SectionReport() {
-    }
-
-    public int getSection() {
-        return section;
-    }
-
-    public void setSection(int section) {
-        this.section = section;
-    }
-
-    public Map<Long, QuestionCommit> getMap() {
-        return map;
-    }
-
-    public void setMap(Map<Long, QuestionCommit> map) {
-        this.map = map;
-    }
-}
-
-class QuestionCommit {
-    private long qid;
-    private String ans;
-    private int usetime;
-    private String correctAns;
-    private boolean correct;
-
-    public long getQid() {
-        return qid;
-    }
-
-    public void setQid(long qid) {
-        this.qid = qid;
-    }
-
-    public String getAns() {
-        return ans;
-    }
-
-    public void setAns(String ans) {
-        this.ans = ans;
-    }
-
-    public int getUsetime() {
-        return usetime;
-    }
-
-    public void setUsetime(int usetime) {
-        this.usetime = usetime;
-    }
-
-    public String getCorrectAns() {
-        return correctAns;
-    }
-
-    public void setCorrectAns(String correctAns) {
-        this.correctAns = correctAns;
-    }
-
-    public boolean isCorrect() {
-        return correct;
-    }
-
-    public void setCorrect(boolean correct) {
-        this.correct = correct;
-    }
-}

+ 1 - 1
src/main/java/edu/math/diagnosis/controller/PaperResultController.java

@@ -29,7 +29,7 @@ public class PaperResultController {
     public Result rebuild(Long commitId) {
         PaperCommit commit = paperCommitRepo.getOne(commitId);
         Paper paper = paperService.getOnePaper(commit.getPid());
-        paperResultService.checkAndDelete(paper.getId(),commit.getUid());
+        paperResultService.checkAndDelete(paper.getId(), commit.getUid());
         return paperResultService.parseResult(commit, paper);
     }
 }

+ 3 - 4
src/main/java/edu/math/diagnosis/controller/ReportController.java

@@ -1,7 +1,6 @@
 package edu.math.diagnosis.controller;
 
 import edu.math.diagnosis.entity.Paper;
-import edu.math.diagnosis.entity.PaperCommit;
 import edu.math.diagnosis.entity.PaperResult;
 import edu.math.diagnosis.entity.UserInfo;
 import edu.math.diagnosis.model.Result;
@@ -80,11 +79,11 @@ public class ReportController {
     public Result<PaperResult> globalResult(Long paperResultId) {
         Map<String, Object> result = new HashMap<>();
         PaperResult paperResult = paperResultService.get(paperResultId);
-        if(paperResult == null){
-            return new Result<>(false,"");
+        if (paperResult == null) {
+            return new Result<>(false, "");
         }
         paperResultService.globalResult(paperResult);
-        return new Result<>(true,"",paperResult);
+        return new Result<>(true, "", paperResult);
     }
 
 }

+ 6 - 12
src/main/java/edu/math/diagnosis/controller/TestController.java

@@ -2,10 +2,8 @@ package edu.math.diagnosis.controller;
 
 import edu.math.diagnosis.dao.OptionRepo;
 import edu.math.diagnosis.dao.QuestionRepo;
-import edu.math.diagnosis.entity.Paper;
 import edu.math.diagnosis.entity.Question;
 import edu.math.diagnosis.model.AuthUser;
-import edu.math.diagnosis.util.ObjectUtil;
 import edu.math.diagnosis.util.SecurityUtil;
 import io.swagger.annotations.Api;
 import org.springframework.security.access.prepost.PreAuthorize;
@@ -15,7 +13,6 @@ import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
-import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 import java.util.concurrent.atomic.AtomicLong;
@@ -33,9 +30,6 @@ public class TestController {
     @Resource
     private QuestionRepo questionRepo;
 
-    @Resource
-    private CommitController commitController;
-
     private AtomicLong visitCount = new AtomicLong();
 
     @PreAuthorize("hasRole('ROLE_USER')")
@@ -60,10 +54,10 @@ public class TestController {
         return user;
     }
 
-    @PreAuthorize("hasRole('ROLE_ADMIN')")
-    @GetMapping("/temp")
-    public List<PaperReport> temp() {
-        List<PaperReport> result = new ArrayList<>();
+//    @PreAuthorize("hasRole('ROLE_ADMIN')")
+//    @GetMapping("/temp")
+//    public List<PaperReport> temp() {
+//        List<PaperReport> result = new ArrayList<>();
 //        List<Commit> commitList = commitRepo.findAll();
 //        for (Commit commit : commitList) {
 //            Paper paper = ObjectUtil.json2Object(commit.getData(), Paper.class);
@@ -71,8 +65,8 @@ public class TestController {
 //            result.add(paperReport);
 //            //		System.out.println(ObjectUtil.object2Json(paperReport));
 //        }
-        return result;
-    }
+//        return result;
+//    }
 
     @PreAuthorize("hasRole('ROLE_ADMIN')")
     @GetMapping("/temp1")

+ 0 - 8
src/main/java/edu/math/diagnosis/dao/CommitRepo.java

@@ -1,8 +0,0 @@
-package edu.math.diagnosis.dao;
-
-//import edu.math.diagnosis.entity.Commit;
-import org.springframework.data.jpa.repository.JpaRepository;
-
-//public interface CommitRepo extends JpaRepository<Commit, Long> {
-//    int countByUidAndPid(long uid, long pid);
-//}

+ 1 - 1
src/main/java/edu/math/diagnosis/dao/PaperCommitRepo.java

@@ -20,7 +20,7 @@ public interface PaperCommitRepo extends JpaRepository<PaperCommit, Long> {
 
     boolean existsByPidAndUid(Long pid, Long uid);
 
-    PaperCommit findByPidAndUid(Long pid,Long uid);
+    PaperCommit findByPidAndUid(Long pid, Long uid);
 
     boolean existsByCode(String code);
 }

+ 2 - 2
src/main/java/edu/math/diagnosis/dao/PaperResultRepo.java

@@ -16,7 +16,7 @@ public interface PaperResultRepo extends JpaRepository<PaperResult, Long> {
 
     List<PaperResult> findByPidAndUid(Long pid, Long uid);
 
-    boolean deleteByPidAndUid(Long pid,Long uid);
+    boolean deleteByPidAndUid(Long pid, Long uid);
 
-    boolean existsByPidAndUid(Long pid,Long uid);
+    boolean existsByPidAndUid(Long pid, Long uid);
 }

+ 1 - 1
src/main/java/edu/math/diagnosis/dao/SubjectKnowledgeRepo.java

@@ -7,7 +7,7 @@ import java.util.List;
 
 public interface SubjectKnowledgeRepo extends JpaRepository<SubjectKnowledge, Long> {
 
-    List<SubjectKnowledge> findBySubjectIdAndGrade(Long subjectId,String grade);
+    List<SubjectKnowledge> findBySubjectIdAndGrade(Long subjectId, String grade);
 
 
 }

+ 3 - 3
src/main/java/edu/math/diagnosis/entity/PaperCount.java

@@ -17,7 +17,7 @@ public class PaperCount {
 
     /**
      * 各题目平均作答时间
-     *
+     * <p>
      * [10,20,30]
      */
     @Lob
@@ -25,8 +25,8 @@ public class PaperCount {
     private String useTimeAgvRate;
     /**
      * {
-     *     "预备章节":88.88
-     *     "第一章":25.33
+     * "预备章节":88.88
+     * "第一章":25.33
      * }
      */
     @Lob

+ 9 - 11
src/main/java/edu/math/diagnosis/entity/PaperResult.java

@@ -55,7 +55,7 @@ public class PaperResult {
     /**
      * 各能力分数,5分制
      * {
-     *     "计算能力":"aa"
+     * "计算能力":"aa"
      * }
      */
     @Lob
@@ -68,9 +68,8 @@ public class PaperResult {
      * 1 半掌握
      * 2 已掌握
      * [
-     *     [1,1],[0,1,2]
+     * [1,1],[0,1,2]
      * ]
-     *
      */
     @Lob
     @ApiModelProperty("以章节为单位各知识点掌握程度,0 未掌握 1半掌握 2已掌握 [[1,2],[1,2,2,2]]")
@@ -79,10 +78,9 @@ public class PaperResult {
     /**
      * 各章节掌握率
      * {
-     *     "预备章节":0,
-     *     "第一章":88.8,
+     * "预备章节":0,
+     * "第一章":88.8,
      * }
-     *
      */
     @Lob
     @ApiModelProperty("各章节掌握率 {\"预备章节\":0,\"第一章\":88.88}")
@@ -99,11 +97,11 @@ public class PaperResult {
     /**
      * 模块作答详情
      * {
-     *     "0":{
-     *         "collectInfo":"43/50",
-     *         "useTime":"30:00/30:00",
-     *         "score":35
-     *         }
+     * "0":{
+     * "collectInfo":"43/50",
+     * "useTime":"30:00/30:00",
+     * "score":35
+     * }
      * }
      */
     @Lob

+ 1 - 1
src/main/java/edu/math/diagnosis/entity/PaperTemplate.java

@@ -19,7 +19,7 @@ public class PaperTemplate {
     @GeneratedValue(strategy = GenerationType.IDENTITY)
     private Long id;
 
-    @Column(nullable = false,length = 128,unique = true)
+    @Column(nullable = false, length = 128, unique = true)
     @ApiModelProperty("模板名称")
     private String name;
 

+ 2 - 2
src/main/java/edu/math/diagnosis/service/KnowledgeService.java

@@ -21,7 +21,7 @@ public class KnowledgeService {
         return subjectKnowledgeRepo.saveAll(list);
     }
 
-    public List<SubjectKnowledge> list(Long subjectId,String grade){
-        return subjectKnowledgeRepo.findBySubjectIdAndGrade(subjectId,grade);
+    public List<SubjectKnowledge> list(Long subjectId, String grade) {
+        return subjectKnowledgeRepo.findBySubjectIdAndGrade(subjectId, grade);
     }
 }

+ 9 - 9
src/main/java/edu/math/diagnosis/service/PaperResultService.java

@@ -98,28 +98,28 @@ public class PaperResultService {
         return paperResultRepo.findByPidAndUid(pid, uid);
     }
 
-    public boolean delete(Long pid,Long uid){
-        return paperResultRepo.deleteByPidAndUid(pid,uid);
+    public boolean delete(Long pid, Long uid) {
+        return paperResultRepo.deleteByPidAndUid(pid, uid);
     }
 
     @Transactional
-    public void checkAndDelete(Long pid,Long uid){
-       if(paperResultRepo.existsByPidAndUid(pid,uid)){
-           delete(pid,uid);
-       }
+    public void checkAndDelete(Long pid, Long uid) {
+        if (paperResultRepo.existsByPidAndUid(pid, uid)) {
+            delete(pid, uid);
+        }
     }
 
     public void globalResult(PaperResult r) {
-        PaperCommit commit = paperCommitRepo.findByPidAndUid(r.getPid(),r.getUid());
+        PaperCommit commit = paperCommitRepo.findByPidAndUid(r.getPid(), r.getUid());
         Paper paper = paperService.getOnePaper(r.getPid());
         r.setKnowledgeRate(88.88);
         r.setAbilityScore("{}");
     }
 
-    public Double knoledgeRate(PaperCommit commit,Paper paper ){
+    public Double knoledgeRate(PaperCommit commit, Paper paper) {
         Long subjectId = paper.getSubjectId();
         String grade = paper.getGrade();
-        List<SubjectKnowledge> knowledges = knowledgeService.list(subjectId,grade);
+        List<SubjectKnowledge> knowledges = knowledgeService.list(subjectId, grade);
         return 0d;
     }
 

+ 1 - 1
src/main/java/edu/math/diagnosis/service/SubjectService.java

@@ -16,7 +16,7 @@ public class SubjectService {
         return subjectRepo.findByName(name);
     }
 
-    public Subject get(Long id){
+    public Subject get(Long id) {
         return subjectRepo.getOne(id);
     }
 }