@@ -24,6 +24,7 @@ public interface VideoPostMapper extends BaseMapper<VideoPost> {
void updateVideoInfo(VideoInfoUpdate videoInfoUpdate);
void updateVideoCover(@Param("videoId") String videoId, @Param("coverUrl") String coverUrl);
void updateVideoStatus(@Param("videoId") String videoId, @Param("status") int status);
+ void updateVideoDuration(@Param("videoId") String videoId, @Param("duration") int duration);
void updateVideoPublish(VideoPost videoPost);
void updateVideoCached(@Param("videoId") String videoId, @Param("videoMeta") VideoMeta videoMeta);
void deleteByVideoId(String videoId);
@@ -56,6 +56,7 @@ public class VideoRepository {
}
public void updateVideoFile(VideoFile videoFile) {
+ videoPostMapper.updateVideoDuration(videoFile.getVideoId(), videoFile.getDuration());
videoFileMapper.update(videoFile);
@@ -216,7 +216,7 @@ public class VideoPostService {
int scope = videoPost.getScope();
if (scope != PostScope.PRIVATE.getCode()) {
- ossService.checkAndSetScope(videoId, scope);
+ ossService.checkAndSetScope(videoFileId, scope);
String objectId = videoMeta.getObjectId();
@@ -29,6 +29,11 @@
set update_time=now(),`status`=#{status}
where video_id=#{videoId}
</update>
+ <update id="updateVideoDuration">
+ update vod_video_post
+ set update_time=now(),`duration`=#{duration}
+ where video_id=#{videoId}
+ </update>
<update id="updateVideoPublish">
update vod_video_post
set update_time=now(),`title`=#{title},`description`=#{description},`category_pid`=#{categoryPid},`category_id`=#{categoryId},`cover_url`=#{coverUrl},`scope`=#{scope},`status`=#{status},`publish_at`=#{publishAt}