Bläddra i källkod

update content

reghao 2 veckor sedan
förälder
incheckning
e8163a9917
18 ändrade filer med 91 tillägg och 87 borttagningar
  1. 6 9
      content/content-api/src/main/java/cn/reghao/tnb/content/api/constant/VideoStatus.java
  2. 1 0
      content/content-api/src/main/java/cn/reghao/tnb/content/api/dto/VideoSearch.java
  3. 2 0
      content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/db/mapper/VideoFileMapper.java
  4. 3 3
      content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/db/mapper/VideoPostMapper.java
  5. 2 0
      content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/db/mapper/VideoStatisticMapper.java
  6. 2 0
      content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/db/mapper/VideoTagMapper.java
  7. 7 5
      content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/db/repository/VideoRepository.java
  8. 5 6
      content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/model/dto/SearchCriteria.java
  9. 3 3
      content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/model/po/VideoPost.java
  10. 4 4
      content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/model/query/VideoQuery.java
  11. 14 5
      content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/service/AdminVodService.java
  12. 5 14
      content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/service/VideoPostQuery.java
  13. 2 1
      content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/service/VideoPostService.java
  14. 6 6
      content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/service/VideoService.java
  15. 5 0
      content/content-service/src/main/resources/mapper/vod/VideoFileMapper.xml
  16. 14 31
      content/content-service/src/main/resources/mapper/vod/VideoPostMapper.xml
  17. 5 0
      content/content-service/src/main/resources/mapper/vod/VideoStatisticMapper.xml
  18. 5 0
      content/content-service/src/main/resources/mapper/vod/VideoTagMapper.xml

+ 6 - 9
content/content-api/src/main/java/cn/reghao/tnb/content/api/constant/VideoStatus.java

@@ -5,20 +5,17 @@ import java.util.Map;
 
 /**
  * 视频状态
- * 审核 -> 发布 -> 撤销
+ * 待发布 -> 待审核 -> 已发布 -> 审核未通过 -> 下架
  *
  * @author reghao
  * @date 2021-11-24 17:49:19
  */
 public enum VideoStatus {
-    censor(1, "审核中"),
-    publish(2, "审核通过"),
-    censorFailed(3, "审核未通过"),
-    revoke(4, "下架"),
-    noVideoFile(5, "无视频资源"),
-    hasAd(6, "视频有广告"),
-    needRepair(7, "视频待修正"),
-    needRestore(8, "视频待恢复");
+    DRAFT(1, "待发布"),
+    PENDING_REVIEW(2, "待审核"),
+    PUBLISHED(3, "已发布"),
+    REVIEW_REJECTED(4, "审核未通过"),
+    OFFLINED(5, "下架");
 
     private final Integer code;
     private final String desc;

+ 1 - 0
content/content-api/src/main/java/cn/reghao/tnb/content/api/dto/VideoSearch.java

@@ -20,6 +20,7 @@ public class VideoSearch implements Serializable {
     private Integer categoryPid;
     private Integer categoryId;
     private String title;
+    private Integer status;
     private Integer durationGt;
     private Boolean horizontal;
     private String orderBy;

+ 2 - 0
content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/db/mapper/VideoFileMapper.java

@@ -14,6 +14,8 @@ import java.util.List;
  */
 @Mapper
 public interface VideoFileMapper extends BaseMapper<VideoFile> {
+    void deleteByVideoId(String videoId);
+
     void updateDeleteByObjectId(String objectId);
 
     List<VideoUrlDto> findVideoUrls(String videoId);

+ 3 - 3
content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/db/mapper/VideoPostMapper.java

@@ -20,14 +20,14 @@ import java.util.List;
  */
 @Mapper
 public interface VideoPostMapper extends BaseMapper<VideoPost> {
+    void deleteByVideoId(String videoId);
+
     void updateVideoScope(@Param("videoId") String videoId, @Param("scope") int scope);
     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 updateVideoFile(@Param("videoId") String videoId, @Param("status") int status, @Param("duration") int duration);
     void updateVideoPublish(VideoPost videoPost);
-    void updateVideoCached(@Param("videoId") String videoId, @Param("videoMeta") VideoMeta videoMeta);
-    void deleteByVideoId(String videoId);
 
     /* 根据条件分页获取 */
     int countByCriteria(VideoQuery videoQuery);
@@ -41,7 +41,7 @@ public interface VideoPostMapper extends BaseMapper<VideoPost> {
     List<VideoPost> findSearchCriteriaByPage(@Param("page") Page page, @Param("searchCriteria") SearchCriteria searchCriteria);
 
     List<String> findRandomVideoIds(@Param("scopes") List<Integer> scopes, @Param("size") int size);
-    List<String> findShortVideo(List<Integer> scopes);
+    List<String> findShortVideo(@Param("status") int status, @Param("scopes") List<Integer> scopes);
     VideoPost findByVideoId(String videoId);
 
     // test case 中使用

+ 2 - 0
content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/db/mapper/VideoStatisticMapper.java

@@ -12,6 +12,8 @@ import java.util.List;
  */
 @Mapper
 public interface VideoStatisticMapper extends BaseMapper<VideoStatistic> {
+    void deleteByVideoId(String videoId);
+
     void updateSetDelete(String videoId);
     void updateIncrView(String videoId);
 

+ 2 - 0
content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/db/mapper/VideoTagMapper.java

@@ -14,6 +14,8 @@ import java.util.List;
  */
 @Mapper
 public interface VideoTagMapper extends BaseMapper<VideoTag> {
+    void deleteByVideoId(String videoId);
+
     void updateSetScope(@Param("videoId") String videoId, @Param("scope") int scope);
 
     int countVideosByTag(@Param("tagId") String tagId, @Param("scopes") List<Integer> scopes);

+ 7 - 5
content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/db/repository/VideoRepository.java

@@ -58,7 +58,7 @@ public class VideoRepository {
 
     @Transactional(rollbackFor = Exception.class)
     public void updateVideoFile(VideoFile videoFile) {
-        videoPostMapper.updateVideoFile(videoFile.getVideoId(), VideoStatus.censor.getCode(), videoFile.getDuration());
+        videoPostMapper.updateVideoFile(videoFile.getVideoId(), VideoStatus.PENDING_REVIEW.getCode(), videoFile.getDuration());
         videoFileMapper.update(videoFile);
     }
 
@@ -117,9 +117,6 @@ public class VideoRepository {
     @Transactional(rollbackFor = Exception.class)
     @Deprecated
     public void updateBiliVideoFile(String videoId, VideoMeta videoMeta) {
-        VideoFile videoFile = new VideoFile(videoId, videoMeta);
-        videoFileMapper.save(videoFile);
-        videoPostMapper.updateVideoCached(videoId, videoMeta);
     }
 
     public void updateVideoStatistic(VideoStatistic videoStatistic) {
@@ -131,8 +128,12 @@ public class VideoRepository {
     }
 
     //@CacheEvict(cacheNames = "tnb:vod:info", key = "#videoId")
+    @Transactional(rollbackFor = Exception.class)
     public void deleteVideoPost(String videoId) {
         videoPostMapper.deleteByVideoId(videoId);
+        videoStatisticMapper.deleteByVideoId(videoId);
+        videoFileMapper.deleteByVideoId(videoId);
+        videoTagMapper.deleteByVideoId(videoId);
     }
 
     public List<VideoUrlDto> getVideoUrls(String videoId) {
@@ -145,7 +146,8 @@ public class VideoRepository {
 
     @Cacheable(cacheNames = "tnb:content:short_video", unless = "#result == null")
     public List<String> getShortVideoIds(List<Integer> userScopes) {
-        List<String> videoIds = videoPostMapper.findShortVideo(userScopes);
+        int status = VideoStatus.PUBLISHED.getCode();
+        List<String> videoIds = videoPostMapper.findShortVideo(status, userScopes);
         return videoIds;
     }
 

+ 5 - 6
content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/model/dto/SearchCriteria.java

@@ -16,9 +16,8 @@ import java.util.List;
  */
 @Getter
 public class SearchCriteria {
-    @NotEmpty
-    @Size(min = 1, max = 10, message = "status 10 个元素")
-    private final List<Integer> status;
+    @NotNull
+    private final Integer status;
     @NotEmpty
     @Size(min = 1, max = 10, message = "scope 10 个元素")
     private final List<Integer> scope;
@@ -36,17 +35,17 @@ public class SearchCriteria {
     }
 
     public static final class Builder {
-        private List<Integer> status;
+        private Integer status;
         private List<Integer> scope;
         private String title;
         private Integer nextId;
 
         public Builder() {
-            this.status = List.of(VideoStatus.publish.getCode(), VideoStatus.noVideoFile.getCode());
+            this.status = VideoStatus.PUBLISHED.getCode();
             this.scope = List.of(PostScope.PUBLIC.getCode());
         }
 
-        public Builder status(List<Integer> status) {
+        public Builder status(Integer status) {
             this.status = status;
             return this;
         }

+ 3 - 3
content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/model/po/VideoPost.java

@@ -63,7 +63,7 @@ public class VideoPost extends BaseObject<Integer> {
         this.horizontal = videoInfo.getHorizontal();
         this.coverUrl = "";
         this.scope = PostScope.PRIVATE.getCode();
-        this.status = VideoStatus.censor.getCode();
+        this.status = VideoStatus.DRAFT.getCode();
         this.publishAt = DateTimeConverter.localDateTime(System.currentTimeMillis());
         this.publishBy = UserContext.getUserId();
     }
@@ -76,7 +76,7 @@ public class VideoPost extends BaseObject<Integer> {
         this.categoryPid = video.getCategoryPid();
         this.categoryId = video.getCategoryId();
         this.scope = PostScope.PUBLIC.getCode();
-        this.status = VideoStatus.noVideoFile.getCode();
+        this.status = VideoStatus.PUBLISHED.getCode();
         this.horizontal = video.getHorizontal();
         this.duration = video.getDuration().intValue();
         this.coverUrl = video.getCoverUrl();
@@ -91,7 +91,7 @@ public class VideoPost extends BaseObject<Integer> {
         this.categoryId = video.getCategoryId();
         this.coverUrl = coverUrl;
         this.scope = video.getScope();
-        //this.status = VideoStatus.publish.getCode();
+        this.status = VideoStatus.PENDING_REVIEW.getCode();
         this.publishAt = DateTimeConverter.localDateTime(publishAt);
     }
 }

+ 4 - 4
content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/model/query/VideoQuery.java

@@ -11,7 +11,7 @@ import java.util.List;
  */
 @Getter
 public class VideoQuery {
-    private List<Integer> status;
+    private Integer status;
     private List<Integer> scope;
     private Integer categoryPid;
     private Integer categoryId;
@@ -40,7 +40,7 @@ public class VideoQuery {
     }
 
     public static final class Builder {
-        private List<Integer> status;
+        private Integer status;
         private List<Integer> scope;
         private Integer categoryPid;
         private Integer categoryId;
@@ -54,11 +54,11 @@ public class VideoQuery {
         private String orderDirection;
 
         public Builder() {
-            this.status = List.of(VideoStatus.publish.getCode(), VideoStatus.noVideoFile.getCode());
+            this.status = VideoStatus.PUBLISHED.getCode();
             //this.scope = List.of(PostScope.PUBLIC.getCode());
         }
 
-        public Builder status(List<Integer> status) {
+        public Builder status(Integer status) {
             this.status = status;
             return this;
         }

+ 14 - 5
content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/service/AdminVodService.java

@@ -95,17 +95,17 @@ public class AdminVodService {
     public String submitAudit(AuditResult auditResult) {
         String videoId = auditResult.getVideoId();
         int decision = auditResult.getDecision();
-        if (decision == VideoStatus.publish.getCode()) {
-            videoPostMapper.updateVideoStatus(videoId, VideoStatus.publish.getCode());
+        if (decision == VideoStatus.PUBLISHED.getCode()) {
+            videoPostMapper.updateVideoStatus(videoId, VideoStatus.PUBLISHED.getCode());
         } else {
-            videoPostMapper.updateVideoStatus(videoId, VideoStatus.censorFailed.getCode());
+            videoPostMapper.updateVideoStatus(videoId, VideoStatus.REVIEW_REJECTED.getCode());
         }
 
         long receiver = videoPostMapper.findByVideoId(videoId).getPublishBy();
         int msgType = MsgType.chargeMsg.getValue();
         String title = "稿件审核";
         String content = String.format("稿件 %s 通过审核", videoId);
-        if (decision != VideoStatus.publish.getCode()) {
+        if (decision != VideoStatus.PUBLISHED.getCode()) {
             content = String.format("稿件 %s 未通过审核", videoId);
         }
 
@@ -116,7 +116,7 @@ public class AdminVodService {
         int pageSize = 10;
         Page page = new Page(pageNumber, pageSize);
         VideoQuery videoQuery = new VideoQuery.Builder()
-                .status(List.of(VideoStatus.censor.getCode()))
+                .status(VideoStatus.PENDING_REVIEW.getCode())
                 .scope(null)
                 .build();
         List<VideoPost> list = videoPostMapper.findVideoPostByPage(page, videoQuery);
@@ -167,6 +167,15 @@ public class AdminVodService {
                     .build();
         }
 
+        if (videoSearch.getStatus() != null) {
+            videoQuery = new VideoQuery.Builder()
+                    .status(videoSearch.getStatus())
+                    .scope(null)
+                    .orderBy(videoSearch.getOrderBy())
+                    .orderDirection(videoSearch.getOrderDirection())
+                    .build();
+        }
+
         int total = videoPostMapper.countByCriteria(videoQuery);
         List<AdminVideo> list = videoPostMapper.findVideoPostByPage(page, videoQuery).stream()
                 .map(this::getAdminVideo)

+ 5 - 14
content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/service/VideoPostQuery.java

@@ -154,7 +154,7 @@ public class VideoPostQuery {
         VideoQuery videoQuery;
         long loginUser = UserContext.getUserId();
         if (loginUser == userId) {
-            videoQuery = new VideoQuery.Builder().status(getVideoStatusList()).userId(userId).build();
+            videoQuery = new VideoQuery.Builder().userId(userId).build();
         } else {
             List<Integer> scopes = contentPermission.getUserScopes();
             videoQuery = new VideoQuery.Builder().scope(scopes).userId(userId).build();
@@ -163,15 +163,6 @@ public class VideoPostQuery {
         return getVideoCards(videoQuery, page, false);
     }
 
-    private List<Integer> getVideoStatusList() {
-        List<Integer> list = new ArrayList<>();
-        for (VideoStatus videoStatus : VideoStatus.values()) {
-            list.add(videoStatus.getCode());
-        }
-
-        return list;
-    }
-
     private PageList<VideoCard> getVideoCards(VideoQuery videoQuery, int page, boolean user) {
         int total = videoPostMapper.countByCriteria(videoQuery);
         Page page1 = new Page(page, pageSize);
@@ -200,7 +191,7 @@ public class VideoPostQuery {
 
         String publishAtStr = StringUtil.getPubDateStr(videoPostCard.getPublishAt());
         String durationStr = StringUtil.getTimeStr(videoPostCard.getDuration());
-        boolean cached = videoPostCard.getStatus() == VideoStatus.publish.getCode();
+        boolean cached = videoPostCard.getStatus() == VideoStatus.PUBLISHED.getCode();
         return new VideoCard(videoPostCard, durationStr, cached, publishAtStr, userCard);
     }
 
@@ -211,7 +202,7 @@ public class VideoPostQuery {
         }
 
         int status = videoPost.getStatus();
-        if (status != VideoStatus.publish.getCode() && status != VideoStatus.noVideoFile.getCode()) {
+        if (status != VideoStatus.PUBLISHED.getCode()) {
             return WebResult.notFound();
         }
 
@@ -261,7 +252,7 @@ public class VideoPostQuery {
 
     private List<String> getRandomVipVideoIds() {
         VideoQuery videoQuery = new VideoQuery.Builder()
-                .status(List.of(VideoStatus.publish.getCode()))
+                .status(VideoStatus.PUBLISHED.getCode())
                 .scope(List.of(PostScope.PROTECT.getCode()))
                 .categoryPid(11)
                 .build();
@@ -296,7 +287,7 @@ public class VideoPostQuery {
         Page page1 = new Page(pageNumber, pageSize);
         long userId = UserContext.getUserId();
 
-        VideoQuery videoQuery = new VideoQuery.Builder().status(getStatusList()).userId(userId).build();
+        VideoQuery videoQuery = new VideoQuery.Builder().userId(userId).build();
         int total = videoPostMapper.countByCriteria(videoQuery);
         List<UserVideoPost> list = videoPostMapper.findVideoPostByPage(page1, videoQuery).stream()
                 .map(this::getUserVideoPost)

+ 2 - 1
content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/service/VideoPostService.java

@@ -220,11 +220,12 @@ public class VideoPostService {
 
     public void deleteVideo(String videoId) {
         VideoPost videoPost = videoRepository.getVideoPost(videoId);
-        long owner = videoPost.getPublishBy();
+        long owner = -1L;
         if (owner == UserContext.getUserId()) {
             // 删除 videoId 关联的所有数据, 包括观看记录, 用户收藏, 视频数据, 视频标签, 推荐数据等
             String coverUrl = videoPost.getCoverUrl();
             ossService.deleteByObjectUrl(coverUrl);
+
             List<VideoUrlDto> list = videoRepository.getVideoUrls(videoId);
             for (VideoUrlDto videoUrlDto : list) {
                 String videoFileId = videoUrlDto.getObjectId();

+ 6 - 6
content/content-service/src/main/java/cn/reghao/tnb/content/app/vod/service/VideoService.java

@@ -88,22 +88,22 @@ public class VideoService {
             case noCover:
             case noAudio:
             case noVideo:
-                videoStatus = VideoStatus.needRepair.getCode();
+                videoStatus = VideoStatus.OFFLINED.getCode();
                 break;
             case noResource:
-                videoStatus = VideoStatus.revoke.getCode();
+                videoStatus = VideoStatus.OFFLINED.getCode();
                 break;
             case hasAd:
-                videoStatus = VideoStatus.hasAd.getCode();
+                videoStatus = VideoStatus.OFFLINED.getCode();
                 break;
             case needRestore:
-                videoStatus = VideoStatus.needRestore.getCode();
+                videoStatus = VideoStatus.OFFLINED.getCode();
                 break;
             default:
                 return Result.fail("unknown errorType");
         }
 
-        videoPostMapper.updateVideoStatus(videoId, videoStatus);
+        /*videoPostMapper.updateVideoStatus(videoId, videoStatus);
         if (videoStatus != VideoStatus.revoke.getCode() || videoStatus != VideoStatus.needRestore.getCode()) {
             VideoError videoError = new VideoError(videoErrorReport);
             videoErrorMapper.save(videoError);
@@ -111,7 +111,7 @@ public class VideoService {
 
         if (videoStatus == VideoStatus.revoke.getCode()) {
             dataSearchService.deleteVideoSummary(videoId);
-        }
+        }*/
 
         return Result.success();
     }

+ 5 - 0
content/content-service/src/main/resources/mapper/vod/VideoFileMapper.xml

@@ -17,6 +17,11 @@
         </foreach>
     </insert>
 
+    <delete id="deleteByVideoId">
+        delete from vod_video_file
+        where video_id=#{videoId}
+    </delete>
+
     <update id="updateDeleteByObjectId">
         update vod_video_file
         set deleted=1

+ 14 - 31
content/content-service/src/main/resources/mapper/vod/VideoPostMapper.xml

@@ -9,6 +9,11 @@
         (#{videoId},#{title},#{description},#{categoryPid},#{categoryId},#{coverUrl},#{scope},#{status},#{horizontal},#{duration},#{publishAt},#{publishBy})
     </insert>
 
+    <delete id="deleteByVideoId">
+        delete from vod_video_post
+        where video_id=#{videoId}
+    </delete>
+
     <update id="updateVideoScope">
         update vod_video_post
         set update_time=now(),scope=#{scope}
@@ -39,16 +44,6 @@
         set update_time=now(),`title`=#{title},`description`=#{description},`category_pid`=#{categoryPid},`category_id`=#{categoryId},`cover_url`=#{coverUrl},`scope`=#{scope},`status`=#{status},`publish_at`=#{publishAt}
         where video_id=#{videoId}
     </update>
-    <update id="updateVideoCached">
-        update vod_video_post
-        set update_time=now(),duration=#{videoMeta.duration},`status`=2
-        where video_id=#{videoId}
-    </update>
-
-    <delete id="deleteByVideoId">
-        delete from vod_video_post
-        where video_id=#{videoId}
-    </delete>
 
     <select id="countByCriteria" resultType="java.lang.Integer">
         select count(*)
@@ -93,10 +88,7 @@
         <where>
             deleted=0
             <if test="videoQuery.status != null">
-                and post.status in
-                <foreach collection="videoQuery.status" item="id" index="index" open="(" close=")" separator=",">
-                    #{id}
-                </foreach>
+                and post.status=#{videoQuery.status}
             </if>
             <if test="videoQuery.scope != null">
                 and post.scope in
@@ -140,7 +132,7 @@
         statistic.view,statistic.comment
         from vod_video_post post
         inner join vod_video_statistic statistic
-        on post.deleted=0 and statistic.video_id=post.video_id and post.status in (2,5,6,7) and post.video_id in
+        on post.deleted=0 and statistic.video_id=post.video_id and post.video_id in
         <foreach collection="list" item="id" index="index" open="(" close=")" separator=",">
             #{id}
         </foreach>
@@ -150,7 +142,7 @@
         statistic.view,statistic.comment
         from vod_video_post post
         inner join vod_video_statistic statistic
-        on statistic.video_id=post.video_id and post.status in (2,5,6,7) and post.publish_by in
+        on statistic.video_id=post.video_id and post.status=3 and post.publish_by in
         <foreach collection="userIds" item="id" index="index" open="(" close=")" separator=",">
             #{id}
         </foreach>
@@ -164,10 +156,7 @@
         <where>
             post.deleted=0
             <if test="videoQuery.status != null">
-                and post.status in
-                <foreach collection="videoQuery.status" item="id" index="index" open="(" close=")" separator=",">
-                    #{id}
-                </foreach>
+                and post.status=#{videoQuery.status}
             </if>
             <if test="videoQuery.scope != null">
                 and post.scope in
@@ -190,10 +179,7 @@
         <where>
             deleted=0
             <if test="status != null">
-                and `status` in
-                <foreach collection="status" item="id" index="index" open="(" close=")" separator=",">
-                    #{id}
-                </foreach>
+                and status=#{status}
             </if>
             <if test="scope != null">
                 and scope in
@@ -212,10 +198,7 @@
         <where>
             deleted=0
             <if test="searchCriteria.status != null">
-                and status in
-                <foreach collection="searchCriteria.status" item="id" index="index" open="(" close=")" separator=",">
-                    #{id}
-                </foreach>
+                and status=#{status}
             </if>
             <if test="searchCriteria.scope != null">
                 and scope in
@@ -237,12 +220,12 @@
     <select id="findAll" resultType="cn.reghao.tnb.content.app.vod.model.po.VideoPost">
         select *
         from vod_video_post
-        where deleted=0 and `status`=2 and category_pid=11
+        limit 1000
     </select>
     <select id="findAllById" resultType="cn.reghao.tnb.content.app.vod.model.po.VideoPost">
         select *
         from vod_video_post
-        where deleted=0 and `status` in (2,5) and id > #{nextId}
+        where id > #{nextId}
         order by id asc
         limit #{pageSize}
     </select>
@@ -260,7 +243,7 @@
     <select id="findShortVideo" resultType="java.lang.String">
         SELECT video_id
         FROM vod_video_post AS t1
-        WHERE t1.duration&lt;=120 and t1.`status`=2 and t1.`horizontal`=0 and t1.scope in
+        WHERE t1.duration&lt;=120 and t1.`status`=#{status} and t1.`horizontal`=0 and t1.scope in
         <foreach collection="list" item="id" index="index" open="(" close=")" separator=",">
             #{id}
         </foreach>

+ 5 - 0
content/content-service/src/main/resources/mapper/vod/VideoStatisticMapper.xml

@@ -15,6 +15,11 @@
         (#{item.videoId},#{item.view},#{item.danmaku},#{item.comment},#{item.favorite},#{item.share},#{item.thumbUp},#{item.thumbDown},#{item.coin})
     </insert>
 
+    <delete id="deleteByVideoId">
+        delete from vod_video_statistic
+        where video_id=#{videoId}
+    </delete>
+
     <update id="update">
         update vod_video_statistic
         set `view`=#{view},danmaku=#{danmaku},`comment`=#{comment},favorite=#{favorite},`share`=#{share},thumb_up=#{thumbUp},coin=#{coin}

+ 5 - 0
content/content-service/src/main/resources/mapper/vod/VideoPostTagMapper.xml → content/content-service/src/main/resources/mapper/vod/VideoTagMapper.xml

@@ -17,6 +17,11 @@
         </foreach>
     </insert>
 
+    <delete id="deleteByVideoId">
+        delete from vod_video_tag
+        where video_id=#{videoId}
+    </delete>
+
     <update id="updateSetScope">
         update vod_video_tag
         set `scope`=#{scope}