Pārlūkot izejas kodu

Merge branch 'wyp/0111-auditTitleUpdate' of Server/long-article-recommend into master

wangyunpeng 5 mēneši atpakaļ
vecāks
revīzija
8fe617df5c

+ 6 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/mapper/longArticle/ArticleAuditMapper.java

@@ -1,5 +1,7 @@
 package com.tzld.longarticle.recommend.server.mapper.longArticle;
 
+import com.tzld.longarticle.recommend.server.model.param.videoAudit.ArticleTitleUpdateParam;
+import com.tzld.longarticle.recommend.server.model.param.videoAudit.VideoTitleUpdateParam;
 import com.tzld.longarticle.recommend.server.model.vo.ArticleVideoAuditListVO;
 import org.apache.ibatis.annotations.Mapper;
 
@@ -18,5 +20,8 @@ public interface ArticleAuditMapper {
     void updateCrawlerVideoIsIllegal(List<Integer> illegalVideoIds, Integer isIllegal);
 
     List<String> searchFilterValueByItemName(String itemName, String searchKeyword);
-    
+
+    void updateArticleTitle(ArticleTitleUpdateParam param, Long updateTime);
+
+    void updateVideoTitle(VideoTitleUpdateParam param, Long updateTime);
 }

+ 10 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/param/videoAudit/ArticleTitleUpdateParam.java

@@ -0,0 +1,10 @@
+package com.tzld.longarticle.recommend.server.model.param.videoAudit;
+
+import lombok.Data;
+
+@Data
+public class ArticleTitleUpdateParam {
+    private String contentId;
+    private String title;
+    private String updateAccount;
+}

+ 11 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/param/videoAudit/VideoTitleUpdateParam.java

@@ -0,0 +1,11 @@
+package com.tzld.longarticle.recommend.server.model.param.videoAudit;
+
+import lombok.Data;
+
+@Data
+public class VideoTitleUpdateParam {
+    private String contentId;
+    private Long videoId;
+    private String title;
+    private String updateAccount;
+}

+ 11 - 4
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/ArticleVideoAuditService.java

@@ -10,10 +10,7 @@ import com.tzld.longarticle.recommend.server.model.entity.longArticle.ArticleReM
 import com.tzld.longarticle.recommend.server.model.entity.longArticle.LongArticleCrawlerVideo;
 import com.tzld.longarticle.recommend.server.model.entity.longArticle.LongArticleTitleAudit;
 import com.tzld.longarticle.recommend.server.model.entity.longArticle.LongArticlesMatchVideo;
-import com.tzld.longarticle.recommend.server.model.param.videoAudit.ArticleAuditParam;
-import com.tzld.longarticle.recommend.server.model.param.videoAudit.ArticleVideoAuditListParam;
-import com.tzld.longarticle.recommend.server.model.param.videoAudit.AuditFilterParam;
-import com.tzld.longarticle.recommend.server.model.param.videoAudit.VideoAuditParam;
+import com.tzld.longarticle.recommend.server.model.param.videoAudit.*;
 import com.tzld.longarticle.recommend.server.model.vo.ArticleVideoAuditListVO;
 import com.tzld.longarticle.recommend.server.repository.longArticle.*;
 import com.tzld.longarticle.recommend.server.util.page.Page;
@@ -216,4 +213,14 @@ public class ArticleVideoAuditService {
         }
         return ReturnT.SUCCESS;
     }
+
+    public void updateArticleTitle(ArticleTitleUpdateParam param) {
+        long now = System.currentTimeMillis();
+        articleAuditMapper.updateArticleTitle(param, now);
+    }
+
+    public void updateVideoTitle(VideoTitleUpdateParam param) {
+        long now = System.currentTimeMillis();
+        articleAuditMapper.updateVideoTitle(param, now);
+    }
 }

+ 15 - 4
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/web/recommend/ArticleVideoAuditController.java

@@ -1,10 +1,7 @@
 package com.tzld.longarticle.recommend.server.web.recommend;
 
 import com.tzld.longarticle.recommend.server.common.response.CommonResponse;
-import com.tzld.longarticle.recommend.server.model.param.videoAudit.ArticleAuditParam;
-import com.tzld.longarticle.recommend.server.model.param.videoAudit.ArticleVideoAuditListParam;
-import com.tzld.longarticle.recommend.server.model.param.videoAudit.AuditFilterParam;
-import com.tzld.longarticle.recommend.server.model.param.videoAudit.VideoAuditParam;
+import com.tzld.longarticle.recommend.server.model.param.videoAudit.*;
 import com.tzld.longarticle.recommend.server.model.vo.ArticleVideoAuditListVO;
 import com.tzld.longarticle.recommend.server.service.recommend.ArticleVideoAuditService;
 import com.tzld.longarticle.recommend.server.util.page.Page;
@@ -51,4 +48,18 @@ public class ArticleVideoAuditController {
         return CommonResponse.success();
     }
 
+
+    @PostMapping("/updateArticleTitle")
+    public CommonResponse<Void> updateArticleTitle(@RequestBody ArticleTitleUpdateParam param) {
+        service.updateArticleTitle(param);
+        return CommonResponse.success();
+    }
+
+
+    @PostMapping("/updateVideoTitle")
+    public CommonResponse<Void> updateVideoTitle(@RequestBody VideoTitleUpdateParam param) {
+        service.updateVideoTitle(param);
+        return CommonResponse.success();
+    }
+
 }

+ 18 - 0
long-article-recommend-service/src/main/resources/mapper/longArticle/ArticleAuditMapper.xml

@@ -119,4 +119,22 @@
         </choose>
     </select>
 
+    <update id="updateArticleTitle">
+        update long_articles_text
+        set old_article_title = article_title,
+            article_title = #{param.title},
+            article_title_update_account = #{param.updateAccount},
+            article_title_update_timestamp = #{updateTime}
+        where content_id = #{param.contentId}
+    </update>
+
+    <update id="updateVideoTitle">
+        update long_articles_text
+        set old_kimi_title = kimi_title,
+            kimi_title = #{param.title},
+            kimi_title_update_account = #{param.updateAccount},
+            kimi_title_update_timestamp = #{updateTime}
+        where content_id = #{param.contentId}
+    </update>
+
 </mapper>