package com.gkhy.exam.admin.app;
|
|
|
import com.gkhy.exam.common.api.CommonResult;
|
import com.gkhy.exam.system.domain.ExStudentStudy;
|
import com.gkhy.exam.system.service.ExStudentStudyService;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParams;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.validation.annotation.Validated;
|
import org.springframework.web.bind.annotation.*;
|
|
/**
|
* <p>
|
* 课程学习学习日志表 前端控制器
|
* </p>
|
*
|
* @author kzy
|
* @since 2024-06-06 13:53:17
|
*/
|
@Api(tags = "APP学员学习记录前端控制器")
|
@RestController
|
@RequestMapping("/app/student-study")
|
public class AppStudentStudyController {
|
@Autowired
|
private ExStudentStudyService studentStudyService;
|
|
@ApiOperation(value = "新增学习记录")
|
@PostMapping
|
public CommonResult add(@Validated @RequestBody ExStudentStudy studentStudy){
|
return CommonResult.success(studentStudyService.insertStudentStudy(studentStudy));
|
}
|
|
@ApiOperation(value = "上报学习进度")
|
@ApiImplicitParams({
|
@ApiImplicitParam(paramType = "body", name = "id", dataType = "long", required = true, value = "学习记录id"),
|
@ApiImplicitParam(paramType = "body", name = "phaseId", dataType = "long", required = true, value = "批次id"),
|
@ApiImplicitParam(paramType = "body", name = "periodId", dataType = "long", required = true, value = "课时id"),
|
@ApiImplicitParam(paramType = "body", name = "resourceId", dataType = "long", required = true, value = "资源id"),
|
@ApiImplicitParam(paramType = "body", name = "currentDuration", dataType = "int", required = false, value = "当前学习时长,单位秒"),
|
@ApiImplicitParam(paramType = "body", name = "currentPage", dataType = "int", required = false, value = "当前学习页数,单位页")
|
})
|
@PostMapping("/progress")
|
public CommonResult progress(@RequestBody ExStudentStudy studentStudy){
|
studentStudyService.progress(studentStudy);
|
return CommonResult.success();
|
}
|
}
|