Kaynağa Gözat

- 精简字段
- 修改返回字段名称

tianyunperfect 3 yıl önce
ebeveyn
işleme
b8e023cea1

+ 4 - 0
book-dao/pom.xml

@@ -77,5 +77,9 @@
             <artifactId>lombok</artifactId>
             <version>1.18.4</version>
         </dependency>
+        <dependency>
+            <groupId>com.fasterxml.jackson.core</groupId>
+            <artifactId>jackson-annotations</artifactId>
+        </dependency>
     </dependencies>
 </project>

+ 17 - 0
book-dao/src/main/java/com/book/dao/cps/entity/Goods.java

@@ -4,6 +4,9 @@ import java.io.Serializable;
 import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Arrays;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 @Data
@@ -24,6 +27,7 @@ public class Goods implements Serializable {
      *
      * @mbg.generated Mon Aug 30 22:53:41 CST 2021
      */
+    @JsonIgnore
     private String categoryId;
 
     /**
@@ -42,6 +46,7 @@ public class Goods implements Serializable {
      *
      * @mbg.generated Mon Aug 30 22:53:41 CST 2021
      */
+    @JsonIgnore
     private String type;
 
     /**
@@ -51,6 +56,7 @@ public class Goods implements Serializable {
      *
      * @mbg.generated Mon Aug 30 22:53:41 CST 2021
      */
+    @JsonIgnore
     private String businessLine;
 
     /**
@@ -60,6 +66,7 @@ public class Goods implements Serializable {
      *
      * @mbg.generated Mon Aug 30 22:53:41 CST 2021
      */
+    @JsonProperty("coin")
     private Integer kandian;
 
     /**
@@ -69,6 +76,7 @@ public class Goods implements Serializable {
      *
      * @mbg.generated Mon Aug 30 22:53:41 CST 2021
      */
+    @JsonProperty("freeCoin")
     private Integer freeKandian;
 
     /**
@@ -78,6 +86,7 @@ public class Goods implements Serializable {
      *
      * @mbg.generated Mon Aug 30 22:53:41 CST 2021
      */
+    @JsonIgnore
     private Integer day;
 
     /**
@@ -87,6 +96,7 @@ public class Goods implements Serializable {
      *
      * @mbg.generated Mon Aug 30 22:53:41 CST 2021
      */
+    @JsonIgnore
     private Integer freeDay;
 
     /**
@@ -105,6 +115,7 @@ public class Goods implements Serializable {
      *
      * @mbg.generated Mon Aug 30 22:53:41 CST 2021
      */
+    @JsonProperty("head1")
     private String firstDescription;
 
     /**
@@ -114,6 +125,7 @@ public class Goods implements Serializable {
      *
      * @mbg.generated Mon Aug 30 22:53:41 CST 2021
      */
+    @JsonProperty("head2")
     private String secondDescription;
 
     /**
@@ -132,6 +144,7 @@ public class Goods implements Serializable {
      *
      * @mbg.generated Mon Aug 30 22:53:41 CST 2021
      */
+    @JsonIgnore
     private String showType;
 
     /**
@@ -141,6 +154,7 @@ public class Goods implements Serializable {
      *
      * @mbg.generated Mon Aug 30 22:53:41 CST 2021
      */
+    @JsonIgnore
     private Integer weigh;
 
     /**
@@ -150,6 +164,7 @@ public class Goods implements Serializable {
      *
      * @mbg.generated Mon Aug 30 22:53:41 CST 2021
      */
+    @JsonIgnore
     private Integer createtime;
 
     /**
@@ -159,6 +174,7 @@ public class Goods implements Serializable {
      *
      * @mbg.generated Mon Aug 30 22:53:41 CST 2021
      */
+    @JsonIgnore
     private Integer updatetime;
 
     /**
@@ -168,6 +184,7 @@ public class Goods implements Serializable {
      *
      * @mbg.generated Mon Aug 30 22:53:41 CST 2021
      */
+    @JsonProperty("description")
     private String desc;
 
     /**

+ 47 - 0
book-dao/src/main/java/com/book/dao/cps/pojo/Book.java

@@ -3,6 +3,9 @@ package com.book.dao.cps.pojo;
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Arrays;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
 import lombok.Data;
 
 @Data
@@ -23,6 +26,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private Byte isAudio;
 
     /**
@@ -32,6 +36,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private Integer bookCategoryId;
 
     /**
@@ -50,6 +55,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private String realname;
 
     /**
@@ -59,6 +65,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private String title;
 
     /**
@@ -86,6 +93,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private String bigCover;
 
     /**
@@ -95,6 +103,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private String smallCover;
 
     /**
@@ -113,6 +122,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private Integer idx;
 
     /**
@@ -122,6 +132,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private Byte referralNum;
 
     /**
@@ -131,6 +142,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private Integer idxx;
 
     /**
@@ -140,6 +152,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private String state;
 
     /**
@@ -149,6 +162,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private Integer freeStime;
 
     /**
@@ -158,6 +172,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private Integer freeEtime;
 
     /**
@@ -167,6 +182,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private String sex;
 
     /**
@@ -176,6 +192,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private String billingType;
 
     /**
@@ -185,6 +202,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private Integer price;
 
     /**
@@ -194,6 +212,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private Integer appPrice;
 
     /**
@@ -212,6 +231,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private Integer freeChapterNum;
 
     /**
@@ -221,6 +241,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private String wordCount;
 
     /**
@@ -230,6 +251,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private Integer chapterNum;
 
     /**
@@ -239,6 +261,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonProperty("firstContentId")
     private Long firstChapterId;
 
     /**
@@ -248,6 +271,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonProperty("firstContentName")
     private String firstChapterName;
 
     /**
@@ -257,6 +281,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonProperty("endContentId")
     private Long lastChapterId;
 
     /**
@@ -266,6 +291,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonProperty("endContentName")
     private String lastChapterName;
 
     /**
@@ -275,6 +301,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private Integer lastChapterUtime;
 
     /**
@@ -293,6 +320,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private Integer articleChapterOrder;
 
     /**
@@ -302,6 +330,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private Integer attentChapterOrder;
 
     /**
@@ -311,6 +340,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private String cornerMark;
 
     /**
@@ -320,6 +350,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private Long recommandBookId;
 
     /**
@@ -329,6 +360,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private Integer createtime;
 
     /**
@@ -338,6 +370,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private Integer updatetime;
 
     /**
@@ -347,6 +380,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private String keywords;
 
     /**
@@ -356,6 +390,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private String cansee;
 
     /**
@@ -365,6 +400,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private Byte rank;
 
     /**
@@ -374,6 +410,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private Byte checkRank;
 
     /**
@@ -383,6 +420,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private String checkRemark;
 
     /**
@@ -392,6 +430,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private String editorRecommand;
 
     /**
@@ -401,6 +440,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private String bookTags;
 
     /**
@@ -410,6 +450,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private Byte a;
 
     /**
@@ -419,6 +460,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private Integer expireTime;
 
     /**
@@ -428,6 +470,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private Integer cpId;
 
     /**
@@ -437,6 +480,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private String cpName;
 
     /**
@@ -446,6 +490,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private String tags;
 
     /**
@@ -455,6 +500,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private Byte classifyWhiteList;
 
     /**
@@ -464,6 +510,7 @@ public class Book implements Serializable {
      *
      * @mbg.generated Thu Aug 12 00:28:56 CST 2021
      */
+    @JsonIgnore
     private Byte putAdSet;
 
     /**

+ 9 - 0
book-dao/src/main/java/com/book/dao/cps/pojo/ManageBlockResource.java

@@ -3,6 +3,8 @@ package com.book.dao.cps.pojo;
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Arrays;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
 import lombok.Data;
 
 @Data
@@ -23,6 +25,7 @@ public class ManageBlockResource implements Serializable {
      *
      * @mbg.generated Sun Aug 15 14:43:42 CST 2021
      */
+    @JsonIgnore
     private Integer blockId;
 
     /**
@@ -32,6 +35,7 @@ public class ManageBlockResource implements Serializable {
      *
      * @mbg.generated Sun Aug 15 14:43:42 CST 2021
      */
+    @JsonIgnore
     private String type;
 
     /**
@@ -59,6 +63,7 @@ public class ManageBlockResource implements Serializable {
      *
      * @mbg.generated Sun Aug 15 14:43:42 CST 2021
      */
+    @JsonIgnore
     private String url;
 
     /**
@@ -68,6 +73,7 @@ public class ManageBlockResource implements Serializable {
      *
      * @mbg.generated Sun Aug 15 14:43:42 CST 2021
      */
+    @JsonIgnore
     private Integer weigh;
 
     /**
@@ -77,6 +83,7 @@ public class ManageBlockResource implements Serializable {
      *
      * @mbg.generated Sun Aug 15 14:43:42 CST 2021
      */
+    @JsonIgnore
     private Integer createtime;
 
     /**
@@ -86,6 +93,7 @@ public class ManageBlockResource implements Serializable {
      *
      * @mbg.generated Sun Aug 15 14:43:42 CST 2021
      */
+    @JsonIgnore
     private Integer updatetime;
 
     /**
@@ -95,6 +103,7 @@ public class ManageBlockResource implements Serializable {
      *
      * @mbg.generated Sun Aug 15 14:43:42 CST 2021
      */
+    @JsonIgnore
     private Integer specialId;
 
     /**

+ 7 - 0
book-dao/src/main/java/com/book/dao/cps/pojo/SearchKeyword.java

@@ -3,6 +3,8 @@ package com.book.dao.cps.pojo;
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Arrays;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
 import lombok.Data;
 
 @Data
@@ -14,6 +16,7 @@ public class SearchKeyword implements Serializable {
      *
      * @mbg.generated Tue Aug 17 22:58:15 CST 2021
      */
+    @JsonIgnore
     private Integer id;
 
     /**
@@ -41,6 +44,7 @@ public class SearchKeyword implements Serializable {
      *
      * @mbg.generated Tue Aug 17 22:58:15 CST 2021
      */
+    @JsonIgnore
     private String sex;
 
     /**
@@ -50,6 +54,7 @@ public class SearchKeyword implements Serializable {
      *
      * @mbg.generated Tue Aug 17 22:58:15 CST 2021
      */
+    @JsonIgnore
     private Integer weigh;
 
     /**
@@ -59,6 +64,7 @@ public class SearchKeyword implements Serializable {
      *
      * @mbg.generated Tue Aug 17 22:58:15 CST 2021
      */
+    @JsonIgnore
     private Integer createtime;
 
     /**
@@ -68,6 +74,7 @@ public class SearchKeyword implements Serializable {
      *
      * @mbg.generated Tue Aug 17 22:58:15 CST 2021
      */
+    @JsonIgnore
     private Integer updatetime;
 
     /**

+ 169 - 145
book-dao/src/main/java/com/book/dao/cps/pojo/User.java

@@ -1,146 +1,170 @@
-package com.book.dao.cps.pojo;
-
-import lombok.Data;
-
-import java.io.Serializable;
-
-/**
- * user
- * @author 
- */
-@Data
-public class User implements Serializable {
-    private Long id;
-
-    /**
-     * 微信openID
-     */
-    private String openid;
-
-    /**
-     * 微信unionid
-     */
-    private String unionid;
-
-    /**
-     * 访客id
-     */
-    private String visitor;
-
-    /**
-     * 昵称
-     */
-    private String nickname;
-
-    /**
-     * 状态值:0=未知,1=男性,2=女性
-     */
-    private Object sex;
-
-    /**
-     * 手机号
-     */
-    private String mobile;
-
-    /**
-     * 头像
-     */
-    private String avatar;
-
-    /**
-     * 关注公众号状态:1=已关注,0=未关注
-     */
-    private Object isSubscribe;
-
-    /**
-     * 关注引导公众号状态:1=已关注,0=未关注
-     */
-    private Object subscriptionExtend;
-
-    /**
-     * 关注时间
-     */
-    private Integer subscribeTime;
-
-    /**
-     * 喜好书籍分类
-     */
-    private String bookCategoryIds;
-
-    /**
-     * 微信交互时间戳
-     */
-    private Integer operateTime;
-
-    /**
-     * 首充状态:1=已充值,0=未充值
-     */
-    private Object isPay;
-
-    /**
-     * 充值看点数
-     */
-    private Integer kandian;
-
-    /**
-     * 赠送看点数
-     */
-    private Integer freeKandian;
-
-    /**
-     * VIP到期时间
-     */
-    private Integer vipEndtime;
-
-    /**
-     * 注册IP
-     */
-    private String registerIp;
-
-    /**
-     * 国家
-     */
-    private String country;
-
-    /**
-     * 区域
-     */
-    private String area;
-
-    /**
-     * 省份
-     */
-    private String province;
-
-    /**
-     * 城市
-     */
-    private String city;
-
-    /**
-     * isp服务商
-     */
-    private String isp;
-
-    /**
-     * 关联渠道商ID
-     */
-    private Integer channelId;
-
-    /**
-     * 状态值:0=禁用,1=正常
-     */
-    private Object state;
-
-    /**
-     * 创建时间
-     */
-    private Integer createtime;
-
-    /**
-     * 更新时间
-     */
-    private Integer updatetime;
-
-    private static final long serialVersionUID = 1L;
+package com.book.dao.cps.pojo;
+
+import com.fasterxml.jackson.annotation.JsonAlias;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * user
+ * @author 
+ */
+@Data
+public class User implements Serializable {
+    private Long id;
+
+    /**
+     * 微信openID
+     */
+    private String openid;
+
+    /**
+     * 微信unionid
+     */
+    @JsonIgnore
+    private String unionid;
+
+    /**
+     * 访客id
+     */
+    @JsonIgnore
+    private String visitor;
+
+    /**
+     * 昵称
+     */
+    private String nickname;
+
+    /**
+     * 状态值:0=未知,1=男性,2=女性
+     */
+    private Object sex;
+
+    /**
+     * 手机号
+     */
+    @JsonProperty("phone")
+    private String mobile;
+
+    /**
+     * 头像
+     */
+    private String avatar;
+
+    /**
+     * 关注公众号状态:1=已关注,0=未关注
+     */
+    @JsonIgnore
+    private Object isSubscribe;
+
+    /**
+     * 关注引导公众号状态:1=已关注,0=未关注
+     */
+    @JsonIgnore
+    private Object subscriptionExtend;
+
+    /**
+     * 关注时间
+     */
+    @JsonIgnore
+    private Integer subscribeTime;
+
+    /**
+     * 喜好书籍分类
+     */
+    @JsonIgnore
+    private String bookCategoryIds;
+
+    /**
+     * 微信交互时间戳
+     */
+    @JsonIgnore
+    private Integer operateTime;
+
+    /**
+     * 首充状态:1=已充值,0=未充值
+     */
+    @JsonIgnore
+    private Object isPay;
+
+    /**
+     * 充值看点数
+     */
+    @JsonProperty("coin")
+    private Integer kandian;
+
+    /**
+     * 赠送看点数
+     */
+    @JsonProperty("freeCoin")
+    private Integer freeKandian;
+
+    /**
+     * VIP到期时间
+     */
+    @JsonIgnore
+    private Integer vipEndtime;
+
+    /**
+     * 注册IP
+     */
+    @JsonIgnore
+    private String registerIp;
+
+    /**
+     * 国家
+     */
+    @JsonIgnore
+    private String country;
+
+    /**
+     * 区域
+     */
+    @JsonIgnore
+    private String area;
+
+    /**
+     * 省份
+     */
+    @JsonIgnore
+    private String province;
+
+    /**
+     * 城市
+     */
+    @JsonIgnore
+    private String city;
+
+    /**
+     * isp服务商
+     */
+    @JsonIgnore
+    private String isp;
+
+    /**
+     * 关联渠道商ID
+     */
+    @JsonIgnore
+    private Integer channelId;
+
+    /**
+     * 状态值:0=禁用,1=正常
+     */
+    private Object state;
+
+    /**
+     * 创建时间
+     */
+    @JsonIgnore
+    private Integer createtime;
+
+    /**
+     * 更新时间
+     */
+    @JsonIgnore
+    private Integer updatetime;
+
+    private static final long serialVersionUID = 1L;
 }

+ 8 - 0
book-dao/src/main/java/com/book/dao/cpsshard/entity/UserRecentlyRead.java

@@ -3,6 +3,8 @@ package com.book.dao.cpsshard.entity;
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Arrays;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
 import lombok.Data;
 
 @Data
@@ -14,6 +16,7 @@ public class UserRecentlyRead implements Serializable {
      *
      * @mbg.generated Sun Aug 22 13:51:10 CST 2021
      */
+    @JsonIgnore
     private Integer id;
 
     /**
@@ -59,6 +62,7 @@ public class UserRecentlyRead implements Serializable {
      *
      * @mbg.generated Sun Aug 22 13:51:10 CST 2021
      */
+    @JsonIgnore
     private Byte flag;
 
     /**
@@ -68,6 +72,7 @@ public class UserRecentlyRead implements Serializable {
      *
      * @mbg.generated Sun Aug 22 13:51:10 CST 2021
      */
+    @JsonIgnore
     private Integer createtime;
 
     /**
@@ -77,6 +82,7 @@ public class UserRecentlyRead implements Serializable {
      *
      * @mbg.generated Sun Aug 22 13:51:10 CST 2021
      */
+    @JsonIgnore
     private Integer updatetime;
 
     /**
@@ -86,6 +92,7 @@ public class UserRecentlyRead implements Serializable {
      *
      * @mbg.generated Sun Aug 22 13:51:10 CST 2021
      */
+    @JsonIgnore
     private Byte bookShelfAdd;
 
     /**
@@ -95,6 +102,7 @@ public class UserRecentlyRead implements Serializable {
      *
      * @mbg.generated Sun Aug 22 13:51:10 CST 2021
      */
+    @JsonIgnore
     private Byte bookShelfFlag;
 
     /**

+ 160 - 162
book-push/src/main/java/com/book/push/handler/SubscribeHandler.java

@@ -1,162 +1,160 @@
-package com.book.push.handler;
-
-import com.book.dao.cps.pojo.AdminConfig;
-import com.book.dao.cps.pojo.User;
-import com.book.dao.cps.pojo.WechatSubscribeConfig;
-import com.book.dao.cps.pojo.WechatSubscribeSwitch;
-import com.book.push.builder.TextBuilder;
-import com.book.push.builder.TuWenBuilder;
-import com.book.push.cons.UrlCons;
-import com.book.push.service.dao.*;
-import com.book.push.utils.JsonUtils;
-import com.book.push.vo.NewsMsgContent;
-import com.book.push.vo.TextMsgContent;
-import com.sun.xml.internal.fastinfoset.tools.FI_DOM_Or_XML_DOM_SAX_SAXEvent;
-import me.chanjar.weixin.common.error.WxErrorException;
-import me.chanjar.weixin.common.session.WxSessionManager;
-import me.chanjar.weixin.mp.api.WxMpService;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
-import me.chanjar.weixin.mp.bean.message.WxMpXmlOutNewsMessage;
-import me.chanjar.weixin.mp.bean.result.WxMpUser;
-import org.apache.commons.lang3.StringUtils;
-import org.checkerframework.checker.units.qual.A;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author
- */
-@Component
-public class SubscribeHandler extends AbstractHandler {
-    @Autowired
-    private UserService userService;
-    @Autowired
-    private AdminConfigService adminConfigService;
-    @Autowired
-    private WechatSubscribeSwitchService wechatSubscribeSwitchService;
-    @Autowired
-    private WechatSubscribeConfigService wechatSubscribeConfigService;
-    @Autowired
-    private OpHostService opHostService;
-    @Override
-    public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
-                                    Map<String, Object> context, WxMpService weixinService,
-                                    WxSessionManager sessionManager) throws WxErrorException {
-
-        this.logger.info("新关注用户 OPENID: " + wxMessage.getFromUser());
-
-        // 获取微信用户基本信息
-        WxMpUser userWxInfo ;
-        String openId = StringUtils.isEmpty(wxMessage.getOpenId())?wxMessage.getOpenId():wxMessage.getFromUser();
-        String appid = StringUtils.isEmpty(wxMessage.getAuthorizeAppId())?wxMessage.getToUser():wxMessage.getAuthorizeAppId();
-        AdminConfig adminConfig = adminConfigService.selectByAppid(appid);
-        User user = userService.selectByOpenId(openId);
-        try {
-             userWxInfo = weixinService.getUserService()
-                    .userInfo(wxMessage.getFromUser(), null);
-            if (userWxInfo != null) {
-                // TODO 可以添加关注用户到本地数据库
-
-
-
-                if (user==null){
-
-                  user =   userService.createUserByWxUser(userWxInfo,adminConfig.getAdminId());
-
-                }
-
-            }
-        } catch (WxErrorException e) {
-            if (e.getError().getErrorCode() == 48001) {
-                this.logger.info("该公众号没有获取用户信息权限!");
-            }
-        }
-
-
-        WxMpXmlOutMessage responseResult = null;
-        try {
-            responseResult = this.handleSpecial(wxMessage);
-        } catch (Exception e) {
-            this.logger.error(e.getMessage(), e);
-        }
-
-        if (responseResult != null) {
-            return responseResult;
-        }
-
-
-
-
-
-        try {
-            WechatSubscribeSwitch wechatSubscribeSwitch = wechatSubscribeSwitchService.selectByAdminId(adminConfig.getAdminId());
-            Byte status = wechatSubscribeSwitch.getStatus();
-            if (status.intValue() == 0){
-
-                return new TextBuilder().build(String.format("@%s,感谢关注啦",user.getNickname()), wxMessage, weixinService);
-            }
-            if (wechatSubscribeSwitch.getType()==1){
-                return new TextBuilder().build(String.format("@%s,感谢关注啦",user.getNickname()), wxMessage, weixinService);
-            }
-            WechatSubscribeConfig wechatSubscribeConfig = wechatSubscribeConfigService.selectByAdminId(adminConfig.getAdminId());
-            if (wechatSubscribeConfig!=null){
-                String host = opHostService.selectById(adminConfig.getOphostId()).getHost();
-                String type = wechatSubscribeConfig.getType().toString();
-                if ("text".equals(type)){
-                    String textContent = wechatSubscribeConfig.getTextContent();
-                    List<TextMsgContent> textMsgContents = JsonUtils.getList(textContent, TextMsgContent.class);
-                    StringBuilder sb = new StringBuilder();
-                    for (TextMsgContent textMsgContent : textMsgContents) {
-                        sb.append(String.format("<a href='%s'>%s</a>\n", textMsgContent.getUrl().replace("{$ophost}", host), textMsgContent.getTitle()));
-                    }
-                    String nickname = user.getNickname();
-                    String json = adminConfig.getJson().toString();
-                    AdminConfig.Info info = JsonUtils.getObject(json, AdminConfig.Info.class);
-                    String nick_name = info.getAuthorizer_info().getNick_name();
-                    String msg = "@%s,欢迎关注 [%s],点击下方继续阅读 %s\n";
-                    msg = String.format(msg, nickname, nick_name, sb.toString());
-                    return new TextBuilder().build(msg, wxMessage, weixinService);
-                }else if ("news".equals(type)){
-                    List<NewsMsgContent> newsMsgContents = JsonUtils.getList(wechatSubscribeConfig.getNewsContent(), NewsMsgContent.class);
-                    List<WxMpXmlOutNewsMessage.Item> items = new ArrayList<>();
-                    for (NewsMsgContent newsMsgContent : newsMsgContents) {
-                        WxMpXmlOutNewsMessage.Item item = new WxMpXmlOutNewsMessage.Item();
-                        item.setTitle(newsMsgContent.getTitle());
-                        item.setPicUrl(newsMsgContent.getImage());
-                        item.setDescription(newsMsgContent.getDescription());
-                        String url = newsMsgContent.getUrl().replace("{$ophost}", host);
-                        if (!StringUtils.isEmpty(newsMsgContent.getBook_id())) {
-                            url = String.format(UrlCons.FRONT_URL, adminConfig.getAppid(), host, UrlCons.MODEL_BOOK, adminConfig.getAdminId(), user.getId() + "")
-                                    .concat("&bookId=").concat(newsMsgContent.getBook_id()).concat("&").concat(newsMsgContent.getChapter_id());
-                        }
-                        item.setUrl(url);
-                    }
-
-                 return    new TuWenBuilder().build(items, wxMessage, weixinService);
-
-                }
-            }
-
-
-        } catch (Exception e) {
-            this.logger.error(e.getMessage(), e);
-        }
-
-           return new TextBuilder().build(String.format("@%s,感谢关注啦",user.getNickname()), wxMessage, weixinService);
-    }
-
-    /**
-     * 处理特殊请求,比如如果是扫码进来的,可以做相应处理
-     */
-    private WxMpXmlOutMessage handleSpecial(WxMpXmlMessage wxMessage)
-            throws Exception {
-        //TODO
-        return null;
-    }
-
-}
+package com.book.push.handler;
+
+import com.book.dao.cps.pojo.AdminConfig;
+import com.book.dao.cps.pojo.User;
+import com.book.dao.cps.pojo.WechatSubscribeConfig;
+import com.book.dao.cps.pojo.WechatSubscribeSwitch;
+import com.book.push.builder.TextBuilder;
+import com.book.push.builder.TuWenBuilder;
+import com.book.push.cons.UrlCons;
+import com.book.push.service.dao.*;
+import com.book.push.utils.JsonUtils;
+import com.book.push.vo.NewsMsgContent;
+import com.book.push.vo.TextMsgContent;
+import me.chanjar.weixin.common.error.WxErrorException;
+import me.chanjar.weixin.common.session.WxSessionManager;
+import me.chanjar.weixin.mp.api.WxMpService;
+import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage;
+import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage;
+import me.chanjar.weixin.mp.bean.message.WxMpXmlOutNewsMessage;
+import me.chanjar.weixin.mp.bean.result.WxMpUser;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author
+ */
+@Component
+public class SubscribeHandler extends AbstractHandler {
+    @Autowired
+    private UserService userService;
+    @Autowired
+    private AdminConfigService adminConfigService;
+    @Autowired
+    private WechatSubscribeSwitchService wechatSubscribeSwitchService;
+    @Autowired
+    private WechatSubscribeConfigService wechatSubscribeConfigService;
+    @Autowired
+    private OpHostService opHostService;
+    @Override
+    public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage,
+                                    Map<String, Object> context, WxMpService weixinService,
+                                    WxSessionManager sessionManager) throws WxErrorException {
+
+        this.logger.info("新关注用户 OPENID: " + wxMessage.getFromUser());
+
+        // 获取微信用户基本信息
+        WxMpUser userWxInfo ;
+        String openId = StringUtils.isEmpty(wxMessage.getOpenId())?wxMessage.getOpenId():wxMessage.getFromUser();
+        String appid = StringUtils.isEmpty(wxMessage.getAuthorizeAppId())?wxMessage.getToUser():wxMessage.getAuthorizeAppId();
+        AdminConfig adminConfig = adminConfigService.selectByAppid(appid);
+        User user = userService.selectByOpenId(openId);
+        try {
+             userWxInfo = weixinService.getUserService()
+                    .userInfo(wxMessage.getFromUser(), null);
+            if (userWxInfo != null) {
+                // TODO 可以添加关注用户到本地数据库
+
+
+
+                if (user==null){
+
+                  user =   userService.createUserByWxUser(userWxInfo,adminConfig.getAdminId());
+
+                }
+
+            }
+        } catch (WxErrorException e) {
+            if (e.getError().getErrorCode() == 48001) {
+                this.logger.info("该公众号没有获取用户信息权限!");
+            }
+        }
+
+
+        WxMpXmlOutMessage responseResult = null;
+        try {
+            responseResult = this.handleSpecial(wxMessage);
+        } catch (Exception e) {
+            this.logger.error(e.getMessage(), e);
+        }
+
+        if (responseResult != null) {
+            return responseResult;
+        }
+
+
+
+
+
+        try {
+            WechatSubscribeSwitch wechatSubscribeSwitch = wechatSubscribeSwitchService.selectByAdminId(adminConfig.getAdminId());
+            Byte status = wechatSubscribeSwitch.getStatus();
+            if (status.intValue() == 0){
+
+                return new TextBuilder().build(String.format("@%s,感谢关注啦",user.getNickname()), wxMessage, weixinService);
+            }
+            if (wechatSubscribeSwitch.getType()==1){
+                return new TextBuilder().build(String.format("@%s,感谢关注啦",user.getNickname()), wxMessage, weixinService);
+            }
+            WechatSubscribeConfig wechatSubscribeConfig = wechatSubscribeConfigService.selectByAdminId(adminConfig.getAdminId());
+            if (wechatSubscribeConfig!=null){
+                String host = opHostService.selectById(adminConfig.getOphostId()).getHost();
+                String type = wechatSubscribeConfig.getType().toString();
+                if ("text".equals(type)){
+                    String textContent = wechatSubscribeConfig.getTextContent();
+                    List<TextMsgContent> textMsgContents = JsonUtils.getList(textContent, TextMsgContent.class);
+                    StringBuilder sb = new StringBuilder();
+                    for (TextMsgContent textMsgContent : textMsgContents) {
+                        sb.append(String.format("<a href='%s'>%s</a>\n", textMsgContent.getUrl().replace("{$ophost}", host), textMsgContent.getTitle()));
+                    }
+                    String nickname = user.getNickname();
+                    String json = adminConfig.getJson().toString();
+                    AdminConfig.Info info = JsonUtils.getObject(json, AdminConfig.Info.class);
+                    String nick_name = info.getAuthorizer_info().getNick_name();
+                    String msg = "@%s,欢迎关注 [%s],点击下方继续阅读 %s\n";
+                    msg = String.format(msg, nickname, nick_name, sb.toString());
+                    return new TextBuilder().build(msg, wxMessage, weixinService);
+                }else if ("news".equals(type)){
+                    List<NewsMsgContent> newsMsgContents = JsonUtils.getList(wechatSubscribeConfig.getNewsContent(), NewsMsgContent.class);
+                    List<WxMpXmlOutNewsMessage.Item> items = new ArrayList<>();
+                    for (NewsMsgContent newsMsgContent : newsMsgContents) {
+                        WxMpXmlOutNewsMessage.Item item = new WxMpXmlOutNewsMessage.Item();
+                        item.setTitle(newsMsgContent.getTitle());
+                        item.setPicUrl(newsMsgContent.getImage());
+                        item.setDescription(newsMsgContent.getDescription());
+                        String url = newsMsgContent.getUrl().replace("{$ophost}", host);
+                        if (!StringUtils.isEmpty(newsMsgContent.getBook_id())) {
+                            url = String.format(UrlCons.FRONT_URL, adminConfig.getAppid(), host, UrlCons.MODEL_BOOK, adminConfig.getAdminId(), user.getId() + "")
+                                    .concat("&bookId=").concat(newsMsgContent.getBook_id()).concat("&").concat(newsMsgContent.getChapter_id());
+                        }
+                        item.setUrl(url);
+                    }
+
+                 return    new TuWenBuilder().build(items, wxMessage, weixinService);
+
+                }
+            }
+
+
+        } catch (Exception e) {
+            this.logger.error(e.getMessage(), e);
+        }
+
+           return new TextBuilder().build(String.format("@%s,感谢关注啦",user.getNickname()), wxMessage, weixinService);
+    }
+
+    /**
+     * 处理特殊请求,比如如果是扫码进来的,可以做相应处理
+     */
+    private WxMpXmlOutMessage handleSpecial(WxMpXmlMessage wxMessage)
+            throws Exception {
+        //TODO
+        return null;
+    }
+
+}

+ 6 - 0
book-server/src/main/java/com/book/server/controller/UserController.java

@@ -31,6 +31,12 @@ public class UserController extends BaseController {
         User user = userService.getUserByOpenId(openId);
         return Result.byObject(user);
     }
+
+    /**
+     * 根据 id 获取用户
+     * @param userId
+     * @return
+     */
     @GetMapping("/getUserByUserId")
     public Result<User> getUserByUserId(Long userId) {
         User user = userService.getUserByUserId(userId);

+ 2 - 0
book-server/src/main/java/com/book/server/service/impl/GoodServiceImpl.java

@@ -3,6 +3,7 @@ package com.book.server.service.impl;
 import com.book.dao.cps.entity.Goods;
 import com.book.dao.cps.mapper.GoodsMapper;
 import com.book.dao.cps.pojo.example.GoodsExample;
+import com.book.server.annotation.CacheFind;
 import com.book.server.service.GoodsService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -15,6 +16,7 @@ public class GoodServiceImpl implements GoodsService {
     private GoodsMapper goodsMapper;
 
     @Override
+    @CacheFind(key = "unPayedGoods")
     public List<Goods> getUnPayedGoods() {
         GoodsExample example = GoodsExample.newAndCreateCriteria()
                 .andShowTypeEqualTo("2")