Merge branch 'zcwy0606-llf' into dev0525

This commit is contained in:
zhaolongfei
2024-06-13 15:29:03 +08:00
4 changed files with 11 additions and 4 deletions

View File

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

View File

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

View File

@@ -38,7 +38,7 @@ public interface IStudyService {
* @param lastStudyTime * @param lastStudyTime
* @param aid * @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 @Override
@Transactional @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(); LocalDateTime now=LocalDateTime.now();
UpdateBuilder update=UpdateBuilder.from(StudyCourseItem.class); UpdateBuilder update=UpdateBuilder.from(StudyCourseItem.class);
@@ -228,6 +228,7 @@ public class StudyServiceImpl implements IStudyService{
update.addFilter(FieldFilters.lt("lastStudyTime", lastStudyTime)); update.addFilter(FieldFilters.lt("lastStudyTime", lastStudyTime));
update.addUpdateField("lastStudyTime", lastStudyTime); update.addUpdateField("lastStudyTime", lastStudyTime);
update.addUpdateField("lastTime", now); update.addUpdateField("lastTime", now);
update.addUpdateField("processVideo", processVideo);
scItemDao.update(update.builder()); scItemDao.update(update.builder());
//增加用户的学习时长,在api中调用 //增加用户的学习时长,在api中调用
} }