|
|
@@ -89,4 +89,20 @@ public class LiveCompletionPointsController extends AppBaseController {
|
|
|
|
|
|
return R.ok().put("data", result);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 用于测试和调试
|
|
|
+ */
|
|
|
+ @PostMapping("/test/create")
|
|
|
+ public R testCreateRecord(@RequestParam Long liveId, @RequestParam(required = false) Long watchDuration) {
|
|
|
+ Long userId = Long.parseLong(getUserId());
|
|
|
+
|
|
|
+ try {
|
|
|
+ // 调用完课记录创建方法(watchDuration为null时会自动从数据库累计)
|
|
|
+ completionPointsRecordService.checkAndCreateCompletionRecord(liveId, userId, watchDuration);
|
|
|
+ return R.ok("完课记录创建成功,请查看records接口查看结果");
|
|
|
+ } catch (Exception e) {
|
|
|
+ return R.error("创建失败: " + e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|