mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-10 03:16:48 +08:00
item添加processVideo字段
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -121,6 +121,12 @@ public class StudyCourseItem extends IdEntity {
|
||||
* */
|
||||
@Column(name = "progress")
|
||||
private Integer progress;
|
||||
|
||||
/*
|
||||
* 视频播放进度
|
||||
* */
|
||||
@Column(name = "progress_video")
|
||||
private Integer progressVideo;
|
||||
|
||||
/**
|
||||
* 学习状态,当前未使用 ,以学习进度100来定义是否已学完
|
||||
|
||||
@@ -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);
|
||||
|
||||
/**
|
||||
* 资源学习记录
|
||||
|
||||
@@ -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中调用
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user