item添加processVideo字段

This commit is contained in:
zhaolongfei
2024-06-13 15:28:13 +08:00
parent e03118275d
commit 0b7784779f
4 changed files with 11 additions and 4 deletions

View File

@@ -529,7 +529,7 @@ public class StudyCourseApi extends ApiBaseController{
* @return
*/
@PostMapping("/study-video-time")
public JsonResponse<Boolean> study(String studyId,String itemId,Integer videoTime){
public JsonResponse<Boolean> study(String studyId,String itemId,Integer videoTime,Float processVideo){
if(StringUtils.isBlank(itemId)){
return error("参数错误");
@@ -539,7 +539,7 @@ public class StudyCourseApi extends ApiBaseController{
}
//检查是否已存在
try {
studyService.updateLastTime(itemId,videoTime,getCurrent().getAccountId());
studyService.updateLastTime(itemId,videoTime,getCurrent().getAccountId(),processVideo);
return success(true);
}catch(Exception e) {
log.error("记录最后学习时间错误",e);

View File

@@ -121,6 +121,12 @@ public class StudyCourseItem extends IdEntity {
* */
@Column(name = "progress")
private Integer progress;
/*
* 视频播放进度
* */
@Column(name = "progress_video")
private Integer progressVideo;
/**
* 学习状态,当前未使用 以学习进度100来定义是否已学完

View File

@@ -38,7 +38,7 @@ public interface IStudyService {
* @param lastStudyTime
* @param aid
*/
void updateLastTime(String studyContentId,int lastStudyTime,String aid);
void updateLastTime(String studyContentId,int lastStudyTime,String aid,Float processVideo);
/**
* 资源学习记录

View File

@@ -219,7 +219,7 @@ public class StudyServiceImpl implements IStudyService{
// 更新 前端传输已学习时长
@Override
@Transactional
public void updateLastTime(String studyContentId, int lastStudyTime,String aid) {
public void updateLastTime(String studyContentId, int lastStudyTime,String aid,Float processVideo) {
// 更新最后的学习时间点
LocalDateTime now=LocalDateTime.now();
UpdateBuilder update=UpdateBuilder.from(StudyCourseItem.class);
@@ -228,6 +228,7 @@ public class StudyServiceImpl implements IStudyService{
update.addFilter(FieldFilters.lt("lastStudyTime", lastStudyTime));
update.addUpdateField("lastStudyTime", lastStudyTime);
update.addUpdateField("lastTime", now);
update.addUpdateField("processVideo", processVideo);
scItemDao.update(update.builder());
//增加用户的学习时长,在api中调用
}