xueyiming 8 mesi fa
parent
commit
ba0923f1b0

+ 3 - 0
we-com-server/src/main/java/com/tzld/piaoquan/wecom/common/constant/RedisConstant.java

@@ -9,4 +9,7 @@ public interface RedisConstant {
 
     //小程序保底视频key
     String GUARANTEED_MINI_PROGRAM_KEY = "guaranteed_mini_program_%s";
+
+    //小程序保底视频列表key
+    String GUARANTEED_MINI_PROGRAM_SET_KEY = "guaranteed_mini_program_set_%s";
 }

+ 11 - 11
we-com-server/src/main/java/com/tzld/piaoquan/wecom/model/po/HistoryMessage.java

@@ -15,14 +15,14 @@ public class HistoryMessage {
 
     private Integer attachmentIdx;
 
-    private Long messageId;
-
     private Integer status;
 
     private Date sendTime;
 
     private Integer isDelete;
 
+    private String source;
+
     private Date createTime;
 
     public Long getId() {
@@ -73,14 +73,6 @@ public class HistoryMessage {
         this.attachmentIdx = attachmentIdx;
     }
 
-    public Long getMessageId() {
-        return messageId;
-    }
-
-    public void setMessageId(Long messageId) {
-        this.messageId = messageId;
-    }
-
     public Integer getStatus() {
         return status;
     }
@@ -105,6 +97,14 @@ public class HistoryMessage {
         this.isDelete = isDelete;
     }
 
+    public String getSource() {
+        return source;
+    }
+
+    public void setSource(String source) {
+        this.source = source;
+    }
+
     public Date getCreateTime() {
         return createTime;
     }
@@ -125,10 +125,10 @@ public class HistoryMessage {
         sb.append(", staffId=").append(staffId);
         sb.append(", videoId=").append(videoId);
         sb.append(", attachmentIdx=").append(attachmentIdx);
-        sb.append(", messageId=").append(messageId);
         sb.append(", status=").append(status);
         sb.append(", sendTime=").append(sendTime);
         sb.append(", isDelete=").append(isDelete);
+        sb.append(", source=").append(source);
         sb.append(", createTime=").append(createTime);
         sb.append("]");
         return sb.toString();

+ 70 - 60
we-com-server/src/main/java/com/tzld/piaoquan/wecom/model/po/HistoryMessageExample.java

@@ -476,66 +476,6 @@ public class HistoryMessageExample {
             return (Criteria) this;
         }
 
-        public Criteria andMessageIdIsNull() {
-            addCriterion("message_id is null");
-            return (Criteria) this;
-        }
-
-        public Criteria andMessageIdIsNotNull() {
-            addCriterion("message_id is not null");
-            return (Criteria) this;
-        }
-
-        public Criteria andMessageIdEqualTo(Long value) {
-            addCriterion("message_id =", value, "messageId");
-            return (Criteria) this;
-        }
-
-        public Criteria andMessageIdNotEqualTo(Long value) {
-            addCriterion("message_id <>", value, "messageId");
-            return (Criteria) this;
-        }
-
-        public Criteria andMessageIdGreaterThan(Long value) {
-            addCriterion("message_id >", value, "messageId");
-            return (Criteria) this;
-        }
-
-        public Criteria andMessageIdGreaterThanOrEqualTo(Long value) {
-            addCriterion("message_id >=", value, "messageId");
-            return (Criteria) this;
-        }
-
-        public Criteria andMessageIdLessThan(Long value) {
-            addCriterion("message_id <", value, "messageId");
-            return (Criteria) this;
-        }
-
-        public Criteria andMessageIdLessThanOrEqualTo(Long value) {
-            addCriterion("message_id <=", value, "messageId");
-            return (Criteria) this;
-        }
-
-        public Criteria andMessageIdIn(List<Long> values) {
-            addCriterion("message_id in", values, "messageId");
-            return (Criteria) this;
-        }
-
-        public Criteria andMessageIdNotIn(List<Long> values) {
-            addCriterion("message_id not in", values, "messageId");
-            return (Criteria) this;
-        }
-
-        public Criteria andMessageIdBetween(Long value1, Long value2) {
-            addCriterion("message_id between", value1, value2, "messageId");
-            return (Criteria) this;
-        }
-
-        public Criteria andMessageIdNotBetween(Long value1, Long value2) {
-            addCriterion("message_id not between", value1, value2, "messageId");
-            return (Criteria) this;
-        }
-
         public Criteria andStatusIsNull() {
             addCriterion("`status` is null");
             return (Criteria) this;
@@ -716,6 +656,76 @@ public class HistoryMessageExample {
             return (Criteria) this;
         }
 
+        public Criteria andSourceIsNull() {
+            addCriterion("`source` is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceIsNotNull() {
+            addCriterion("`source` is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceEqualTo(String value) {
+            addCriterion("`source` =", value, "source");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceNotEqualTo(String value) {
+            addCriterion("`source` <>", value, "source");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceGreaterThan(String value) {
+            addCriterion("`source` >", value, "source");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceGreaterThanOrEqualTo(String value) {
+            addCriterion("`source` >=", value, "source");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceLessThan(String value) {
+            addCriterion("`source` <", value, "source");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceLessThanOrEqualTo(String value) {
+            addCriterion("`source` <=", value, "source");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceLike(String value) {
+            addCriterion("`source` like", value, "source");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceNotLike(String value) {
+            addCriterion("`source` not like", value, "source");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceIn(List<String> values) {
+            addCriterion("`source` in", values, "source");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceNotIn(List<String> values) {
+            addCriterion("`source` not in", values, "source");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceBetween(String value1, String value2) {
+            addCriterion("`source` between", value1, value2, "source");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceNotBetween(String value1, String value2) {
+            addCriterion("`source` not between", value1, value2, "source");
+            return (Criteria) this;
+        }
+
         public Criteria andCreateTimeIsNull() {
             addCriterion("create_time is null");
             return (Criteria) this;

+ 50 - 21
we-com-server/src/main/resources/mapper/HistoryMessageMapper.xml

@@ -8,10 +8,10 @@
     <result column="staff_id" jdbcType="BIGINT" property="staffId" />
     <result column="video_id" jdbcType="BIGINT" property="videoId" />
     <result column="attachment_idx" jdbcType="INTEGER" property="attachmentIdx" />
-    <result column="message_id" jdbcType="BIGINT" property="messageId" />
     <result column="status" jdbcType="INTEGER" property="status" />
     <result column="send_time" jdbcType="TIMESTAMP" property="sendTime" />
     <result column="is_delete" jdbcType="INTEGER" property="isDelete" />
+    <result column="source" jdbcType="VARCHAR" property="source" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
   </resultMap>
   <sql id="Example_Where_Clause">
@@ -73,8 +73,8 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, corp_id, user_id, staff_id, video_id, attachment_idx, message_id, `status`, send_time, 
-    is_delete, create_time
+    id, corp_id, user_id, staff_id, video_id, attachment_idx, `status`, send_time, is_delete, 
+    `source`, create_time
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.wecom.model.po.HistoryMessageExample" resultMap="BaseResultMap">
     select
@@ -112,12 +112,12 @@
   <insert id="insert" parameterType="com.tzld.piaoquan.wecom.model.po.HistoryMessage">
     insert into we_com_history_message (id, corp_id, user_id, 
       staff_id, video_id, attachment_idx, 
-      message_id, `status`, send_time, 
-      is_delete, create_time)
+      `status`, send_time,
+      `source`, create_time)
     values (#{id,jdbcType=BIGINT}, #{corpId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, 
       #{staffId,jdbcType=BIGINT}, #{videoId,jdbcType=BIGINT}, #{attachmentIdx,jdbcType=INTEGER}, 
-      #{messageId,jdbcType=BIGINT}, #{status,jdbcType=INTEGER}, #{sendTime,jdbcType=TIMESTAMP}, 
-      #{isDelete,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP})
+      #{status,jdbcType=INTEGER}, #{sendTime,jdbcType=TIMESTAMP},
+      #{source,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP})
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.wecom.model.po.HistoryMessage">
     insert into we_com_history_message
@@ -140,9 +140,6 @@
       <if test="attachmentIdx != null">
         attachment_idx,
       </if>
-      <if test="messageId != null">
-        message_id,
-      </if>
       <if test="status != null">
         `status`,
       </if>
@@ -152,6 +149,9 @@
       <if test="isDelete != null">
         is_delete,
       </if>
+      <if test="source != null">
+        `source`,
+      </if>
       <if test="createTime != null">
         create_time,
       </if>
@@ -175,9 +175,6 @@
       <if test="attachmentIdx != null">
         #{attachmentIdx,jdbcType=INTEGER},
       </if>
-      <if test="messageId != null">
-        #{messageId,jdbcType=BIGINT},
-      </if>
       <if test="status != null">
         #{status,jdbcType=INTEGER},
       </if>
@@ -187,6 +184,9 @@
       <if test="isDelete != null">
         #{isDelete,jdbcType=INTEGER},
       </if>
+      <if test="source != null">
+        #{source,jdbcType=VARCHAR},
+      </if>
       <if test="createTime != null">
         #{createTime,jdbcType=TIMESTAMP},
       </if>
@@ -219,9 +219,6 @@
       <if test="record.attachmentIdx != null">
         attachment_idx = #{record.attachmentIdx,jdbcType=INTEGER},
       </if>
-      <if test="record.messageId != null">
-        message_id = #{record.messageId,jdbcType=BIGINT},
-      </if>
       <if test="record.status != null">
         `status` = #{record.status,jdbcType=INTEGER},
       </if>
@@ -231,6 +228,9 @@
       <if test="record.isDelete != null">
         is_delete = #{record.isDelete,jdbcType=INTEGER},
       </if>
+      <if test="record.source != null">
+        `source` = #{record.source,jdbcType=VARCHAR},
+      </if>
       <if test="record.createTime != null">
         create_time = #{record.createTime,jdbcType=TIMESTAMP},
       </if>
@@ -247,10 +247,10 @@
       staff_id = #{record.staffId,jdbcType=BIGINT},
       video_id = #{record.videoId,jdbcType=BIGINT},
       attachment_idx = #{record.attachmentIdx,jdbcType=INTEGER},
-      message_id = #{record.messageId,jdbcType=BIGINT},
       `status` = #{record.status,jdbcType=INTEGER},
       send_time = #{record.sendTime,jdbcType=TIMESTAMP},
       is_delete = #{record.isDelete,jdbcType=INTEGER},
+      `source` = #{record.source,jdbcType=VARCHAR},
       create_time = #{record.createTime,jdbcType=TIMESTAMP}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -274,9 +274,6 @@
       <if test="attachmentIdx != null">
         attachment_idx = #{attachmentIdx,jdbcType=INTEGER},
       </if>
-      <if test="messageId != null">
-        message_id = #{messageId,jdbcType=BIGINT},
-      </if>
       <if test="status != null">
         `status` = #{status,jdbcType=INTEGER},
       </if>
@@ -286,6 +283,9 @@
       <if test="isDelete != null">
         is_delete = #{isDelete,jdbcType=INTEGER},
       </if>
+      <if test="source != null">
+        `source` = #{source,jdbcType=VARCHAR},
+      </if>
       <if test="createTime != null">
         create_time = #{createTime,jdbcType=TIMESTAMP},
       </if>
@@ -299,11 +299,40 @@
       staff_id = #{staffId,jdbcType=BIGINT},
       video_id = #{videoId,jdbcType=BIGINT},
       attachment_idx = #{attachmentIdx,jdbcType=INTEGER},
-      message_id = #{messageId,jdbcType=BIGINT},
       `status` = #{status,jdbcType=INTEGER},
       send_time = #{sendTime,jdbcType=TIMESTAMP},
       is_delete = #{isDelete,jdbcType=INTEGER},
+      `source` = #{source,jdbcType=VARCHAR},
       create_time = #{createTime,jdbcType=TIMESTAMP}
     where id = #{id,jdbcType=BIGINT}
   </update>
+
+  <insert id="insertList" parameterType="java.util.List">
+    insert into we_com_history_message
+    (
+    corp_id,
+    user_id,
+    staff_id,
+    video_id,
+    attachment_idx,
+    `status`,
+    send_time,
+    `source`,
+    create_time
+    )
+    values
+    <foreach collection="list" item="item" separator=",">
+      (
+      #{item.corpId,jdbcType=BIGINT},
+      #{item.userId,jdbcType=BIGINT},
+      #{item.staffId,jdbcType=BIGINT},
+      #{item.videoId,jdbcType=BIGINT},
+      #{item.attachmentIdx,jdbcType=INTEGER},
+      #{item.status,jdbcType=INTEGER},
+      #{item.sendTime,jdbcType=TIMESTAMP},
+      #{item.source,jdbcType=VARCHAR},
+      #{item.createTime,jdbcType=TIMESTAMP}
+      )
+    </foreach>
+  </insert>
 </mapper>

+ 5 - 5
we-com-server/src/main/resources/mybatis-generator-config.xml

@@ -27,7 +27,7 @@
         </commentGenerator>
 
         <jdbcConnection driverClass="com.mysql.jdbc.Driver"
-                        connectionURL="jdbc:mysql://rm-bp1159bu17li9hi94.mysql.rds.aliyuncs.com:3306/piaoquan-crawler?useUnicode=true&amp;characterEncoding=utf-8&amp;zeroDateTimeBehavior=convertToNull&amp;useSSL=false"
+                        connectionURL="jdbc:mysql://rm-bp1k5853td1r25g3n690.mysql.rds.aliyuncs.com:3306/piaoquan-crawler?useUnicode=true&amp;characterEncoding=utf-8&amp;zeroDateTimeBehavior=convertToNull&amp;useSSL=false"
                         userId="crawler" password="crawler123456@">
         </jdbcConnection>
 
@@ -53,11 +53,11 @@
 <!--        <table tableName="we_com_alert_message" domainObjectName="AlertMessage" alias=""/>-->
         <table tableName="we_com_history_message" domainObjectName="HistoryMessage" alias=""/>
 <!--        <table tableName="we_com_message_attachment" domainObjectName="MessageAttachment" alias=""/>-->
-        <table tableName="we_com_staff" domainObjectName="Staff" alias=""/>
+<!--        <table tableName="we_com_staff" domainObjectName="Staff" alias=""/>-->
 <!--        <table tableName="we_com_staff_with_user" domainObjectName="StaffWithUser" alias=""/>-->
-        <table tableName="we_com_send_message" domainObjectName="SendMessage" alias=""/>
-        <table tableName="we_com_user" domainObjectName="User" alias=""/>
-        <table tableName="we_com_corp" domainObjectName="Corp" alias=""/>
+<!--        <table tableName="we_com_send_message" domainObjectName="SendMessage" alias=""/>-->
+<!--        <table tableName="we_com_user" domainObjectName="User" alias=""/>-->
+<!--        <table tableName="we_com_corp" domainObjectName="Corp" alias=""/>-->
 
     </context>