|
@@ -1,10 +1,11 @@
|
|
|
-package cn.reghao.tnb.content.app.exam.controller;
|
|
|
|
|
|
|
+package cn.reghao.tnb.content.app.data.controller;
|
|
|
|
|
|
|
|
import cn.reghao.jutil.web.WebResult;
|
|
import cn.reghao.jutil.web.WebResult;
|
|
|
|
|
+import cn.reghao.tnb.common.auth.AuthUser;
|
|
|
|
|
+import cn.reghao.tnb.content.app.data.service.ChartService;
|
|
|
import cn.reghao.tnb.content.app.exam.model.chart.LineChartData;
|
|
import cn.reghao.tnb.content.app.exam.model.chart.LineChartData;
|
|
|
-import cn.reghao.tnb.content.app.exam.service.ChartService;
|
|
|
|
|
-import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
|
|
+import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
import org.springframework.http.MediaType;
|
|
import org.springframework.http.MediaType;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
@@ -15,20 +16,20 @@ import java.util.List;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* @author reghao
|
|
* @author reghao
|
|
|
- * @date 2024-08-29 09:47:56
|
|
|
|
|
|
|
+ * @date 2025-08-19 21:44:54
|
|
|
*/
|
|
*/
|
|
|
-@Tag(name = "考试数据统计接口")
|
|
|
|
|
|
|
+@Tag(name = "图表数据接口")
|
|
|
@RestController
|
|
@RestController
|
|
|
-@RequestMapping("/api/content/exam/statistic")
|
|
|
|
|
-public class ExamStatisticController {
|
|
|
|
|
|
|
+@RequestMapping("/api/content/chart")
|
|
|
|
|
+public class ChartController {
|
|
|
private final ChartService chartService;
|
|
private final ChartService chartService;
|
|
|
|
|
|
|
|
- public ExamStatisticController(ChartService chartService) {
|
|
|
|
|
|
|
+ public ChartController(ChartService chartService) {
|
|
|
this.chartService = chartService;
|
|
this.chartService = chartService;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Operation(summary = "获取用户考试结果的统计数据", description = "N")
|
|
@Operation(summary = "获取用户考试结果的统计数据", description = "N")
|
|
|
- @GetMapping(value = "/count", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
|
|
|
|
+ @GetMapping(value = "/exam/count", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public String getExamCount() {
|
|
public String getExamCount() {
|
|
|
List<String> list = new ArrayList<>();
|
|
List<String> list = new ArrayList<>();
|
|
|
list.add("试卷1,试卷2,试卷3,试卷4,试卷4,试卷6,试卷7");
|
|
list.add("试卷1,试卷2,试卷3,试卷4,试卷4,试卷6,试卷7");
|
|
@@ -37,7 +38,7 @@ public class ExamStatisticController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Operation(summary = "获取用户的考试通过率", description = "N")
|
|
@Operation(summary = "获取用户的考试通过率", description = "N")
|
|
|
- @GetMapping(value = "/rate", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
|
|
|
|
+ @GetMapping(value = "/exam/rate", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public String getExamPassRate() {
|
|
public String getExamPassRate() {
|
|
|
List<String> list = new ArrayList<>();
|
|
List<String> list = new ArrayList<>();
|
|
|
list.add("试卷1,试卷2,试卷3,试卷4,试卷4,试卷6,试卷7");
|
|
list.add("试卷1,试卷2,试卷3,试卷4,试卷4,试卷6,试卷7");
|
|
@@ -46,9 +47,25 @@ public class ExamStatisticController {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Operation(summary = "获取折线图数据", description = "N")
|
|
@Operation(summary = "获取折线图数据", description = "N")
|
|
|
- @GetMapping(value = "/linechart", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
|
|
|
|
+ @GetMapping(value = "/exam/linechart", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
public String getLineChart() {
|
|
public String getLineChart() {
|
|
|
LineChartData lineChartData = chartService.getLineChartData();
|
|
LineChartData lineChartData = chartService.getLineChartData();
|
|
|
return WebResult.success(lineChartData);
|
|
return WebResult.success(lineChartData);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ @AuthUser
|
|
|
|
|
+ @Operation(summary = "用户最近一周观看视频时长统计", description = "N")
|
|
|
|
|
+ @GetMapping(value = "/video/watch", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
|
|
+ public String getWatchLineChart() {
|
|
|
|
|
+ List<String> list = chartService.getWatchLineChart();
|
|
|
|
|
+ return WebResult.success(list);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @AuthUser
|
|
|
|
|
+ @Operation(summary = "用户最近一周观看视频分区统计", description = "N")
|
|
|
|
|
+ @GetMapping(value = "/video/region", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
|
|
+ public String getRegionPieChart() {
|
|
|
|
|
+ List<String> list = chartService.getRegionPieChart();
|
|
|
|
|
+ return WebResult.success(list);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|