Parcourir la source

学习记录相关接口定义

mingfu il y a 1 mois
Parent
commit
1eef63d871

+ 72 - 1
ie-admin/src/main/java/com/ruoyi/web/controller/front/FrontStudentController.java

@@ -2,9 +2,12 @@ package com.ruoyi.web.controller.front;
 
 import com.alibaba.fastjson2.JSONArray;
 import com.alibaba.fastjson2.JSONObject;
+import com.google.common.collect.Lists;
 import com.ruoyi.common.core.content.VistorContextHolder;
+import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
 import com.ruoyi.common.core.domain.entity.SysUser;
+import com.ruoyi.common.core.page.TableDataInfo;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.dz.domain.DzControl;
 import com.ruoyi.dz.service.IDzControlService;
@@ -39,7 +42,7 @@ import java.util.stream.Collectors;
 @RestController
 @RequestMapping("/front/student")
 @Api(tags = "前台-学习-学生")
-public class FrontStudentController {
+public class FrontStudentController extends BaseController {
     private final IDzControlService dzControlService;
     private final IAEnrollUniversityService universityService;
     private final ISyMajorService syMajorService;
@@ -199,6 +202,74 @@ public class FrontStudentController {
         return AjaxResult.success(stats);
     }
 
+    @ApiOperation("50 记录-知识点统计")
+    @GetMapping("record/knowledge")
+    public TableDataInfo getRecordKnowledge()
+    {
+        JSONObject data = JSONObject.of("name", "", "directed", true, "rate", 82, "total", 1470);
+        List<JSONObject> list = Lists.newArrayList(data);
+        return getDataTable(list);
+    }
+
+    @ApiOperation("51 记录-模拟卷")
+    @GetMapping("record/simulated")
+    public AjaxResult getRecordSimulated()
+    {
+        JSONObject data = JSONObject.of("name", "考试", "date", "2025-09-26 15:46", "total", 300, "score", 80, "rate", 82);
+        List<JSONObject> list = Lists.newArrayList(data);
+        return AjaxResult.success(list);
+    }
+
+    @ApiOperation("52 记录-模拟卷结果")
+    @GetMapping("record/simulated/{recordId}")
+    public AjaxResult getSimulatedDetail(@ApiParam("记录ID") @PathVariable("recordId") Long recordId)
+    {
+        return AjaxResult.success();
+    }
+
+    @ApiOperation("53 记录-测试卷")
+    @GetMapping("record/test")
+    public TableDataInfo getRecordTest()
+    {
+        JSONObject data = JSONObject.of("name", "考试", "date", "2025-09-26 15:46", "total", 300, "score", 80, "rate", 82);
+        List<JSONObject> list = Lists.newArrayList(data);
+        return getDataTable(list);
+    }
+
+    @ApiOperation("54 记录-测试卷结果")
+    @GetMapping("record/test/{recordId}")
+    public AjaxResult getTestDetail(@ApiParam("记录ID") @PathVariable("recordId") Long recordId)
+    {
+        return AjaxResult.success();
+    }
+
+    @ApiOperation("55 记录-计划刷题")
+    @GetMapping("record/planStudy")
+    public AjaxResult getRecordPlanStudy(Integer year, Integer monthSeq, Integer weekSeq)
+    {
+        JSONObject result = new JSONObject();
+        result.put("total", 140);
+        result.put("rate", 85);
+        result.put("studyDays", 3);
+        JSONObject data = JSONObject.of("date", "2025.09.03", "study", "90", "rate", "80", "pass", true);
+        List<JSONObject> list = Lists.newArrayList(data);
+        result.put("list", list);
+        return AjaxResult.success(result);
+    }
+
+    @ApiOperation("56 记录-视频学习")
+    @GetMapping("record/video")
+    public AjaxResult getRecordVideo()
+    {
+        JSONObject result = new JSONObject();
+        result.put("total", 98);
+        result.put("study", 759);
+        JSONObject data = JSONObject.of("name", "充分条件", "date", "2025.09.11", "study", "02:46");
+        List<JSONObject> list = Lists.newArrayList(data);
+        result.put("list", list);
+        return AjaxResult.success(result);
+    }
+
     private LearnPlan getCurrLearnPlan() {
         LearnPlan cond = new LearnPlan();
         cond.setStudentId(SecurityUtils.getLoginUser().getUserId());

+ 151 - 0
ie-admin/src/main/java/com/ruoyi/web/controller/front/FrontTeacherController.java

@@ -0,0 +1,151 @@
+package com.ruoyi.web.controller.front;
+
+import com.alibaba.fastjson2.JSONObject;
+import com.google.common.collect.Lists;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.page.TableDataInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/front/teacher")
+@Api(tags = "前台-学习-老师")
+public class FrontTeacherController extends BaseController {
+    @ApiOperation("10 查询班级列表")
+    @GetMapping("classes")
+    public AjaxResult getClasses()
+    {
+        return AjaxResult.success();
+    }
+
+    @ApiOperation("10 查询批次列表")
+    @GetMapping("batchs")
+    public AjaxResult getBatchs()
+    {
+        return AjaxResult.success();
+    }
+
+    @ApiOperation("记录-模拟卷")
+    @GetMapping("record/simulated")
+    public AjaxResult getRecordSimulated()
+    {
+        JSONObject result = new JSONObject();
+        result.put("total", 140);
+        result.put("done", 85);
+        result.put("undone", 3);
+        result.put("unsent", 3);
+        JSONObject data = JSONObject.of("name", "2501", "data", "242");
+        List<JSONObject> list = Lists.newArrayList(data);
+        result.put("list", list);
+        return AjaxResult.success(result);
+    }
+
+    @ApiOperation("记录-模拟卷班级")
+    @GetMapping("record/simulated/{classId}")
+    public AjaxResult getRecordSimulated(@ApiParam("班级id") @PathVariable("classId") Integer classId)
+    {
+        JSONObject data = JSONObject.of("seq", "1", "name", "XM", "total", "658", "study", 20, "rate", 39);
+        List<JSONObject> list = Lists.newArrayList(data);
+        return AjaxResult.success(list);
+    }
+
+    @ApiOperation("记录-测试卷")
+    @GetMapping("record/test")
+    public AjaxResult getRecordTest(Integer batch)
+    {
+        JSONObject result = new JSONObject();
+        result.put("total", 140);
+        result.put("done", 85);
+        result.put("undone", 3);
+        result.put("unsent", 3);
+        JSONObject data = JSONObject.of("name", "2501", "data", "242");
+        List<JSONObject> list = Lists.newArrayList(data);
+        result.put("list", list);
+        return AjaxResult.success(result);
+    }
+
+    @ApiOperation("记录-测试卷班级")
+    @GetMapping("record/test/{classId}")
+    public AjaxResult getRecordTestDetail(@ApiParam("班级id") @PathVariable("classId") Integer classId)
+    {
+        JSONObject data = JSONObject.of("seq", "1", "name", "XM", "total", "658", "study", 20, "rate", 39);
+        List<JSONObject> list = Lists.newArrayList(data);
+        return AjaxResult.success(list);
+    }
+
+    @ApiOperation("记录-计划刷题 有班级显示学生")
+    @GetMapping("record/planStudy")
+    public AjaxResult getRecordStudy()
+    {
+        JSONObject data = JSONObject.of("seq", "1", "name", "XM", "total", "658", "study", 20, "rate", 39);
+        List<JSONObject> list = Lists.newArrayList(data);
+        return AjaxResult.success(list);
+    }
+
+    @ApiOperation("记录-计划刷题明细")
+    @GetMapping("record/planStudy/{id}")
+    public AjaxResult getRecordPlanStudyDetail(Integer year, Integer monthSeq, Integer weekSeq, @ApiParam("记录sid") @PathVariable("recordId") Integer recordId)
+    {
+        JSONObject result = new JSONObject();
+        result.put("total", 140);
+        result.put("rate", 85);
+        result.put("studyDays", 3);
+        JSONObject data = JSONObject.of("date", "2025.09.03", "study", "90", "rate", "80", "pass", true);
+        List<JSONObject> list = Lists.newArrayList(data);
+        result.put("list", list);
+        return AjaxResult.success(result);
+    }
+
+    @ApiOperation("知识点")
+    @GetMapping("record/knowledge")
+    public AjaxResult getRecordKnowledge(@ApiParam("班级id") Integer classId)
+    {
+        JSONObject result = new JSONObject();
+        result.put("rate", 48);
+        JSONObject data = JSONObject.of("seq", "1", "name", "XM", "total", "658", "rate", 39);
+        List<JSONObject> list = Lists.newArrayList(data);
+        result.put("list", list);
+        return AjaxResult.success(result);
+    }
+
+    @ApiOperation("知识点")
+    @GetMapping("record/knowledge/{recordId}")
+    public TableDataInfo getRecordKnowledgeDetail(@ApiParam("记录sid") @PathVariable("recordId") Integer recordId)
+    {
+        JSONObject data = JSONObject.of("name", "", "directed", true, "rate", 82, "total", 1470);
+        List<JSONObject> list = Lists.newArrayList(data);
+        return getDataTable(list);
+    }
+
+    @ApiOperation("视频记录")
+    @GetMapping("record/video")
+    public AjaxResult getRecordVideo(@ApiParam("班级id") Integer classId)
+    {
+        JSONObject result = new JSONObject();
+        JSONObject data = JSONObject.of("seq", "1", "name", "XM", "total", "658", "study", 20);
+        List<JSONObject> list = Lists.newArrayList(data);
+        result.put("list", list);
+        return AjaxResult.success(result);
+    }
+
+    @ApiOperation("视频记录")
+    @GetMapping("record/video/{recordId}")
+    public AjaxResult getRecordVideoDetail(@ApiParam("记录sid") @PathVariable("recordId") Integer recordId)
+    {
+        JSONObject result = new JSONObject();
+        result.put("total", 98);
+        result.put("study", 759);
+        JSONObject data = JSONObject.of("name", "充分条件", "date", "2025.09.11", "study", "02:46");
+        List<JSONObject> list = Lists.newArrayList(data);
+        result.put("list", list);
+        return AjaxResult.success(result);
+    }
+}