lijilei 3 роки тому
батько
коміт
16c93a1c88
34 змінених файлів з 1192 додано та 26 видалено
  1. 22 0
      book-dao/src/main/java/com/book/dao/cps/mapper/ManageCoverMapper.java
  2. 21 0
      book-dao/src/main/java/com/book/dao/cps/mapper/ManageTitleMapper.java
  3. 22 0
      book-dao/src/main/java/com/book/dao/cps/mapper/SignRecommandMapper.java
  4. 22 0
      book-dao/src/main/java/com/book/dao/cps/mapper/SignedRecommandMapper.java
  5. 45 0
      book-dao/src/main/java/com/book/dao/cps/pojo/ManageCover.java
  6. 40 0
      book-dao/src/main/java/com/book/dao/cps/pojo/ManageTitle.java
  7. 30 0
      book-dao/src/main/java/com/book/dao/cps/pojo/SignRecommand.java
  8. 48 0
      book-dao/src/main/java/com/book/dao/cps/pojo/SignedRecommand.java
  9. 1 1
      book-dao/src/main/java/com/book/dao/utils/DateUtils.java
  10. 123 0
      book-dao/src/main/resources/mapper/ManageCoverMapper.xml
  11. 102 0
      book-dao/src/main/resources/mapper/ManageTitleMapper.xml
  12. 115 0
      book-dao/src/main/resources/mapper/SignRecommandMapper.xml
  13. 115 0
      book-dao/src/main/resources/mapper/SignedRecommandMapper.xml
  14. 34 0
      book-push/src/main/java/com/book/push/builder/TuWenBuilder.java
  15. 1 14
      book-push/src/main/java/com/book/push/controller/WxEventController.java
  16. 48 5
      book-push/src/main/java/com/book/push/handler/MenuHandler.java
  17. 16 0
      book-push/src/main/java/com/book/push/service/dao/ManageCoverService.java
  18. 14 0
      book-push/src/main/java/com/book/push/service/dao/ManageTitleService.java
  19. 16 0
      book-push/src/main/java/com/book/push/service/dao/SignRecommendService.java
  20. 14 0
      book-push/src/main/java/com/book/push/service/dao/SignedRecommendService.java
  21. 2 0
      book-push/src/main/java/com/book/push/service/dao/UserService.java
  22. 22 0
      book-push/src/main/java/com/book/push/service/dao/impl/ManageCoverServiceImpl.java
  23. 22 0
      book-push/src/main/java/com/book/push/service/dao/impl/ManageTitleServiceImpl.java
  24. 28 0
      book-push/src/main/java/com/book/push/service/dao/impl/SignRecommendServiceImpl.java
  25. 22 0
      book-push/src/main/java/com/book/push/service/dao/impl/SignedRecommendServiceImpl.java
  26. 13 0
      book-push/src/main/java/com/book/push/service/dao/impl/UserServiceImpl.java
  27. 61 0
      book-push/src/main/java/com/book/push/service/push/DelayTask.java
  28. 20 0
      book-push/src/main/java/com/book/push/service/push/PushService.java
  29. 25 0
      book-push/src/main/java/com/book/push/service/push/impl/PushBookTask.java
  30. 96 0
      book-push/src/main/java/com/book/push/service/push/impl/PushServiceImpl.java
  31. 18 0
      book-push/src/main/java/com/book/push/service/push/vo/BookInfo.java
  32. 2 4
      book-push/src/main/java/com/book/push/service/wx/impl/WxThirdPartMessageRouter.java
  33. 11 0
      book-push/src/main/java/com/book/push/vo/PushTask.java
  34. 1 2
      book-server/src/main/java/com/book/server/service/impl/BookServiceImpl.java

+ 22 - 0
book-dao/src/main/java/com/book/dao/cps/mapper/ManageCoverMapper.java

@@ -0,0 +1,22 @@
+package com.book.dao.cps.mapper;
+
+import com.book.dao.cps.pojo.ManageCover;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface ManageCoverMapper {
+    int deleteByPrimaryKey(Integer id);
+
+    int insert(ManageCover record);
+
+    int insertSelective(ManageCover record);
+
+    ManageCover selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(ManageCover record);
+
+    int updateByPrimaryKey(ManageCover record);
+
+    ManageCover selectRandom(@Param("type") String type, @Param("status") String status);
+}

+ 21 - 0
book-dao/src/main/java/com/book/dao/cps/mapper/ManageTitleMapper.java

@@ -0,0 +1,21 @@
+package com.book.dao.cps.mapper;
+
+import com.book.dao.cps.pojo.ManageTitle;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface ManageTitleMapper {
+    int deleteByPrimaryKey(Integer id);
+
+    int insert(ManageTitle record);
+
+    int insertSelective(ManageTitle record);
+
+    ManageTitle selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(ManageTitle record);
+
+    int updateByPrimaryKey(ManageTitle record);
+    ManageTitle selectRandom(@Param("sex") String sex);
+}

+ 22 - 0
book-dao/src/main/java/com/book/dao/cps/mapper/SignRecommandMapper.java

@@ -0,0 +1,22 @@
+package com.book.dao.cps.mapper;
+
+import com.book.dao.cps.pojo.SignRecommand;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface SignRecommandMapper {
+    int deleteByPrimaryKey(Integer id);
+
+    int insert(SignRecommand record);
+
+    int insertSelective(SignRecommand record);
+
+    SignRecommand selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(SignRecommand record);
+
+    int updateByPrimaryKey(SignRecommand record);
+
+    SignRecommand selectRandom(@Param("sex") String sex);
+}

+ 22 - 0
book-dao/src/main/java/com/book/dao/cps/mapper/SignedRecommandMapper.java

@@ -0,0 +1,22 @@
+package com.book.dao.cps.mapper;
+
+import com.book.dao.cps.pojo.SignRecommand;
+import com.book.dao.cps.pojo.SignedRecommand;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+@Repository
+public interface SignedRecommandMapper {
+    int deleteByPrimaryKey(Integer id);
+
+    int insert(SignedRecommand record);
+
+    int insertSelective(SignedRecommand record);
+
+    SignedRecommand selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(SignedRecommand record);
+
+    int updateByPrimaryKey(SignedRecommand record);
+    SignRecommand selectRandom(@Param("sex") String sex);
+}

+ 45 - 0
book-dao/src/main/java/com/book/dao/cps/pojo/ManageCover.java

@@ -0,0 +1,45 @@
+package com.book.dao.cps.pojo;
+
+import java.io.Serializable;
+import lombok.Data;
+
+/**
+ * manage_cover
+ * @author 
+ */
+@Data
+public class ManageCover implements Serializable {
+    private Integer id;
+
+    /**
+     * 图片url
+     */
+    private String image;
+
+    /**
+     * 类型:1=大图,2=小图
+     */
+    private Object type;
+
+    /**
+     * 状态:normal=显示,hidden=隐藏
+     */
+    private Object status;
+
+    /**
+     * 创建时间
+     */
+    private Integer createtime;
+
+    /**
+     * 更新时间
+     */
+    private Integer updatetime;
+
+    /**
+     * 状态值:1=男频,2=女频,3=活动
+     */
+    private Object sex;
+
+    private static final long serialVersionUID = 1L;
+}

+ 40 - 0
book-dao/src/main/java/com/book/dao/cps/pojo/ManageTitle.java

@@ -0,0 +1,40 @@
+package com.book.dao.cps.pojo;
+
+import java.io.Serializable;
+import lombok.Data;
+
+/**
+ * manage_title
+ * @author 
+ */
+@Data
+public class ManageTitle implements Serializable {
+    private Integer id;
+
+    /**
+     * 标题
+     */
+    private String title;
+
+    /**
+     * 状态:normal=显示,hidden=隐藏
+     */
+    private Object status;
+
+    /**
+     * 创建时间
+     */
+    private Integer createtime;
+
+    /**
+     * 更新时间
+     */
+    private Integer updatetime;
+
+    /**
+     * 状态值:1=男频,2=女频,3=活动
+     */
+    private Object sex;
+
+    private static final long serialVersionUID = 1L;
+}

+ 30 - 0
book-dao/src/main/java/com/book/dao/cps/pojo/SignRecommand.java

@@ -0,0 +1,30 @@
+package com.book.dao.cps.pojo;
+
+import java.io.Serializable;
+import lombok.Data;
+
+/**
+ * sign_recommand
+ * @author 
+ */
+@Data
+public class SignRecommand implements Serializable {
+    private Integer id;
+
+    private Long bookId;
+
+    private String bookName;
+
+    /**
+     * 1男频2女频
+     */
+    private Object sex;
+
+    private Object status;
+
+    private Integer createtime;
+
+    private Integer updatetime;
+
+    private static final long serialVersionUID = 1L;
+}

+ 48 - 0
book-dao/src/main/java/com/book/dao/cps/pojo/SignedRecommand.java

@@ -0,0 +1,48 @@
+package com.book.dao.cps.pojo;
+
+import java.io.Serializable;
+import lombok.Data;
+
+/**
+ * signed_recommand
+ * @author 
+ */
+@Data
+public class SignedRecommand implements Serializable {
+    /**
+     * 索引ID
+     */
+    private Integer id;
+
+    /**
+     * 书籍ID
+     */
+    private Long bookId;
+
+    /**
+     * 书籍名称
+     */
+    private String bookName;
+
+    /**
+     * 频道:1=男频,2=女频
+     */
+    private Object sex;
+
+    /**
+     * 状态:normal=正常,hidden=隐藏
+     */
+    private Object status;
+
+    /**
+     * 创建时间
+     */
+    private Integer createtime;
+
+    /**
+     * 更新时间
+     */
+    private Integer updatetime;
+
+    private static final long serialVersionUID = 1L;
+}

+ 1 - 1
book-server/src/main/java/com/book/server/common/util/DateUtils.java → book-dao/src/main/java/com/book/dao/utils/DateUtils.java

@@ -1,4 +1,4 @@
-package com.book.server.common.util;
+package com.book.dao.utils;
 
 import org.springframework.util.Assert;
 

+ 123 - 0
book-dao/src/main/resources/mapper/ManageCoverMapper.xml

@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.book.dao.cps.mapper.ManageCoverMapper">
+    <resultMap id="BaseResultMap" type="com.book.dao.cps.pojo.ManageCover">
+        <id column="id" jdbcType="INTEGER" property="id"/>
+        <result column="image" jdbcType="VARCHAR" property="image"/>
+        <result column="type" jdbcType="OTHER" property="type"/>
+        <result column="status" jdbcType="OTHER" property="status"/>
+        <result column="createtime" jdbcType="INTEGER" property="createtime"/>
+        <result column="updatetime" jdbcType="INTEGER" property="updatetime"/>
+        <result column="sex" jdbcType="OTHER" property="sex"/>
+    </resultMap>
+    <sql id="Base_Column_List">
+        id, image, `type`, `status`, createtime, updatetime, sex
+    </sql>
+    <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+        select
+        <include refid="Base_Column_List"/>
+        from manage_cover
+        where id = #{id,jdbcType=INTEGER}
+    </select>
+    <select id="selectRandom" resultMap="BaseResultMap">
+        select *
+        from manage_cover
+        where `type` = #{type}
+          and `status` = {status}
+            and sex = #{sex}
+        order by rand()
+        limit 1
+
+
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+        delete
+        from manage_cover
+        where id = #{id,jdbcType=INTEGER}
+    </delete>
+    <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.book.dao.cps.pojo.ManageCover"
+            useGeneratedKeys="true">
+        insert into manage_cover (image, `type`, `status`,
+                                  createtime, updatetime, sex)
+        values (#{image,jdbcType=VARCHAR}, #{type,jdbcType=OTHER}, #{status,jdbcType=OTHER},
+                #{createtime,jdbcType=INTEGER}, #{updatetime,jdbcType=INTEGER}, #{sex,jdbcType=OTHER})
+    </insert>
+    <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.book.dao.cps.pojo.ManageCover"
+            useGeneratedKeys="true">
+        insert into manage_cover
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="image != null">
+                image,
+            </if>
+            <if test="type != null">
+                `type`,
+            </if>
+            <if test="status != null">
+                `status`,
+            </if>
+            <if test="createtime != null">
+                createtime,
+            </if>
+            <if test="updatetime != null">
+                updatetime,
+            </if>
+            <if test="sex != null">
+                sex,
+            </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="image != null">
+                #{image,jdbcType=VARCHAR},
+            </if>
+            <if test="type != null">
+                #{type,jdbcType=OTHER},
+            </if>
+            <if test="status != null">
+                #{status,jdbcType=OTHER},
+            </if>
+            <if test="createtime != null">
+                #{createtime,jdbcType=INTEGER},
+            </if>
+            <if test="updatetime != null">
+                #{updatetime,jdbcType=INTEGER},
+            </if>
+            <if test="sex != null">
+                #{sex,jdbcType=OTHER},
+            </if>
+        </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.book.dao.cps.pojo.ManageCover">
+        update manage_cover
+        <set>
+            <if test="image != null">
+                image = #{image,jdbcType=VARCHAR},
+            </if>
+            <if test="type != null">
+                `type` = #{type,jdbcType=OTHER},
+            </if>
+            <if test="status != null">
+                `status` = #{status,jdbcType=OTHER},
+            </if>
+            <if test="createtime != null">
+                createtime = #{createtime,jdbcType=INTEGER},
+            </if>
+            <if test="updatetime != null">
+                updatetime = #{updatetime,jdbcType=INTEGER},
+            </if>
+            <if test="sex != null">
+                sex = #{sex,jdbcType=OTHER},
+            </if>
+        </set>
+        where id = #{id,jdbcType=INTEGER}
+    </update>
+    <update id="updateByPrimaryKey" parameterType="com.book.dao.cps.pojo.ManageCover">
+        update manage_cover
+        set image      = #{image,jdbcType=VARCHAR},
+            `type`     = #{type,jdbcType=OTHER},
+            `status`   = #{status,jdbcType=OTHER},
+            createtime = #{createtime,jdbcType=INTEGER},
+            updatetime = #{updatetime,jdbcType=INTEGER},
+            sex        = #{sex,jdbcType=OTHER}
+        where id = #{id,jdbcType=INTEGER}
+    </update>
+</mapper>

+ 102 - 0
book-dao/src/main/resources/mapper/ManageTitleMapper.xml

@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.book.dao.cps.mapper.ManageTitleMapper">
+  <resultMap id="BaseResultMap" type="com.book.dao.cps.pojo.ManageTitle">
+    <id column="id" jdbcType="INTEGER" property="id" />
+    <result column="title" jdbcType="VARCHAR" property="title" />
+    <result column="status" jdbcType="OTHER" property="status" />
+    <result column="createtime" jdbcType="INTEGER" property="createtime" />
+    <result column="updatetime" jdbcType="INTEGER" property="updatetime" />
+    <result column="sex" jdbcType="OTHER" property="sex" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    id, title, `status`, createtime, updatetime, sex
+  </sql>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from manage_title
+    where id = #{id,jdbcType=INTEGER}
+  </select>
+    <select id="selectRandom" resultType="com.book.dao.cps.pojo.ManageTitle">
+        select  * from      manage_title where sex = #{sex} order by rand() limit 1
+
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+    delete from manage_title
+    where id = #{id,jdbcType=INTEGER}
+  </delete>
+  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.book.dao.cps.pojo.ManageTitle" useGeneratedKeys="true">
+    insert into manage_title (title, `status`, createtime, 
+      updatetime, sex)
+    values (#{title,jdbcType=VARCHAR}, #{status,jdbcType=OTHER}, #{createtime,jdbcType=INTEGER}, 
+      #{updatetime,jdbcType=INTEGER}, #{sex,jdbcType=OTHER})
+  </insert>
+  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.book.dao.cps.pojo.ManageTitle" useGeneratedKeys="true">
+    insert into manage_title
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="title != null">
+        title,
+      </if>
+      <if test="status != null">
+        `status`,
+      </if>
+      <if test="createtime != null">
+        createtime,
+      </if>
+      <if test="updatetime != null">
+        updatetime,
+      </if>
+      <if test="sex != null">
+        sex,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="title != null">
+        #{title,jdbcType=VARCHAR},
+      </if>
+      <if test="status != null">
+        #{status,jdbcType=OTHER},
+      </if>
+      <if test="createtime != null">
+        #{createtime,jdbcType=INTEGER},
+      </if>
+      <if test="updatetime != null">
+        #{updatetime,jdbcType=INTEGER},
+      </if>
+      <if test="sex != null">
+        #{sex,jdbcType=OTHER},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.book.dao.cps.pojo.ManageTitle">
+    update manage_title
+    <set>
+      <if test="title != null">
+        title = #{title,jdbcType=VARCHAR},
+      </if>
+      <if test="status != null">
+        `status` = #{status,jdbcType=OTHER},
+      </if>
+      <if test="createtime != null">
+        createtime = #{createtime,jdbcType=INTEGER},
+      </if>
+      <if test="updatetime != null">
+        updatetime = #{updatetime,jdbcType=INTEGER},
+      </if>
+      <if test="sex != null">
+        sex = #{sex,jdbcType=OTHER},
+      </if>
+    </set>
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.book.dao.cps.pojo.ManageTitle">
+    update manage_title
+    set title = #{title,jdbcType=VARCHAR},
+      `status` = #{status,jdbcType=OTHER},
+      createtime = #{createtime,jdbcType=INTEGER},
+      updatetime = #{updatetime,jdbcType=INTEGER},
+      sex = #{sex,jdbcType=OTHER}
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+</mapper>

+ 115 - 0
book-dao/src/main/resources/mapper/SignRecommandMapper.xml

@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.book.dao.cps.mapper.SignRecommandMapper">
+  <resultMap id="BaseResultMap" type="com.book.dao.cps.pojo.SignRecommand">
+    <id column="id" jdbcType="INTEGER" property="id" />
+    <result column="book_id" jdbcType="BIGINT" property="bookId" />
+    <result column="book_name" jdbcType="VARCHAR" property="bookName" />
+    <result column="sex" jdbcType="OTHER" property="sex" />
+    <result column="status" jdbcType="OTHER" property="status" />
+    <result column="createtime" jdbcType="INTEGER" property="createtime" />
+    <result column="updatetime" jdbcType="INTEGER" property="updatetime" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    id, book_id, book_name, sex, `status`, createtime, updatetime
+  </sql>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from sign_recommand
+    where id = #{id,jdbcType=INTEGER}
+  </select>
+    <select id="selectRandom" resultMap="BaseResultMap">
+        select  * from sign_recommand where  status= 'normal'  and `sex` = #{sex} order by rand() limit 1
+
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+    delete from sign_recommand
+    where id = #{id,jdbcType=INTEGER}
+  </delete>
+  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.book.dao.cps.pojo.SignRecommand" useGeneratedKeys="true">
+    insert into sign_recommand (book_id, book_name, sex, 
+      `status`, createtime, updatetime
+      )
+    values (#{bookId,jdbcType=BIGINT}, #{bookName,jdbcType=VARCHAR}, #{sex,jdbcType=OTHER}, 
+      #{status,jdbcType=OTHER}, #{createtime,jdbcType=INTEGER}, #{updatetime,jdbcType=INTEGER}
+      )
+  </insert>
+  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.book.dao.cps.pojo.SignRecommand" useGeneratedKeys="true">
+    insert into sign_recommand
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="bookId != null">
+        book_id,
+      </if>
+      <if test="bookName != null">
+        book_name,
+      </if>
+      <if test="sex != null">
+        sex,
+      </if>
+      <if test="status != null">
+        `status`,
+      </if>
+      <if test="createtime != null">
+        createtime,
+      </if>
+      <if test="updatetime != null">
+        updatetime,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="bookId != null">
+        #{bookId,jdbcType=BIGINT},
+      </if>
+      <if test="bookName != null">
+        #{bookName,jdbcType=VARCHAR},
+      </if>
+      <if test="sex != null">
+        #{sex,jdbcType=OTHER},
+      </if>
+      <if test="status != null">
+        #{status,jdbcType=OTHER},
+      </if>
+      <if test="createtime != null">
+        #{createtime,jdbcType=INTEGER},
+      </if>
+      <if test="updatetime != null">
+        #{updatetime,jdbcType=INTEGER},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.book.dao.cps.pojo.SignRecommand">
+    update sign_recommand
+    <set>
+      <if test="bookId != null">
+        book_id = #{bookId,jdbcType=BIGINT},
+      </if>
+      <if test="bookName != null">
+        book_name = #{bookName,jdbcType=VARCHAR},
+      </if>
+      <if test="sex != null">
+        sex = #{sex,jdbcType=OTHER},
+      </if>
+      <if test="status != null">
+        `status` = #{status,jdbcType=OTHER},
+      </if>
+      <if test="createtime != null">
+        createtime = #{createtime,jdbcType=INTEGER},
+      </if>
+      <if test="updatetime != null">
+        updatetime = #{updatetime,jdbcType=INTEGER},
+      </if>
+    </set>
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.book.dao.cps.pojo.SignRecommand">
+    update sign_recommand
+    set book_id = #{bookId,jdbcType=BIGINT},
+      book_name = #{bookName,jdbcType=VARCHAR},
+      sex = #{sex,jdbcType=OTHER},
+      `status` = #{status,jdbcType=OTHER},
+      createtime = #{createtime,jdbcType=INTEGER},
+      updatetime = #{updatetime,jdbcType=INTEGER}
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+</mapper>

+ 115 - 0
book-dao/src/main/resources/mapper/SignedRecommandMapper.xml

@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.book.dao.cps.mapper.SignedRecommandMapper">
+  <resultMap id="BaseResultMap" type="com.book.dao.cps.pojo.SignedRecommand">
+    <id column="id" jdbcType="INTEGER" property="id" />
+    <result column="book_id" jdbcType="BIGINT" property="bookId" />
+    <result column="book_name" jdbcType="VARCHAR" property="bookName" />
+    <result column="sex" jdbcType="OTHER" property="sex" />
+    <result column="status" jdbcType="OTHER" property="status" />
+    <result column="createtime" jdbcType="INTEGER" property="createtime" />
+    <result column="updatetime" jdbcType="INTEGER" property="updatetime" />
+  </resultMap>
+  <sql id="Base_Column_List">
+    id, book_id, book_name, sex, `status`, createtime, updatetime
+  </sql>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from signed_recommand
+    where id = #{id,jdbcType=INTEGER}
+  </select>
+    <select id="selectRandom" resultMap="BaseResultMap">
+      select  * from sign_recommand where  status= 'normal'  and `sex` = #{sex} order by rand() limit 1
+
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
+    delete from signed_recommand
+    where id = #{id,jdbcType=INTEGER}
+  </delete>
+  <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.book.dao.cps.pojo.SignedRecommand" useGeneratedKeys="true">
+    insert into signed_recommand (book_id, book_name, sex, 
+      `status`, createtime, updatetime
+      )
+    values (#{bookId,jdbcType=BIGINT}, #{bookName,jdbcType=VARCHAR}, #{sex,jdbcType=OTHER}, 
+      #{status,jdbcType=OTHER}, #{createtime,jdbcType=INTEGER}, #{updatetime,jdbcType=INTEGER}
+      )
+  </insert>
+  <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.book.dao.cps.pojo.SignedRecommand" useGeneratedKeys="true">
+    insert into signed_recommand
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="bookId != null">
+        book_id,
+      </if>
+      <if test="bookName != null">
+        book_name,
+      </if>
+      <if test="sex != null">
+        sex,
+      </if>
+      <if test="status != null">
+        `status`,
+      </if>
+      <if test="createtime != null">
+        createtime,
+      </if>
+      <if test="updatetime != null">
+        updatetime,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="bookId != null">
+        #{bookId,jdbcType=BIGINT},
+      </if>
+      <if test="bookName != null">
+        #{bookName,jdbcType=VARCHAR},
+      </if>
+      <if test="sex != null">
+        #{sex,jdbcType=OTHER},
+      </if>
+      <if test="status != null">
+        #{status,jdbcType=OTHER},
+      </if>
+      <if test="createtime != null">
+        #{createtime,jdbcType=INTEGER},
+      </if>
+      <if test="updatetime != null">
+        #{updatetime,jdbcType=INTEGER},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.book.dao.cps.pojo.SignedRecommand">
+    update signed_recommand
+    <set>
+      <if test="bookId != null">
+        book_id = #{bookId,jdbcType=BIGINT},
+      </if>
+      <if test="bookName != null">
+        book_name = #{bookName,jdbcType=VARCHAR},
+      </if>
+      <if test="sex != null">
+        sex = #{sex,jdbcType=OTHER},
+      </if>
+      <if test="status != null">
+        `status` = #{status,jdbcType=OTHER},
+      </if>
+      <if test="createtime != null">
+        createtime = #{createtime,jdbcType=INTEGER},
+      </if>
+      <if test="updatetime != null">
+        updatetime = #{updatetime,jdbcType=INTEGER},
+      </if>
+    </set>
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.book.dao.cps.pojo.SignedRecommand">
+    update signed_recommand
+    set book_id = #{bookId,jdbcType=BIGINT},
+      book_name = #{bookName,jdbcType=VARCHAR},
+      sex = #{sex,jdbcType=OTHER},
+      `status` = #{status,jdbcType=OTHER},
+      createtime = #{createtime,jdbcType=INTEGER},
+      updatetime = #{updatetime,jdbcType=INTEGER}
+    where id = #{id,jdbcType=INTEGER}
+  </update>
+</mapper>

+ 34 - 0
book-push/src/main/java/com/book/push/builder/TuWenBuilder.java

@@ -0,0 +1,34 @@
+package com.book.push.builder;
+
+import me.chanjar.weixin.mp.api.WxMpService;
+import me.chanjar.weixin.mp.bean.kefu.WxMpKefuMessage;
+import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
+import me.chanjar.weixin.mp.bean.message.WxMpXmlOutImageMessage;
+import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
+
+/**
+ * created in 2021/8/28
+ * Project: book-store
+ *
+ * @author win7
+ */
+
+public class TuWenBuilder extends AbstractBuilder {
+
+
+    @Override
+    public WxMpXmlOutMessage build(String content, WxMpXmlMessage wxMessage, WxMpService service) {
+        WxMpXmlOutImageMessage m = WxMpXmlOutMessage.NEWS().articles().build()
+                .fromUser(wxMessage.getToUser()).toUser(wxMessage.getFromUser())
+                .build();
+
+        return m;
+    }
+    public WxMpXmlOutMessage build(WxMpKefuMessage.WxArticle wxArticle, WxMpXmlMessage wxMessage, WxMpService service) {
+        WxMpXmlOutImageMessage m = WxMpXmlOutMessage.NEWS().articles(Item).build()
+                .fromUser(wxMessage.getToUser()).toUser(wxMessage.getFromUser())
+                .build();
+
+        return m;
+    }
+}

+ 1 - 14
book-push/src/main/java/com/book/push/controller/WxEventController.java

@@ -18,7 +18,7 @@ import org.springframework.web.bind.annotation.*;
 /**
  * created in 2021/8/26
  * Project: book-store
- *  接收微信事件
+ *
  * @author win7
  */
 @RestController
@@ -31,19 +31,6 @@ public class WxEventController {
     @Autowired
     private PlatformService platformService;
 
-
-    /**
-     * 公众号事件接口
-     * @param requestBody
-     * @param appId
-     * @param signature
-     * @param timestamp
-     * @param nonce
-     * @param openid
-     * @param encType
-     * @param msgSignature
-     * @return
-     */
     @RequestMapping("/mpapi/appid/{appId}")
     public Object callback(@RequestBody(required = false) String requestBody,
                            @PathVariable("appId") String appId,

+ 48 - 5
book-push/src/main/java/com/book/push/handler/MenuHandler.java

@@ -1,9 +1,24 @@
 package com.book.push.handler;
 
+import com.book.dao.cps.pojo.AdminConfig;
+import com.book.dao.cps.pojo.SignRecommand;
+import com.book.dao.cps.pojo.User;
+import com.book.push.service.dao.AdminConfigService;
+import com.book.push.service.dao.PlatformService;
+import com.book.push.service.dao.SignRecommendService;
+import com.book.push.service.dao.UserService;
+import com.book.push.service.push.PushService;
+import com.book.push.service.wx.WxThirdPartService;
 import me.chanjar.weixin.common.session.WxSessionManager;
 import me.chanjar.weixin.mp.api.WxMpService;
+import me.chanjar.weixin.mp.bean.kefu.WxMpKefuMessage;
 import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
 import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
+import me.chanjar.weixin.mp.builder.kefu.NewsBuilder;
+import me.chanjar.weixin.open.api.WxOpenMpService;
+import me.chanjar.weixin.open.api.WxOpenService;
+import org.checkerframework.checker.units.qual.A;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import java.util.Map;
@@ -11,25 +26,53 @@ import java.util.Map;
 import static me.chanjar.weixin.common.api.WxConsts.EventType;
 
 /**
- * @author
+ * @author 点击菜单事件
  */
 @Component
 public class MenuHandler extends AbstractHandler {
+    @Autowired
+    private PushService pushService;
+    @Autowired
+    private UserService userService;
+    @Autowired
+    private AdminConfigService adminConfigService;
+    @Autowired
+    private PlatformService platformService;
+    @Autowired
+    private WxThirdPartService wxThirdPartService;
+    @Autowired
+    private SignRecommendService signRecommendService;
 
     @Override
     public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
                                     Map<String, Object> context, WxMpService weixinService,
                                     WxSessionManager sessionManager) {
         String msg = String.format("type:%s, event:%s, key:%s",
-            wxMessage.getMsgType(), wxMessage.getEvent(),
-            wxMessage.getEventKey());
+                wxMessage.getMsgType(), wxMessage.getEvent(),
+                wxMessage.getEventKey());
         if (EventType.VIEW.equals(wxMessage.getEvent())) {
             return null;
         }
 
+        String openid = wxMessage.getFromUser();
+        AdminConfig adminConfig = userService.selectAdminConfigByOpenid(openid);
+        Integer platformId = adminConfig.getPlatformId();
+        WxOpenService wxOpenService = wxThirdPartService.getWxOpenServiceByPlatFormId(platformId);
+        WxOpenMpService wxMpService = wxOpenService.getWxOpenComponentService().getWxMpServiceByAppid(wxMessage.getToUser());
+
+
+
+        SignRecommand signRecommand = signRecommendService.selectRandom();
+        WxMpKefuMessage.WxArticle  wxArticle = new  WxMpKefuMessage.WxArticle();
+        wxArticle.setTitle();
+        new NewsBuilder().toUser(openid).addArticle()
+        wxMpService.getKefuService().sendKefuMessage()
+        pushService.addBookPushTask();
+
+
         return WxMpXmlOutMessage.TEXT().content(msg)
-            .fromUser(wxMessage.getToUser()).toUser(wxMessage.getFromUser())
-            .build();
+                .fromUser(wxMessage.getToUser()).toUser(wxMessage.getFromUser())
+                .build();
     }
 
 }

+ 16 - 0
book-push/src/main/java/com/book/push/service/dao/ManageCoverService.java

@@ -0,0 +1,16 @@
+package com.book.push.service.dao;
+
+import com.book.dao.cps.pojo.ManageCover;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * created in 2021/8/28
+ * Project: book-store
+ *
+ * @author win7
+ */
+
+public interface ManageCoverService {
+
+  ManageCover selectRandom(String type,String status);
+}

+ 14 - 0
book-push/src/main/java/com/book/push/service/dao/ManageTitleService.java

@@ -0,0 +1,14 @@
+package com.book.push.service.dao;
+
+import com.book.dao.cps.pojo.ManageTitle;
+
+/**
+ * created in 2021/8/28
+ * Project: book-store
+ *
+ * @author win7
+ */
+
+public interface ManageTitleService {
+    ManageTitle selectRandom(String sex);
+}

+ 16 - 0
book-push/src/main/java/com/book/push/service/dao/SignRecommendService.java

@@ -0,0 +1,16 @@
+package com.book.push.service.dao;
+
+import com.book.dao.cps.pojo.SignRecommand;
+
+/**
+ * created in 2021/8/28
+ * Project: book-store
+ *
+ * @author win7
+ */
+
+public interface SignRecommendService {
+
+    SignRecommand selectById(Integer id);
+    SignRecommand selectRandom(String sex);
+}

+ 14 - 0
book-push/src/main/java/com/book/push/service/dao/SignedRecommendService.java

@@ -0,0 +1,14 @@
+package com.book.push.service.dao;
+
+import com.book.dao.cps.pojo.SignRecommand;
+
+/**
+ * created in 2021/8/28
+ * Project: book-store
+ *
+ * @author win7
+ */
+
+public interface SignedRecommendService {
+    SignRecommand selectRandom(String sex);
+}

+ 2 - 0
book-push/src/main/java/com/book/push/service/dao/UserService.java

@@ -1,6 +1,7 @@
 package com.book.push.service.dao;
 
 
+import com.book.dao.cps.pojo.AdminConfig;
 import com.book.dao.cps.pojo.User;
 import me.chanjar.weixin.mp.bean.result.WxMpUser;
 
@@ -16,4 +17,5 @@ public interface UserService {
      User selectByOpenId(String openId);
      User selectById(Long id);
      User createUserByWxUser(WxMpUser wxMpUser,int channel_id);
+     AdminConfig selectAdminConfigByOpenid(String openid);
 }

+ 22 - 0
book-push/src/main/java/com/book/push/service/dao/impl/ManageCoverServiceImpl.java

@@ -0,0 +1,22 @@
+package com.book.push.service.dao.impl;
+
+import com.book.dao.cps.mapper.ManageCoverMapper;
+import com.book.dao.cps.pojo.ManageCover;
+import com.book.push.service.dao.ManageCoverService;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * created in 2021/8/28
+ * Project: book-store
+ *
+ * @author win7
+ */
+
+public class ManageCoverServiceImpl implements ManageCoverService {
+    @Autowired
+    private ManageCoverMapper manageCoverMapper;
+    @Override
+    public ManageCover selectRandom(String type,String status) {
+        return manageCoverMapper.selectRandom(type,status);
+    }
+}

+ 22 - 0
book-push/src/main/java/com/book/push/service/dao/impl/ManageTitleServiceImpl.java

@@ -0,0 +1,22 @@
+package com.book.push.service.dao.impl;
+
+import com.book.dao.cps.mapper.ManageTitleMapper;
+import com.book.dao.cps.pojo.ManageTitle;
+import com.book.push.service.dao.ManageTitleService;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * created in 2021/8/28
+ * Project: book-store
+ *
+ * @author win7
+ */
+
+public class ManageTitleServiceImpl implements ManageTitleService {
+    @Autowired
+    private ManageTitleMapper manageTitleMapper;
+    @Override
+    public ManageTitle selectRandom(String sex) {
+        return manageTitleMapper.selectRandom(sex);
+    }
+}

+ 28 - 0
book-push/src/main/java/com/book/push/service/dao/impl/SignRecommendServiceImpl.java

@@ -0,0 +1,28 @@
+package com.book.push.service.dao.impl;
+
+import com.book.dao.cps.mapper.SignRecommandMapper;
+import com.book.dao.cps.pojo.SignRecommand;
+import com.book.push.service.dao.SignRecommendService;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * created in 2021/8/28
+ * Project: book-store
+ *
+ * @author win7
+ */
+
+public class SignRecommendServiceImpl implements SignRecommendService {
+    @Autowired
+    private SignRecommandMapper signRecommandMapper;
+
+    @Override
+    public SignRecommand selectById(Integer id) {
+        return signRecommandMapper.selectByPrimaryKey(id);
+    }
+
+    @Override
+    public SignRecommand selectRandom(String sex) {
+        return signRecommandMapper.selectRandom(sex);
+    }
+}

+ 22 - 0
book-push/src/main/java/com/book/push/service/dao/impl/SignedRecommendServiceImpl.java

@@ -0,0 +1,22 @@
+package com.book.push.service.dao.impl;
+
+import com.book.dao.cps.mapper.SignedRecommandMapper;
+import com.book.dao.cps.pojo.SignRecommand;
+import com.book.push.service.dao.SignedRecommendService;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * created in 2021/8/28
+ * Project: book-store
+ *
+ * @author win7
+ */
+
+public class SignedRecommendServiceImpl implements SignedRecommendService {
+    @Autowired
+    private SignedRecommandMapper signedRecommandMapper;
+    @Override
+    public SignRecommand selectRandom(String sex) {
+        return signedRecommandMapper.selectRandom(sex);
+    }
+}

+ 13 - 0
book-push/src/main/java/com/book/push/service/dao/impl/UserServiceImpl.java

@@ -1,9 +1,12 @@
 package com.book.push.service.dao.impl;
 
 import com.book.dao.cps.mapper.UserMapper;
+import com.book.dao.cps.pojo.AdminConfig;
 import com.book.dao.cps.pojo.User;
+import com.book.push.service.dao.AdminConfigService;
 import com.book.push.service.dao.UserService;
 import me.chanjar.weixin.mp.bean.result.WxMpUser;
+import org.checkerframework.checker.units.qual.A;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -17,6 +20,8 @@ import org.springframework.stereotype.Service;
 public class UserServiceImpl implements UserService {
     @Autowired
     private UserMapper userMapper;
+    @Autowired
+    private AdminConfigService adminConfigService;
 
     @Override
     public User selectUserByUser(User user) {
@@ -56,4 +61,12 @@ public class UserServiceImpl implements UserService {
         userMapper.insert(user);
         return user;
     }
+
+    @Override
+    public AdminConfig selectAdminConfigByOpenid(String openid) {
+        User user = userMapper.selectByOpenId(openid);
+        Integer channelId = user.getChannelId();
+        AdminConfig adminConfig = adminConfigService.selectByAdminId(channelId);
+        return adminConfig;
+    }
 }

+ 61 - 0
book-push/src/main/java/com/book/push/service/push/DelayTask.java

@@ -0,0 +1,61 @@
+package com.book.push.service.push;
+
+import java.util.concurrent.Delayed;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicLong;
+
+/**
+ * Delayed接口的实现类
+ * 内部实现了getDelay()和compareTo()方法,分别用来获取延迟时间和按两个任务的延迟时间进行排序
+ * * * @author lijilei
+ */
+public abstract class DelayTask<T> implements Delayed, Runnable {
+    private static final long NANO_ORIGIN = System.nanoTime();
+
+    final static long now() {
+        return System.nanoTime() - NANO_ORIGIN;
+    }
+
+    private static final AtomicLong sequencer = new AtomicLong(0);
+    private final long sequenceNumber;
+    private final long time;
+    protected final T entity;
+
+    public DelayTask(T entity, long timeout) {
+        this.time = now() + timeout;
+        this.entity = entity;
+        this.sequenceNumber = sequencer.getAndIncrement();
+    }
+
+    public T getEntity() {
+        return this.entity;
+    }
+
+    @Override
+    public long getDelay(TimeUnit unit) {
+        long d = unit.convert(time - now(), TimeUnit.NANOSECONDS);
+        return d;
+    }
+
+    @Override
+    public int compareTo(Delayed other) {
+        if (other == this) {
+            return 0;
+        }
+        if (other instanceof DelayTask) {
+            DelayTask<?> x = (DelayTask<?>) other;
+            long diff = time - x.time;
+            if (diff < 0) return -1;
+            else if (diff > 0) return 1;
+            else if (sequenceNumber < x.sequenceNumber) return -1;
+            else return 1;
+        }
+        long d = (getDelay(TimeUnit.NANOSECONDS) - other.getDelay(TimeUnit.NANOSECONDS));
+        return (d == 0) ? 0 : ((d < 0) ? -1 : 1);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        return super.equals(obj);
+    }
+}

+ 20 - 0
book-push/src/main/java/com/book/push/service/push/PushService.java

@@ -0,0 +1,20 @@
+package com.book.push.service.push;
+
+import com.book.push.service.push.vo.BookInfo;
+
+/**
+ * created in 2021/8/27
+ * Project: book-store
+ *
+ * @author win7
+ */
+
+public interface PushService {
+
+
+    public void addPushTask(DelayTask task);
+
+
+
+    void addBookPushTask(BookInfo bookInfo, long delay);
+}

+ 25 - 0
book-push/src/main/java/com/book/push/service/push/impl/PushBookTask.java

@@ -0,0 +1,25 @@
+package com.book.push.service.push.impl;
+
+import com.book.push.service.push.DelayTask;
+import com.book.push.service.push.vo.BookInfo;
+
+/**
+ * created in 2021/8/28
+ * Project: book-store
+ *
+ * @author win7
+ */
+
+public class PushBookTask extends DelayTask<BookInfo> {
+
+
+
+    public PushBookTask(BookInfo entity, long timeout) {
+        super(entity, timeout);
+    }
+
+    @Override
+    public void run() {
+
+    }
+}

+ 96 - 0
book-push/src/main/java/com/book/push/service/push/impl/PushServiceImpl.java

@@ -0,0 +1,96 @@
+package com.book.push.service.push.impl;
+
+import com.book.push.service.push.DelayTask;
+import com.book.push.service.push.PushService;
+import com.book.push.service.push.vo.BookInfo;
+import org.springframework.stereotype.Service;
+
+import java.util.concurrent.*;
+
+/**
+ * created in 2021/8/27
+ * Project: book-store
+ *
+ * @author win7
+ */
+@Service
+public abstract class PushServiceImpl implements PushService {
+
+    /**
+     * 核心线程数
+     */
+    private final static int CORE_POOL_SIZE = 8;
+    /**
+     * 最大线程数
+     */
+    private final static int MAX_POOL_SIZE = 128;
+    /**
+     * 缓存队列容量
+     */
+    private final static int QueueSize = 128;
+
+    /**
+     * 线程空闲存活时间
+     */
+    private final static int KEEP_ALIVE_TIME = 60;
+    /**
+     * 缓存队列
+     */
+    private final static BlockingQueue<Runnable> teskQueue = new LinkedBlockingQueue<Runnable>(QueueSize);
+    /**
+     * 线程池
+     */
+    private final static ThreadPoolExecutor THREAD_POOL_EXECUTOR;
+
+    static {
+
+        ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(CORE_POOL_SIZE, MAX_POOL_SIZE, KEEP_ALIVE_TIME, TimeUnit.SECONDS, teskQueue);
+        THREAD_POOL_EXECUTOR = threadPoolExecutor;
+
+    }
+    private static final DelayQueue<DelayTask> queue = new DelayQueue<>();
+
+    private final Thread taskThread;
+
+    private PushServiceImpl() {
+
+        taskThread = new Thread(new Runnable() {
+            @Override
+            public void run() {
+                execute();
+            }
+        });
+        taskThread.setName("NotifyService Thread");
+        taskThread.start();
+    }
+
+    private void execute() {
+        for (; ; ) {
+            try {
+                DelayTask delayItem = queue.take();
+                if (delayItem != null) {
+                    THREAD_POOL_EXECUTOR.execute(delayItem);
+                }
+            } catch (InterruptedException e) {
+                e.printStackTrace();
+
+                continue;
+            }
+        }
+    }
+
+    @Override
+    public void addPushTask(DelayTask task) {
+        queue.put(task);
+    }
+
+    @Override
+    public void addBookPushTask(BookInfo bookInfo, long delay) {
+
+
+        queue.put(new PushBookTask(bookInfo,delay));
+
+    }
+
+
+}

+ 18 - 0
book-push/src/main/java/com/book/push/service/push/vo/BookInfo.java

@@ -0,0 +1,18 @@
+package com.book.push.service.push.vo;
+
+import lombok.Data;
+
+/**
+ * created in 2021/8/28
+ * Project: book-store
+ *
+ * @author win7
+ */
+@Data
+public class BookInfo {
+    private String bookId;
+    private String bookName;
+    private String set;
+    private String status;
+    private int pushTime;
+}

+ 2 - 4
book-push/src/main/java/com/book/push/service/wx/impl/WxThirdPartMessageRouter.java

@@ -12,7 +12,6 @@ import java.util.Map;
 /**
  * created in 2021/8/20
  * Project: book-store
- * 消息路由
  *
  * @author win7
  */
@@ -25,12 +24,11 @@ public class WxThirdPartMessageRouter extends WxOpenMessageRouter {
         this.wxThirdPartService = wxThirdPartService;
     }
 
-    public WxMpXmlOutMessage route(WxMpXmlMessage wxMessage, Integer platFormId, Map<String, Object> context, String appId) {
+    public WxMpXmlOutMessage route(WxMpXmlMessage wxMessage, Integer platFormId ,Map<String, Object> context, String appId) {
         return this.route(wxMessage, context, wxThirdPartService.getWxOpenServiceByPlatFormId(platFormId)
                 .getWxOpenComponentService().getWxMpServiceByAppid(appId));
     }
-
-    public WxMpXmlOutMessage route(WxMpXmlMessage wxMessage, Integer platFormId, String appId) {
+    public WxMpXmlOutMessage route(WxMpXmlMessage wxMessage, Integer platFormId , String appId) {
         return this.route(wxMessage, new HashMap<>(10), wxThirdPartService.getWxOpenServiceByPlatFormId(platFormId)
                 .getWxOpenComponentService().getWxMpServiceByAppid(appId));
     }

+ 11 - 0
book-push/src/main/java/com/book/push/vo/PushTask.java

@@ -0,0 +1,11 @@
+package com.book.push.vo;
+
+/**
+ * created in 2021/8/27
+ * Project: book-store
+ *
+ * @author win7
+ */
+
+public class PushTask {
+}

+ 1 - 2
book-server/src/main/java/com/book/server/service/impl/BookServiceImpl.java

@@ -14,10 +14,9 @@ import com.book.dao.cpsshard.mapper.UserRecentlyReadMapper;
 import com.book.dao.cpsshard.pojo.example.ConsumeExample;
 import com.book.dao.cpsshard.pojo.example.RechargeExample;
 import com.book.dao.cpsshard.pojo.example.UserRecentlyReadExample;
-import com.book.server.annotation.CacheFind;
 import com.book.server.common.entity.Result;
 import com.book.server.common.entity.ResultCode;
-import com.book.server.common.util.DateUtils;
+import com.book.dao.utils.DateUtils;
 import com.book.server.common.util.JsonUtils;
 import com.book.dao.cps.pojo.example.*;
 import com.book.dao.VO.*;