Explorar o código

长文增加播放按钮改为aigc配置

wangyunpeng hai 1 día
pai
achega
a5fa0df5bb

+ 11 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/po/longarticle/PlanAccount.java

@@ -59,6 +59,8 @@ public class PlanAccount {
 
     private Integer specialNotSend;
 
+    private Integer addPlayButtonFlag;
+
     private Integer isDelete;
 
     private Date createTime;
@@ -289,6 +291,14 @@ public class PlanAccount {
         this.specialNotSend = specialNotSend;
     }
 
+    public Integer getAddPlayButtonFlag() {
+        return addPlayButtonFlag;
+    }
+
+    public void setAddPlayButtonFlag(Integer addPlayButtonFlag) {
+        this.addPlayButtonFlag = addPlayButtonFlag;
+    }
+
     public Integer getIsDelete() {
         return isDelete;
     }
@@ -347,6 +357,7 @@ public class PlanAccount {
         sb.append(", publishOpenFlag=").append(publishOpenFlag);
         sb.append(", isSpecialSetting=").append(isSpecialSetting);
         sb.append(", specialNotSend=").append(specialNotSend);
+        sb.append(", addPlayButtonFlag=").append(addPlayButtonFlag);
         sb.append(", isDelete=").append(isDelete);
         sb.append(", createTime=").append(createTime);
         sb.append(", updateTime=").append(updateTime);

+ 60 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/po/longarticle/PlanAccountExample.java

@@ -1916,6 +1916,66 @@ public class PlanAccountExample {
             return (Criteria) this;
         }
 
+        public Criteria andAddPlayButtonFlagIsNull() {
+            addCriterion("add_play_button_flag is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andAddPlayButtonFlagIsNotNull() {
+            addCriterion("add_play_button_flag is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andAddPlayButtonFlagEqualTo(Integer value) {
+            addCriterion("add_play_button_flag =", value, "addPlayButtonFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andAddPlayButtonFlagNotEqualTo(Integer value) {
+            addCriterion("add_play_button_flag <>", value, "addPlayButtonFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andAddPlayButtonFlagGreaterThan(Integer value) {
+            addCriterion("add_play_button_flag >", value, "addPlayButtonFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andAddPlayButtonFlagGreaterThanOrEqualTo(Integer value) {
+            addCriterion("add_play_button_flag >=", value, "addPlayButtonFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andAddPlayButtonFlagLessThan(Integer value) {
+            addCriterion("add_play_button_flag <", value, "addPlayButtonFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andAddPlayButtonFlagLessThanOrEqualTo(Integer value) {
+            addCriterion("add_play_button_flag <=", value, "addPlayButtonFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andAddPlayButtonFlagIn(List<Integer> values) {
+            addCriterion("add_play_button_flag in", values, "addPlayButtonFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andAddPlayButtonFlagNotIn(List<Integer> values) {
+            addCriterion("add_play_button_flag not in", values, "addPlayButtonFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andAddPlayButtonFlagBetween(Integer value1, Integer value2) {
+            addCriterion("add_play_button_flag between", value1, value2, "addPlayButtonFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andAddPlayButtonFlagNotBetween(Integer value1, Integer value2) {
+            addCriterion("add_play_button_flag not between", value1, value2, "addPlayButtonFlag");
+            return (Criteria) this;
+        }
+
         public Criteria andIsDeleteIsNull() {
             addCriterion("is_delete is null");
             return (Criteria) this;

+ 2 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/vo/LongArticleSystemPlan.java

@@ -39,6 +39,8 @@ public class LongArticleSystemPlan {
     private Integer pushType;
     //"小程序插入开关(0-关闭 1-打开)")
     private Integer miniprogramInsertFlag;
+    //"公众号卡片是否添加播放按钮(0-否 1-是)")
+    private Integer addPlayButtonFlag;
     //"小程序插入任务")
     private List<MiniprogramInsertTaskParam> miniprogramInsertTasks;
     //"公众号文章排序任务")

+ 1 - 3
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/CardServiceImpl.java

@@ -42,8 +42,6 @@ public class CardServiceImpl implements CardService {
     @ApolloJsonValue("${updateVideoMap:{}}")
     private Map<String, String> updateVideoMap;
 
-    @ApolloJsonValue("${useShareImgPathList:[]}")
-    private List<String> useShareImgPathList;
     @ApolloJsonValue("${useSmallPlayImgPathList:[]}")
     private List<String> useSmallPlayImgPathList;
     @ApolloJsonValue("${crawlerImgPathList:[]}")
@@ -162,7 +160,7 @@ public class CardServiceImpl implements CardService {
         publishMiniprogram.setSource(videoDetail.getSource());
         publishMiniprogram.setVideoTitle(videoDetail.getKimiTitle());
         if (crawlerImgPathList.contains(planAccount.getPlanId())
-                || useShareImgPathList.contains(planAccount.getAccountName())
+                || planAccount.getAddPlayButtonFlag() == 1
                 || useSmallPlayImgPathList.contains(planAccount.getAccountName())) {
             publishMiniprogram.setVideoCover(videoDetail.getShareImgPath());
             if (useSmallPlayImgPathList.contains(planAccount.getAccountName())) {

+ 1 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/CoreServiceImpl.java

@@ -221,6 +221,7 @@ public class CoreServiceImpl implements CoreService {
                 planAccount.setPublishPushTime(longArticleSystemPlan.getPublishPushTime());
                 planAccount.setPushType(longArticleSystemPlan.getPushType());
                 planAccount.setMiniprogramInsertFlag(longArticleSystemPlan.getMiniprogramInsertFlag());
+                planAccount.setAddPlayButtonFlag(longArticleSystemPlan.getAddPlayButtonFlag());
                 MiniprogramInsertTaskParam miniprogramInsertTaskParam = miniStgMap.get(accountId);
                 if (miniprogramInsertTaskParam != null) {
                     planAccount.setMiniprogramUseType(miniprogramInsertTaskParam.getMiniprogramUseType());

+ 22 - 5
long-article-server/src/main/resources/mapper/longarticle/PlanAccountMapper.xml

@@ -30,6 +30,7 @@
     <result column="publish_open_flag" jdbcType="INTEGER" property="publishOpenFlag" />
     <result column="is_special_setting" jdbcType="INTEGER" property="isSpecialSetting" />
     <result column="special_not_send" jdbcType="INTEGER" property="specialNotSend" />
+    <result column="add_play_button_flag" jdbcType="INTEGER" property="addPlayButtonFlag" />
     <result column="is_delete" jdbcType="INTEGER" property="isDelete" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
     <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
@@ -98,7 +99,7 @@
     publish_pre_min_num, publish_push_time, push_type, miniprogram_insert_flag, mini_strategy, 
     miniprogram_use_type, sort_strategy, exclude_content_index, `status`, match_status, 
     retry_count, send_count, publish_open_flag, is_special_setting, special_not_send, 
-    is_delete, create_time, update_time
+    add_play_button_flag, is_delete, create_time, update_time
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.PlanAccountExample" resultMap="BaseResultMap">
     select
@@ -143,8 +144,9 @@
       mini_strategy, miniprogram_use_type, sort_strategy, 
       exclude_content_index, `status`, match_status, 
       retry_count, send_count, publish_open_flag, 
-      is_special_setting, special_not_send, is_delete, 
-      create_time, update_time)
+      is_special_setting, special_not_send, add_play_button_flag, 
+      is_delete, create_time, update_time
+      )
     values (#{id,jdbcType=BIGINT}, #{planId,jdbcType=VARCHAR}, #{planName,jdbcType=VARCHAR}, 
       #{accountId,jdbcType=VARCHAR}, #{accountName,jdbcType=VARCHAR}, #{ghId,jdbcType=VARCHAR}, 
       #{publishRate,jdbcType=INTEGER}, #{publishDate,jdbcType=VARCHAR}, #{publishWindowStart,jdbcType=VARCHAR}, 
@@ -154,8 +156,9 @@
       #{miniStrategy,jdbcType=VARCHAR}, #{miniprogramUseType,jdbcType=INTEGER}, #{sortStrategy,jdbcType=VARCHAR}, 
       #{excludeContentIndex,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{matchStatus,jdbcType=INTEGER}, 
       #{retryCount,jdbcType=INTEGER}, #{sendCount,jdbcType=INTEGER}, #{publishOpenFlag,jdbcType=INTEGER}, 
-      #{isSpecialSetting,jdbcType=INTEGER}, #{specialNotSend,jdbcType=INTEGER}, #{isDelete,jdbcType=INTEGER}, 
-      #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
+      #{isSpecialSetting,jdbcType=INTEGER}, #{specialNotSend,jdbcType=INTEGER}, #{addPlayButtonFlag,jdbcType=INTEGER}, 
+      #{isDelete,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
+      )
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.PlanAccount">
     insert into long_articles_plan_account
@@ -244,6 +247,9 @@
       <if test="specialNotSend != null">
         special_not_send,
       </if>
+      <if test="addPlayButtonFlag != null">
+        add_play_button_flag,
+      </if>
       <if test="isDelete != null">
         is_delete,
       </if>
@@ -339,6 +345,9 @@
       <if test="specialNotSend != null">
         #{specialNotSend,jdbcType=INTEGER},
       </if>
+      <if test="addPlayButtonFlag != null">
+        #{addPlayButtonFlag,jdbcType=INTEGER},
+      </if>
       <if test="isDelete != null">
         #{isDelete,jdbcType=INTEGER},
       </if>
@@ -443,6 +452,9 @@
       <if test="record.specialNotSend != null">
         special_not_send = #{record.specialNotSend,jdbcType=INTEGER},
       </if>
+      <if test="record.addPlayButtonFlag != null">
+        add_play_button_flag = #{record.addPlayButtonFlag,jdbcType=INTEGER},
+      </if>
       <if test="record.isDelete != null">
         is_delete = #{record.isDelete,jdbcType=INTEGER},
       </if>
@@ -487,6 +499,7 @@
       publish_open_flag = #{record.publishOpenFlag,jdbcType=INTEGER},
       is_special_setting = #{record.isSpecialSetting,jdbcType=INTEGER},
       special_not_send = #{record.specialNotSend,jdbcType=INTEGER},
+      add_play_button_flag = #{record.addPlayButtonFlag,jdbcType=INTEGER},
       is_delete = #{record.isDelete,jdbcType=INTEGER},
       create_time = #{record.createTime,jdbcType=TIMESTAMP},
       update_time = #{record.updateTime,jdbcType=TIMESTAMP}
@@ -578,6 +591,9 @@
       <if test="specialNotSend != null">
         special_not_send = #{specialNotSend,jdbcType=INTEGER},
       </if>
+      <if test="addPlayButtonFlag != null">
+        add_play_button_flag = #{addPlayButtonFlag,jdbcType=INTEGER},
+      </if>
       <if test="isDelete != null">
         is_delete = #{isDelete,jdbcType=INTEGER},
       </if>
@@ -619,6 +635,7 @@
       publish_open_flag = #{publishOpenFlag,jdbcType=INTEGER},
       is_special_setting = #{isSpecialSetting,jdbcType=INTEGER},
       special_not_send = #{specialNotSend,jdbcType=INTEGER},
+      add_play_button_flag = #{addPlayButtonFlag,jdbcType=INTEGER},
       is_delete = #{isDelete,jdbcType=INTEGER},
       create_time = #{createTime,jdbcType=TIMESTAMP},
       update_time = #{updateTime,jdbcType=TIMESTAMP}

+ 6 - 6
long-article-server/src/main/resources/mybatis-generator-config.xml

@@ -27,7 +27,7 @@
         </commentGenerator>
 
         <jdbcConnection driverClass="com.mysql.jdbc.Driver"
-                        connectionURL="jdbc:mysql://rm-bp14529nwwcw75yr1ko.mysql.rds.aliyuncs.com:3306/long_articles?useUnicode=true&amp;characterEncoding=utf-8&amp;zeroDateTimeBehavior=convertToNull&amp;useSSL=false"
+                        connectionURL="jdbc:mysql://rm-bp14529nwwcw75yr1.mysql.rds.aliyuncs.com:3306/long_articles?useUnicode=true&amp;characterEncoding=utf-8&amp;zeroDateTimeBehavior=convertToNull&amp;useSSL=false"
                         userId="changwen_admin" password="changwen@123456">
         </jdbcConnection>
 
@@ -35,18 +35,18 @@
             <property name="forceBigDecimals" value="false"/>
         </javaTypeResolver>
 
-        <javaModelGenerator targetPackage="com.tzld.piaoquan.longarticle.model.po.longarticle" targetProject="/Users/shimeng/Desktop/project/long-article-manage/long-article-server/src/main/java">
+        <javaModelGenerator targetPackage="com.tzld.piaoquan.longarticle.model.po.longarticle" targetProject="long-article-server/src/main/java">
             <property name="constructorBased" value="false"/>
             <property name="enableSubPackages" value="true"/>
             <property name="immutable" value="false"/>
         </javaModelGenerator>
 
-        <sqlMapGenerator targetPackage="mapper/longarticle" targetProject="/Users/shimeng/Desktop/project/long-article-manage/long-article-server/src/main/resources">
+        <sqlMapGenerator targetPackage="mapper/longarticle" targetProject="long-article-server/src/main/resources">
             <property name="enableSubPackages" value="true"/>
         </sqlMapGenerator>
 
         <javaClientGenerator targetPackage="com.tzld.piaoquan.longarticle.dao.mapper.longarticle" type="XMLMAPPER"
-                             targetProject="/Users/shimeng/Desktop/project/long-article-manage/long-article-server/src/main/java">
+                             targetProject="long-article-server/src/main/java">
             <property name="enableSubPackages" value="true"/>
         </javaClientGenerator>
 <!--        <table tableName="video_content_understanding" domainObjectName="VideoContentUnderstanding" alias="" />-->
@@ -63,10 +63,10 @@
 <!--            <columnOverride column="cover_url" javaType="java.lang.String" jdbcType="LONGVARCHAR" />-->
 <!--        </table>-->
 <!--        <table tableName="long_articles_root_source_id" domainObjectName="RootSource" alias=""/>-->
-<!--        <table tableName="long_articles_plan_account" domainObjectName="PlanAccount" alias=""/>-->
+        <table tableName="long_articles_plan_account" domainObjectName="PlanAccount" alias=""/>
         <!--            <table tableName="long_articles_plan" domainObjectName="Plan" alias=""/>-->
 <!--        <table tableName="long_articles_publish_content" domainObjectName="PublishContent" alias=""/>-->
-        <table tableName="long_articles_new_match_videos" domainObjectName="NewMatchVideo" alias=""/>
+<!--        <table tableName="long_articles_new_match_videos" domainObjectName="NewMatchVideo" alias=""/>-->
 
 <!--        <table tableName="video_keywords_map" domainObjectName="VideoKeywordsMap" alias=""/>-->
 

+ 20 - 0
long-article-server/src/test/java/com/tzld/piaoquan/longarticle/PlanAccountJobTest.java

@@ -0,0 +1,20 @@
+package com.tzld.piaoquan.longarticle;
+
+import com.tzld.piaoquan.longarticle.job.PlanAccountJob;
+import lombok.extern.slf4j.Slf4j;
+import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.test.context.SpringBootTest;
+
+@SpringBootTest(classes = LongArticleServerApplication.class)
+@Slf4j
+public class PlanAccountJobTest {
+
+    @Autowired
+    PlanAccountJob planAccountJob;
+
+    @Test
+    public void testInitPlanAccount() {
+        planAccountJob.initPlanAccount(null);
+    }
+}