mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-11 20:06:51 +08:00
content表添加processVideo字段
This commit is contained in:
@@ -83,8 +83,13 @@ public class CourseContent extends BaseEntity {
|
||||
* */
|
||||
@Column(name = "duration")
|
||||
private Integer duration;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 视频播放进度
|
||||
* */
|
||||
@Column(name = "progress_video")
|
||||
private Float progressVideo;
|
||||
|
||||
/**用于学习时的状态显示,非存储字段*/
|
||||
@Transient
|
||||
private Integer status;
|
||||
|
||||
@@ -82,4 +82,7 @@ public interface ICourseContentService{
|
||||
* @return
|
||||
*/
|
||||
CourseAssess getAssess(String ccid);
|
||||
|
||||
void updateProcessVideo(String contentId, String courseId, Float processVideo);
|
||||
|
||||
}
|
||||
|
||||
@@ -141,6 +141,14 @@ public class CourseContentServiceImpl implements ICourseContentService {
|
||||
return assess;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProcessVideo(String id, String courseId, Float processVideo) {
|
||||
CourseContent cc= new CourseContent();
|
||||
cc.setProgressVideo(processVideo);
|
||||
String sql = "update boe_course_content set progress_video="+ processVideo+" where id="+id+" and course_id="+courseId+" ";
|
||||
ccDao.sqlUpdate(sql);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateName(String id, String name) {
|
||||
|
||||
@@ -529,7 +529,7 @@ public class StudyCourseApi extends ApiBaseController{
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/study-video-time")
|
||||
public JsonResponse<Boolean> study(String studyId,String itemId,Integer videoTime,Float processVideo){
|
||||
public JsonResponse<Boolean> study(String itemId,Integer videoTime,String contentId , String courseId,Float processVideo){
|
||||
|
||||
if(StringUtils.isBlank(itemId)){
|
||||
return error("参数错误");
|
||||
@@ -539,7 +539,8 @@ public class StudyCourseApi extends ApiBaseController{
|
||||
}
|
||||
//检查是否已存在
|
||||
try {
|
||||
studyService.updateLastTime(itemId,videoTime,getCurrent().getAccountId(),processVideo);
|
||||
studyService.updateLastTime(itemId,videoTime,getCurrent().getAccountId());
|
||||
contentService.updateProcessVideo(contentId,courseId,processVideo);
|
||||
return success(true);
|
||||
}catch(Exception e) {
|
||||
log.error("记录最后学习时间错误",e);
|
||||
|
||||
@@ -121,12 +121,6 @@ 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,Float processVideo);
|
||||
void updateLastTime(String studyContentId,int lastStudyTime,String aid);
|
||||
|
||||
/**
|
||||
* 资源学习记录
|
||||
|
||||
@@ -219,7 +219,7 @@ public class StudyServiceImpl implements IStudyService{
|
||||
// 更新 前端传输已学习时长
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateLastTime(String studyContentId, int lastStudyTime,String aid,Float processVideo) {
|
||||
public void updateLastTime(String studyContentId, int lastStudyTime,String aid) {
|
||||
// 更新最后的学习时间点
|
||||
LocalDateTime now=LocalDateTime.now();
|
||||
UpdateBuilder update=UpdateBuilder.from(StudyCourseItem.class);
|
||||
@@ -228,7 +228,6 @@ 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