Quellcode durchsuchen

用户模块 用户注销逻辑,退回redisson版本为3.11.3;注销后的账户再次注册不再送券

songfuqiang vor 1 Jahr
Ursprung
Commit
ece5373e74

+ 1 - 1
backend-common/pom.xml

@@ -45,7 +45,7 @@
         <dependency>
             <groupId>org.redisson</groupId>
             <artifactId>redisson</artifactId>
-            <version>3.17.6</version>
+            <version>3.11.3</version>
         </dependency>
 
         <dependency>

+ 24 - 0
backend-core/src/main/java/cn/kdan/pdf/backend/core/constant/ProviderConstant.java

@@ -0,0 +1,24 @@
+package cn.kdan.pdf.backend.core.constant;
+
+/**
+ * @author tangxiangan
+ */
+public interface ProviderConstant {
+    /**
+     * 手机号
+     */
+    public static final String PHONE = "phone";
+    /**
+     * 邮箱
+     */
+    public static final String EMAIL = "email";
+    /**
+     * QQ
+     */
+    public static final String TENCENT = "tencent";
+    /**
+     * 微信
+     */
+    public static final String WECHAT = "wechat";
+
+}

+ 11 - 1
backend-core/src/main/java/cn/kdan/pdf/backend/core/controller/AdvertisementController.java

@@ -1,12 +1,12 @@
 package cn.kdan.pdf.backend.core.controller;
 
+import cn.kdan.pdf.backend.core.params.AddAdvertisementParam;
 import cn.kdan.pdf.backend.core.params.QueryAdvertisementParam;
 import cn.kdan.pdf.backend.core.pojo.app.AdvertisementVo;
 import cn.kdan.pdf.backend.core.service.AdvertisementService;
 import constant.CommonConstant;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
-import pojo.AppRequestParam;
 import pojo.AppResultMap;
 
 import java.util.List;
@@ -33,4 +33,14 @@ public class AdvertisementController {
         return new AppResultMap<>(CommonConstant.SUCCESS,CommonConstant.CODE_SUCCESS,advertisementService.list(param));
     }
 
+    /**
+     * 增加广告/活动
+     * @param param 参数
+     * @return 成功与否
+     */
+    @PostMapping("/add")
+    public AppResultMap<String> add(@RequestBody AddAdvertisementParam param){
+        return new AppResultMap<>();
+    }
+
 }

+ 55 - 37
backend-core/src/main/java/cn/kdan/pdf/backend/core/model/CancelMember.java

@@ -6,13 +6,15 @@ import java.util.Date;
 public class CancelMember implements Serializable {
     private String id;
 
-    private String memberAccount;
+    private String phone;
 
-    private String thirdAccount;
+    private String email;
 
-    private String cancelReason;
+    private String tencent;
+
+    private String wechat;
 
-    private Integer count;
+    private String cancelReason;
 
     private Date createdAt;
 
@@ -33,56 +35,69 @@ public class CancelMember implements Serializable {
         this.id = id;
     }
 
-    public String getMemberAccount() {
-        return memberAccount;
+    public String getPhone() {
+        return phone;
     }
 
-    public CancelMember withMemberAccount(String memberAccount) {
-        this.setMemberAccount(memberAccount);
+    public CancelMember withPhone(String phone) {
+        this.setPhone(phone);
         return this;
     }
 
-    public void setMemberAccount(String memberAccount) {
-        this.memberAccount = memberAccount;
+    public void setPhone(String phone) {
+        this.phone = phone;
     }
 
-    public String getThirdAccount() {
-        return thirdAccount;
+    public String getEmail() {
+        return email;
     }
 
-    public CancelMember withThirdAccount(String thirdAccount) {
-        this.setThirdAccount(thirdAccount);
+    public CancelMember withEmail(String email) {
+        this.setEmail(email);
         return this;
     }
 
-    public void setThirdAccount(String thirdAccount) {
-        this.thirdAccount = thirdAccount;
+    public void setEmail(String email) {
+        this.email = email;
     }
 
-    public String getCancelReason() {
-        return cancelReason;
+    public String getTencent() {
+        return tencent;
     }
 
-    public CancelMember withCancelReason(String cancelReason) {
-        this.setCancelReason(cancelReason);
+    public CancelMember withTencent(String tencent) {
+        this.setTencent(tencent);
         return this;
     }
 
-    public void setCancelReason(String cancelReason) {
-        this.cancelReason = cancelReason;
+    public void setTencent(String tencent) {
+        this.tencent = tencent;
+    }
+
+    public String getWechat() {
+        return wechat;
     }
 
-    public Integer getCount() {
-        return count;
+    public CancelMember withWechat(String wechat) {
+        this.setWechat(wechat);
+        return this;
+    }
+
+    public void setWechat(String wechat) {
+        this.wechat = wechat;
     }
 
-    public CancelMember withCount(Integer count) {
-        this.setCount(count);
+    public String getCancelReason() {
+        return cancelReason;
+    }
+
+    public CancelMember withCancelReason(String cancelReason) {
+        this.setCancelReason(cancelReason);
         return this;
     }
 
-    public void setCount(Integer count) {
-        this.count = count;
+    public void setCancelReason(String cancelReason) {
+        this.cancelReason = cancelReason;
     }
 
     public Date getCreatedAt() {
@@ -124,10 +139,11 @@ public class CancelMember implements Serializable {
         }
         CancelMember other = (CancelMember) that;
         return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
-            && (this.getMemberAccount() == null ? other.getMemberAccount() == null : this.getMemberAccount().equals(other.getMemberAccount()))
-            && (this.getThirdAccount() == null ? other.getThirdAccount() == null : this.getThirdAccount().equals(other.getThirdAccount()))
+            && (this.getPhone() == null ? other.getPhone() == null : this.getPhone().equals(other.getPhone()))
+            && (this.getEmail() == null ? other.getEmail() == null : this.getEmail().equals(other.getEmail()))
+            && (this.getTencent() == null ? other.getTencent() == null : this.getTencent().equals(other.getTencent()))
+            && (this.getWechat() == null ? other.getWechat() == null : this.getWechat().equals(other.getWechat()))
             && (this.getCancelReason() == null ? other.getCancelReason() == null : this.getCancelReason().equals(other.getCancelReason()))
-            && (this.getCount() == null ? other.getCount() == null : this.getCount().equals(other.getCount()))
             && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()))
             && (this.getUpdatedAt() == null ? other.getUpdatedAt() == null : this.getUpdatedAt().equals(other.getUpdatedAt()));
     }
@@ -137,10 +153,11 @@ public class CancelMember implements Serializable {
         final int prime = 31;
         int result = 1;
         result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
-        result = prime * result + ((getMemberAccount() == null) ? 0 : getMemberAccount().hashCode());
-        result = prime * result + ((getThirdAccount() == null) ? 0 : getThirdAccount().hashCode());
+        result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode());
+        result = prime * result + ((getEmail() == null) ? 0 : getEmail().hashCode());
+        result = prime * result + ((getTencent() == null) ? 0 : getTencent().hashCode());
+        result = prime * result + ((getWechat() == null) ? 0 : getWechat().hashCode());
         result = prime * result + ((getCancelReason() == null) ? 0 : getCancelReason().hashCode());
-        result = prime * result + ((getCount() == null) ? 0 : getCount().hashCode());
         result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
         result = prime * result + ((getUpdatedAt() == null) ? 0 : getUpdatedAt().hashCode());
         return result;
@@ -153,10 +170,11 @@ public class CancelMember implements Serializable {
         sb.append(" [");
         sb.append("Hash = ").append(hashCode());
         sb.append(", id=").append(id);
-        sb.append(", memberAccount=").append(memberAccount);
-        sb.append(", thirdAccount=").append(thirdAccount);
+        sb.append(", phone=").append(phone);
+        sb.append(", email=").append(email);
+        sb.append(", tencent=").append(tencent);
+        sb.append(", wechat=").append(wechat);
         sb.append(", cancelReason=").append(cancelReason);
-        sb.append(", count=").append(count);
         sb.append(", createdAt=").append(createdAt);
         sb.append(", updatedAt=").append(updatedAt);
         sb.append(", serialVersionUID=").append(serialVersionUID);

+ 202 - 112
backend-core/src/main/java/cn/kdan/pdf/backend/core/model/CancelMemberExample.java

@@ -175,273 +175,353 @@ public class CancelMemberExample {
             return (Criteria) this;
         }
 
-        public Criteria andMemberAccountIsNull() {
-            addCriterion("member_account is null");
+        public Criteria andPhoneIsNull() {
+            addCriterion("phone is null");
             return (Criteria) this;
         }
 
-        public Criteria andMemberAccountIsNotNull() {
-            addCriterion("member_account is not null");
+        public Criteria andPhoneIsNotNull() {
+            addCriterion("phone is not null");
             return (Criteria) this;
         }
 
-        public Criteria andMemberAccountEqualTo(String value) {
-            addCriterion("member_account =", value, "memberAccount");
+        public Criteria andPhoneEqualTo(String value) {
+            addCriterion("phone =", value, "phone");
             return (Criteria) this;
         }
 
-        public Criteria andMemberAccountNotEqualTo(String value) {
-            addCriterion("member_account <>", value, "memberAccount");
+        public Criteria andPhoneNotEqualTo(String value) {
+            addCriterion("phone <>", value, "phone");
             return (Criteria) this;
         }
 
-        public Criteria andMemberAccountGreaterThan(String value) {
-            addCriterion("member_account >", value, "memberAccount");
+        public Criteria andPhoneGreaterThan(String value) {
+            addCriterion("phone >", value, "phone");
             return (Criteria) this;
         }
 
-        public Criteria andMemberAccountGreaterThanOrEqualTo(String value) {
-            addCriterion("member_account >=", value, "memberAccount");
+        public Criteria andPhoneGreaterThanOrEqualTo(String value) {
+            addCriterion("phone >=", value, "phone");
             return (Criteria) this;
         }
 
-        public Criteria andMemberAccountLessThan(String value) {
-            addCriterion("member_account <", value, "memberAccount");
+        public Criteria andPhoneLessThan(String value) {
+            addCriterion("phone <", value, "phone");
             return (Criteria) this;
         }
 
-        public Criteria andMemberAccountLessThanOrEqualTo(String value) {
-            addCriterion("member_account <=", value, "memberAccount");
+        public Criteria andPhoneLessThanOrEqualTo(String value) {
+            addCriterion("phone <=", value, "phone");
             return (Criteria) this;
         }
 
-        public Criteria andMemberAccountLike(String value) {
-            addCriterion("member_account like", value, "memberAccount");
+        public Criteria andPhoneLike(String value) {
+            addCriterion("phone like", value, "phone");
             return (Criteria) this;
         }
 
-        public Criteria andMemberAccountNotLike(String value) {
-            addCriterion("member_account not like", value, "memberAccount");
+        public Criteria andPhoneNotLike(String value) {
+            addCriterion("phone not like", value, "phone");
             return (Criteria) this;
         }
 
-        public Criteria andMemberAccountIn(List<String> values) {
-            addCriterion("member_account in", values, "memberAccount");
+        public Criteria andPhoneIn(List<String> values) {
+            addCriterion("phone in", values, "phone");
             return (Criteria) this;
         }
 
-        public Criteria andMemberAccountNotIn(List<String> values) {
-            addCriterion("member_account not in", values, "memberAccount");
+        public Criteria andPhoneNotIn(List<String> values) {
+            addCriterion("phone not in", values, "phone");
             return (Criteria) this;
         }
 
-        public Criteria andMemberAccountBetween(String value1, String value2) {
-            addCriterion("member_account between", value1, value2, "memberAccount");
+        public Criteria andPhoneBetween(String value1, String value2) {
+            addCriterion("phone between", value1, value2, "phone");
             return (Criteria) this;
         }
 
-        public Criteria andMemberAccountNotBetween(String value1, String value2) {
-            addCriterion("member_account not between", value1, value2, "memberAccount");
+        public Criteria andPhoneNotBetween(String value1, String value2) {
+            addCriterion("phone not between", value1, value2, "phone");
             return (Criteria) this;
         }
 
-        public Criteria andThirdAccountIsNull() {
-            addCriterion("third_account is null");
+        public Criteria andEmailIsNull() {
+            addCriterion("email is null");
             return (Criteria) this;
         }
 
-        public Criteria andThirdAccountIsNotNull() {
-            addCriterion("third_account is not null");
+        public Criteria andEmailIsNotNull() {
+            addCriterion("email is not null");
             return (Criteria) this;
         }
 
-        public Criteria andThirdAccountEqualTo(String value) {
-            addCriterion("third_account =", value, "thirdAccount");
+        public Criteria andEmailEqualTo(String value) {
+            addCriterion("email =", value, "email");
             return (Criteria) this;
         }
 
-        public Criteria andThirdAccountNotEqualTo(String value) {
-            addCriterion("third_account <>", value, "thirdAccount");
+        public Criteria andEmailNotEqualTo(String value) {
+            addCriterion("email <>", value, "email");
             return (Criteria) this;
         }
 
-        public Criteria andThirdAccountGreaterThan(String value) {
-            addCriterion("third_account >", value, "thirdAccount");
+        public Criteria andEmailGreaterThan(String value) {
+            addCriterion("email >", value, "email");
             return (Criteria) this;
         }
 
-        public Criteria andThirdAccountGreaterThanOrEqualTo(String value) {
-            addCriterion("third_account >=", value, "thirdAccount");
+        public Criteria andEmailGreaterThanOrEqualTo(String value) {
+            addCriterion("email >=", value, "email");
             return (Criteria) this;
         }
 
-        public Criteria andThirdAccountLessThan(String value) {
-            addCriterion("third_account <", value, "thirdAccount");
+        public Criteria andEmailLessThan(String value) {
+            addCriterion("email <", value, "email");
             return (Criteria) this;
         }
 
-        public Criteria andThirdAccountLessThanOrEqualTo(String value) {
-            addCriterion("third_account <=", value, "thirdAccount");
+        public Criteria andEmailLessThanOrEqualTo(String value) {
+            addCriterion("email <=", value, "email");
             return (Criteria) this;
         }
 
-        public Criteria andThirdAccountLike(String value) {
-            addCriterion("third_account like", value, "thirdAccount");
+        public Criteria andEmailLike(String value) {
+            addCriterion("email like", value, "email");
             return (Criteria) this;
         }
 
-        public Criteria andThirdAccountNotLike(String value) {
-            addCriterion("third_account not like", value, "thirdAccount");
+        public Criteria andEmailNotLike(String value) {
+            addCriterion("email not like", value, "email");
             return (Criteria) this;
         }
 
-        public Criteria andThirdAccountIn(List<String> values) {
-            addCriterion("third_account in", values, "thirdAccount");
+        public Criteria andEmailIn(List<String> values) {
+            addCriterion("email in", values, "email");
             return (Criteria) this;
         }
 
-        public Criteria andThirdAccountNotIn(List<String> values) {
-            addCriterion("third_account not in", values, "thirdAccount");
+        public Criteria andEmailNotIn(List<String> values) {
+            addCriterion("email not in", values, "email");
             return (Criteria) this;
         }
 
-        public Criteria andThirdAccountBetween(String value1, String value2) {
-            addCriterion("third_account between", value1, value2, "thirdAccount");
+        public Criteria andEmailBetween(String value1, String value2) {
+            addCriterion("email between", value1, value2, "email");
             return (Criteria) this;
         }
 
-        public Criteria andThirdAccountNotBetween(String value1, String value2) {
-            addCriterion("third_account not between", value1, value2, "thirdAccount");
+        public Criteria andEmailNotBetween(String value1, String value2) {
+            addCriterion("email not between", value1, value2, "email");
             return (Criteria) this;
         }
 
-        public Criteria andCancelReasonIsNull() {
-            addCriterion("cancel_reason is null");
+        public Criteria andTencentIsNull() {
+            addCriterion("tencent is null");
             return (Criteria) this;
         }
 
-        public Criteria andCancelReasonIsNotNull() {
-            addCriterion("cancel_reason is not null");
+        public Criteria andTencentIsNotNull() {
+            addCriterion("tencent is not null");
             return (Criteria) this;
         }
 
-        public Criteria andCancelReasonEqualTo(String value) {
-            addCriterion("cancel_reason =", value, "cancelReason");
+        public Criteria andTencentEqualTo(String value) {
+            addCriterion("tencent =", value, "tencent");
             return (Criteria) this;
         }
 
-        public Criteria andCancelReasonNotEqualTo(String value) {
-            addCriterion("cancel_reason <>", value, "cancelReason");
+        public Criteria andTencentNotEqualTo(String value) {
+            addCriterion("tencent <>", value, "tencent");
             return (Criteria) this;
         }
 
-        public Criteria andCancelReasonGreaterThan(String value) {
-            addCriterion("cancel_reason >", value, "cancelReason");
+        public Criteria andTencentGreaterThan(String value) {
+            addCriterion("tencent >", value, "tencent");
             return (Criteria) this;
         }
 
-        public Criteria andCancelReasonGreaterThanOrEqualTo(String value) {
-            addCriterion("cancel_reason >=", value, "cancelReason");
+        public Criteria andTencentGreaterThanOrEqualTo(String value) {
+            addCriterion("tencent >=", value, "tencent");
             return (Criteria) this;
         }
 
-        public Criteria andCancelReasonLessThan(String value) {
-            addCriterion("cancel_reason <", value, "cancelReason");
+        public Criteria andTencentLessThan(String value) {
+            addCriterion("tencent <", value, "tencent");
             return (Criteria) this;
         }
 
-        public Criteria andCancelReasonLessThanOrEqualTo(String value) {
-            addCriterion("cancel_reason <=", value, "cancelReason");
+        public Criteria andTencentLessThanOrEqualTo(String value) {
+            addCriterion("tencent <=", value, "tencent");
             return (Criteria) this;
         }
 
-        public Criteria andCancelReasonLike(String value) {
-            addCriterion("cancel_reason like", value, "cancelReason");
+        public Criteria andTencentLike(String value) {
+            addCriterion("tencent like", value, "tencent");
             return (Criteria) this;
         }
 
-        public Criteria andCancelReasonNotLike(String value) {
-            addCriterion("cancel_reason not like", value, "cancelReason");
+        public Criteria andTencentNotLike(String value) {
+            addCriterion("tencent not like", value, "tencent");
             return (Criteria) this;
         }
 
-        public Criteria andCancelReasonIn(List<String> values) {
-            addCriterion("cancel_reason in", values, "cancelReason");
+        public Criteria andTencentIn(List<String> values) {
+            addCriterion("tencent in", values, "tencent");
             return (Criteria) this;
         }
 
-        public Criteria andCancelReasonNotIn(List<String> values) {
-            addCriterion("cancel_reason not in", values, "cancelReason");
+        public Criteria andTencentNotIn(List<String> values) {
+            addCriterion("tencent not in", values, "tencent");
             return (Criteria) this;
         }
 
-        public Criteria andCancelReasonBetween(String value1, String value2) {
-            addCriterion("cancel_reason between", value1, value2, "cancelReason");
+        public Criteria andTencentBetween(String value1, String value2) {
+            addCriterion("tencent between", value1, value2, "tencent");
             return (Criteria) this;
         }
 
-        public Criteria andCancelReasonNotBetween(String value1, String value2) {
-            addCriterion("cancel_reason not between", value1, value2, "cancelReason");
+        public Criteria andTencentNotBetween(String value1, String value2) {
+            addCriterion("tencent not between", value1, value2, "tencent");
+            return (Criteria) this;
+        }
+
+        public Criteria andWechatIsNull() {
+            addCriterion("wechat is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andWechatIsNotNull() {
+            addCriterion("wechat is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andWechatEqualTo(String value) {
+            addCriterion("wechat =", value, "wechat");
+            return (Criteria) this;
+        }
+
+        public Criteria andWechatNotEqualTo(String value) {
+            addCriterion("wechat <>", value, "wechat");
+            return (Criteria) this;
+        }
+
+        public Criteria andWechatGreaterThan(String value) {
+            addCriterion("wechat >", value, "wechat");
+            return (Criteria) this;
+        }
+
+        public Criteria andWechatGreaterThanOrEqualTo(String value) {
+            addCriterion("wechat >=", value, "wechat");
+            return (Criteria) this;
+        }
+
+        public Criteria andWechatLessThan(String value) {
+            addCriterion("wechat <", value, "wechat");
+            return (Criteria) this;
+        }
+
+        public Criteria andWechatLessThanOrEqualTo(String value) {
+            addCriterion("wechat <=", value, "wechat");
+            return (Criteria) this;
+        }
+
+        public Criteria andWechatLike(String value) {
+            addCriterion("wechat like", value, "wechat");
             return (Criteria) this;
         }
 
-        public Criteria andCountIsNull() {
-            addCriterion("`count` is null");
+        public Criteria andWechatNotLike(String value) {
+            addCriterion("wechat not like", value, "wechat");
             return (Criteria) this;
         }
 
-        public Criteria andCountIsNotNull() {
-            addCriterion("`count` is not null");
+        public Criteria andWechatIn(List<String> values) {
+            addCriterion("wechat in", values, "wechat");
             return (Criteria) this;
         }
 
-        public Criteria andCountEqualTo(Integer value) {
-            addCriterion("`count` =", value, "count");
+        public Criteria andWechatNotIn(List<String> values) {
+            addCriterion("wechat not in", values, "wechat");
             return (Criteria) this;
         }
 
-        public Criteria andCountNotEqualTo(Integer value) {
-            addCriterion("`count` <>", value, "count");
+        public Criteria andWechatBetween(String value1, String value2) {
+            addCriterion("wechat between", value1, value2, "wechat");
             return (Criteria) this;
         }
 
-        public Criteria andCountGreaterThan(Integer value) {
-            addCriterion("`count` >", value, "count");
+        public Criteria andWechatNotBetween(String value1, String value2) {
+            addCriterion("wechat not between", value1, value2, "wechat");
             return (Criteria) this;
         }
 
-        public Criteria andCountGreaterThanOrEqualTo(Integer value) {
-            addCriterion("`count` >=", value, "count");
+        public Criteria andCancelReasonIsNull() {
+            addCriterion("cancel_reason is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCancelReasonIsNotNull() {
+            addCriterion("cancel_reason is not null");
             return (Criteria) this;
         }
 
-        public Criteria andCountLessThan(Integer value) {
-            addCriterion("`count` <", value, "count");
+        public Criteria andCancelReasonEqualTo(String value) {
+            addCriterion("cancel_reason =", value, "cancelReason");
+            return (Criteria) this;
+        }
+
+        public Criteria andCancelReasonNotEqualTo(String value) {
+            addCriterion("cancel_reason <>", value, "cancelReason");
             return (Criteria) this;
         }
 
-        public Criteria andCountLessThanOrEqualTo(Integer value) {
-            addCriterion("`count` <=", value, "count");
+        public Criteria andCancelReasonGreaterThan(String value) {
+            addCriterion("cancel_reason >", value, "cancelReason");
             return (Criteria) this;
         }
 
-        public Criteria andCountIn(List<Integer> values) {
-            addCriterion("`count` in", values, "count");
+        public Criteria andCancelReasonGreaterThanOrEqualTo(String value) {
+            addCriterion("cancel_reason >=", value, "cancelReason");
             return (Criteria) this;
         }
 
-        public Criteria andCountNotIn(List<Integer> values) {
-            addCriterion("`count` not in", values, "count");
+        public Criteria andCancelReasonLessThan(String value) {
+            addCriterion("cancel_reason <", value, "cancelReason");
             return (Criteria) this;
         }
 
-        public Criteria andCountBetween(Integer value1, Integer value2) {
-            addCriterion("`count` between", value1, value2, "count");
+        public Criteria andCancelReasonLessThanOrEqualTo(String value) {
+            addCriterion("cancel_reason <=", value, "cancelReason");
             return (Criteria) this;
         }
 
-        public Criteria andCountNotBetween(Integer value1, Integer value2) {
-            addCriterion("`count` not between", value1, value2, "count");
+        public Criteria andCancelReasonLike(String value) {
+            addCriterion("cancel_reason like", value, "cancelReason");
+            return (Criteria) this;
+        }
+
+        public Criteria andCancelReasonNotLike(String value) {
+            addCriterion("cancel_reason not like", value, "cancelReason");
+            return (Criteria) this;
+        }
+
+        public Criteria andCancelReasonIn(List<String> values) {
+            addCriterion("cancel_reason in", values, "cancelReason");
+            return (Criteria) this;
+        }
+
+        public Criteria andCancelReasonNotIn(List<String> values) {
+            addCriterion("cancel_reason not in", values, "cancelReason");
+            return (Criteria) this;
+        }
+
+        public Criteria andCancelReasonBetween(String value1, String value2) {
+            addCriterion("cancel_reason between", value1, value2, "cancelReason");
+            return (Criteria) this;
+        }
+
+        public Criteria andCancelReasonNotBetween(String value1, String value2) {
+            addCriterion("cancel_reason not between", value1, value2, "cancelReason");
             return (Criteria) this;
         }
 
@@ -570,13 +650,23 @@ public class CancelMemberExample {
             return (Criteria) this;
         }
 
-        public Criteria andMemberAccountLikeInsensitive(String value) {
-            addCriterion("upper(member_account) like", value.toUpperCase(), "memberAccount");
+        public Criteria andPhoneLikeInsensitive(String value) {
+            addCriterion("upper(phone) like", value.toUpperCase(), "phone");
+            return (Criteria) this;
+        }
+
+        public Criteria andEmailLikeInsensitive(String value) {
+            addCriterion("upper(email) like", value.toUpperCase(), "email");
+            return (Criteria) this;
+        }
+
+        public Criteria andTencentLikeInsensitive(String value) {
+            addCriterion("upper(tencent) like", value.toUpperCase(), "tencent");
             return (Criteria) this;
         }
 
-        public Criteria andThirdAccountLikeInsensitive(String value) {
-            addCriterion("upper(third_account) like", value.toUpperCase(), "thirdAccount");
+        public Criteria andWechatLikeInsensitive(String value) {
+            addCriterion("upper(wechat) like", value.toUpperCase(), "wechat");
             return (Criteria) this;
         }
 

+ 82 - 0
backend-core/src/main/java/cn/kdan/pdf/backend/core/params/AddAdvertisementParam.java

@@ -0,0 +1,82 @@
+package cn.kdan.pdf.backend.core.params;
+
+import lombok.Data;
+
+/**
+ * @author sfq
+ * @description
+ */
+@Data
+public class AddAdvertisementParam {
+
+    /**
+     * 名称
+     */
+    private String slug;
+
+    /**
+     * 标题
+     */
+    private String title;
+
+    /**
+     * 描述
+     */
+    private String description;
+
+    /**
+     * 图片
+     */
+    private String image;
+
+    /**
+     * 尺寸
+     */
+    private String dimension;
+
+    /**
+     * 链接文案
+     */
+    private String linkText;
+
+    /**
+     * 链接地址
+     */
+    private String linkUrl;
+
+    /**
+     * 语言
+     */
+    private String language;
+
+    /**
+     * 开始日期
+     */
+    private String startDate;
+
+    /**
+     * 结束日期
+     */
+    private String endDate;
+
+    /**
+     * 展示类型
+     */
+    private String displayType;
+
+    /**
+     * 开始时间
+     */
+    private String startHour;
+
+    /**
+     * 结束时间
+     */
+    private String endHour;
+
+    /**
+     * 额外信息
+     */
+    private String extraInfo;
+
+}

+ 82 - 0
backend-core/src/main/java/cn/kdan/pdf/backend/core/pojo/AdvertisementVo.java

@@ -0,0 +1,82 @@
+package cn.kdan.pdf.backend.core.pojo;
+
+import lombok.Data;
+
+/**
+ * @author sfq
+ * @description
+ */
+@Data
+public class AdvertisementVo {
+
+    /**
+     * 名称
+     */
+    private String slug;
+
+    /**
+     * 标题
+     */
+    private String title;
+
+    /**
+     * 描述
+     */
+    private String description;
+
+    /**
+     * 图片
+     */
+    private String image;
+
+    /**
+     * 尺寸
+     */
+    private String dimension;
+
+    /**
+     * 链接文案
+     */
+    private String linkText;
+
+    /**
+     * 链接地址
+     */
+    private String linkUrl;
+
+    /**
+     * 语言
+     */
+    private String language;
+
+    /**
+     * 开始日期
+     */
+    private String startDate;
+
+    /**
+     * 结束日期
+     */
+    private String endDate;
+
+    /**
+     * 展示类型
+     */
+    private String displayType;
+
+    /**
+     * 开始时间
+     */
+    private String startHour;
+
+    /**
+     * 结束时间
+     */
+    private String endHour;
+
+    /**
+     * 额外信息
+     */
+    private String extraInfo;
+
+}

+ 8 - 1
backend-core/src/main/java/cn/kdan/pdf/backend/core/service/CancelMemberService.java

@@ -12,6 +12,13 @@ public interface CancelMemberService {
      * 增加用户注销记录
      * @param members
      */
-    void addCancelMember(Members members);
+    void addCancelMember(Members members, String cancelReason);
 
+    /**
+     * 判断是否是注销过的用户
+     * @param account 账号
+     * @param provider 注册方式(phone、email、tencent、wechat)
+     * @return true:是注销过的;false:没有注销过
+     */
+    boolean isCancelMember(String account, String provider);
 }

+ 8 - 3
backend-core/src/main/java/cn/kdan/pdf/backend/core/service/impl/AuthServiceImpl.java

@@ -2,6 +2,7 @@ package cn.kdan.pdf.backend.core.service.impl;
 
 import cn.kdan.pdf.backend.core.constant.AuthConstant;
 import cn.kdan.pdf.backend.core.constant.MembersConstant;
+import cn.kdan.pdf.backend.core.constant.ProviderConstant;
 import cn.kdan.pdf.backend.core.enums.CaptchaActionEnum;
 import cn.kdan.pdf.backend.core.enums.ImageCodeTypeEnum;
 import cn.kdan.pdf.backend.core.enums.ProviderEnum;
@@ -319,7 +320,9 @@ public class AuthServiceImpl implements AuthService {
                     member = new Members();
                     member.setName(String.valueOf(System.currentTimeMillis()).substring(0, 10));
                     member.setPhone(account);
-                    memberId = memberService.insertMembers(member, password);
+                    //判断是否是注销过的用户
+                    boolean flag = memberService.isCancelMember(account, ProviderConstant.PHONE);
+                    memberId = memberService.insertMembers(member, password, flag);
                     memberVo.setName(member.getName());
                     memberVo.setEmail(member.getEmail());
                     memberVo.setPhone(member.getPhone());
@@ -439,7 +442,8 @@ public class AuthServiceImpl implements AuthService {
             if(ObjectUtils.isEmpty(socialAccounts)){
                 Members member = new Members();
                 setMembersName(tencent.getNickname(), member);
-                String id = memberService.insertMembers(member, password);
+                boolean flag = memberService.isCancelMember(tencent.getUnionId(), ProviderConstant.TENCENT);
+                String id = memberService.insertMembers(member, password, flag);
                 insertSocialAccount(provider, id, tencent.getUnionId(), tencent.getFigureUrl(), tencent.getNickname());
                 memberId = id;
             } else{
@@ -450,7 +454,8 @@ public class AuthServiceImpl implements AuthService {
             if(ObjectUtils.isEmpty(socialAccounts)){
                 Members member = new Members();
                 setMembersName(wechat.getNickname(),member);
-                String id = memberService.insertMembers(member, password);
+                boolean flag = memberService.isCancelMember(tencent.getUnionId(), ProviderConstant.WECHAT);
+                String id = memberService.insertMembers(member, password, flag);
                 insertSocialAccount(provider, id, wechat.getUnionId(), wechat.getHeadImgUrl(), wechat.getNickname());
                 memberId = id;
             } else{

+ 38 - 17
backend-core/src/main/java/cn/kdan/pdf/backend/core/service/impl/CancelMemberServiceImpl.java

@@ -1,7 +1,10 @@
 package cn.kdan.pdf.backend.core.service.impl;
 
+import cn.kdan.pdf.backend.core.constant.ProviderConstant;
+import cn.kdan.pdf.backend.core.enums.ProviderEnum;
 import cn.kdan.pdf.backend.core.mapper.CancelMemberMapper;
 import cn.kdan.pdf.backend.core.model.CancelMember;
+import cn.kdan.pdf.backend.core.model.CancelMemberExample;
 import cn.kdan.pdf.backend.core.model.Members;
 import cn.kdan.pdf.backend.core.model.SocialAccounts;
 import cn.kdan.pdf.backend.core.service.CancelMemberService;
@@ -30,30 +33,48 @@ public class CancelMemberServiceImpl implements CancelMemberService {
     private CancelMemberMapper cancelMemberMapper;
 
     @Override
-    public void addCancelMember(Members members) {
-        // 根据用户手机号/邮箱、或者第三方标识来判断是否已经注销过
-        String phone = members.getPhone();
-        String email = members.getEmail();
+    public void addCancelMember(Members members, String cancelReason) {
+        // 插入注销账号记录,被绑定的账号都插入记录
+        CancelMember cancelMember = new CancelMember();
+        cancelMember.setId(CommonUtils.generateId());
+        cancelMember.setPhone(members.getPhone());
+        cancelMember.setEmail(members.getEmail());
         String memberId = members.getId();
-        String thirdAccount = "";
         List<SocialAccounts> socialAccounts = socialAccountService.selectByMemberId(memberId);
+        // 一个用户可能绑定多个第三方账号,所以需要遍历
         if(!CollectionUtils.isEmpty(socialAccounts)){
-            thirdAccount = socialAccounts.get(0).getAccountId();
-        }
-
-        // 插入注销账号记录,优先插入第三方注销记录
-        CancelMember cancelMember = new CancelMember();
-        cancelMember.setId(CommonUtils.generateId());
-        if(!StringUtils.isEmpty(phone)){
-            cancelMember.setMemberAccount(phone);
-        } else if(!StringUtils.isEmpty(email)){
-            cancelMember.setMemberAccount(email);
-        } else{
-            cancelMember.setThirdAccount(thirdAccount);
+            for (SocialAccounts socialAccount : socialAccounts) {
+                if(ProviderEnum.TENCENT.getValue().equals(socialAccount.getProvider())){
+                    cancelMember.setTencent(socialAccount.getAccountId());
+                }else{
+                    cancelMember.setWechat(socialAccount.getAccountId());
+                }
+            }
         }
+        cancelMember.setCancelReason(cancelReason);
         Date date = new Date();
         cancelMember.setCreatedAt(date);
         cancelMember.setUpdatedAt(date);
         cancelMemberMapper.insert(cancelMember);
     }
+
+    @Override
+    public boolean isCancelMember(String account, String provider) {
+        CancelMemberExample example = new CancelMemberExample();
+        CancelMemberExample.Criteria criteria = example.createCriteria();
+        if(ProviderConstant.PHONE.equals(provider)){
+            criteria.andPhoneEqualTo(account);
+        }else if(ProviderConstant.EMAIL.equals(provider)){
+            criteria.andEmailEqualTo(account);
+        }else if (ProviderConstant.WECHAT.equals(provider)){
+            criteria.andWechatEqualTo(account);
+        }else{
+            criteria.andTencentEqualTo(account);
+        }
+        List<CancelMember> cancelMembers = cancelMemberMapper.selectByExample(example);
+        if(!CollectionUtils.isEmpty(cancelMembers)){
+            return true;
+        }
+        return false;
+    }
 }

+ 31 - 7
backend-core/src/main/java/cn/kdan/pdf/backend/core/service/impl/MemberServiceImpl.java

@@ -2,6 +2,7 @@ package cn.kdan.pdf.backend.core.service.impl;
 
 import cn.kdan.pdf.backend.core.constant.AuthConstant;
 import cn.kdan.pdf.backend.core.constant.MembersConstant;
+import cn.kdan.pdf.backend.core.constant.ProviderConstant;
 import cn.kdan.pdf.backend.core.enums.*;
 import cn.kdan.pdf.backend.core.mapper.*;
 import cn.kdan.pdf.backend.core.mapper.ext.ExtMembersMapper;
@@ -153,14 +154,17 @@ public class MemberServiceImpl implements MemberService {
 
         // 添加数据
         Members member = new Members();
+        boolean flag = false;
         if (username.matches(mobileRegex)) {
             member.setPhone(username);
+            flag = isCancelMember(username,ProviderConstant.PHONE);
         } else if (username.matches(emailRegex)) {
             member.setEmail(username);
+            flag = isCancelMember(username,ProviderConstant.EMAIL);
         }
         //用户命名使用时间戳
         member.setName(String.valueOf(System.currentTimeMillis()).substring(0, 10));
-        insertMembers(member, password);
+        insertMembers(member, password, flag);
         resp.setMessage("注册成功");
         return resp;
     }
@@ -169,9 +173,10 @@ public class MemberServiceImpl implements MemberService {
      * 为members设置基础值并插入数据库
      * @param member member数据
      * @param password 密码
+     * @param flag 是否注销过
      * @return  用户id
      */
-    public String insertMembers(Members member, String password) {
+    public String insertMembers(Members member, String password, boolean flag) {
         String id = CommonUtils.generateId();
         member.setId(id);
         Date date = new Date();
@@ -187,8 +192,13 @@ public class MemberServiceImpl implements MemberService {
         member.setSubscriberType(CommonEnum.YesOrNoEnum.NO.value());
         // todo 用户账号account = sha1(86-phone / email)
         member.setAccount("");
-        member.setPoints(INIT_POINTS);
-        member.setTotalPoints(INIT_POINTS);
+        if(flag){
+            member.setPoints(0);
+            member.setTotalPoints(0);
+        }else{
+            member.setPoints(INIT_POINTS);
+            member.setTotalPoints(INIT_POINTS);
+        }
         member.setTotalSpace(DEFAULT_SPACE);
         member.setLeftSpace(new BigDecimal(DEFAULT_SPACE));
         membersMapper.insert(member);
@@ -298,7 +308,8 @@ public class MemberServiceImpl implements MemberService {
         //封装用户信息
         MemberInfo memberInfo = new MemberInfo();
         BeanUtils.copyProperties(member, memberInfo);
-        if (member.getUsedSpace() != null) {
+        // usedSpace不为空,且totalSpace不为0
+        if (member.getUsedSpace() != null && member.getTotalSpace() != 0) {
             BigDecimal usedSpacePercent = member.getUsedSpace().divide(new BigDecimal(member.getTotalSpace()), 2);
             memberInfo.setUsedSpacePercent(usedSpacePercent);
         } else {
@@ -550,11 +561,14 @@ public class MemberServiceImpl implements MemberService {
     @Override
     @Transactional(rollbackFor = BackendRuntimeException.class)
     public String cancelAccount(String cancelReason) {
+        if(StringUtils.isEmpty(cancelReason)){
+            throw new BackendRuntimeException("注销原因不能为空");
+        }
         Members currentUser = getCurrentUser();
         String memberId = currentUser.getId();
         log.info("开始进行用户注销,memberId:{}", memberId);
         // 增加用户注销记录
-        cancelMemberService.addCancelMember(currentUser);
+        cancelMemberService.addCancelMember(currentUser, cancelReason);
 
         //删除社交账号socialAccount表+用户members表数据
         //判断用户是否是空数据类型(未充值过券和会员服务)
@@ -587,7 +601,7 @@ public class MemberServiceImpl implements MemberService {
 
         String provider = param.getProvider();
         // 绑定手机号
-        if("phone".equals(provider)){
+        if(ProviderConstant.PHONE.equals(provider)){
             bindPhone(param, socialAccounts, currentUser);
             memberVo.setPhone(param.getPhone());
         } else{
@@ -771,4 +785,14 @@ public class MemberServiceImpl implements MemberService {
         }
         return vo;
     }
+
+    /**
+     * 判断是否是注销过的用户
+     * @param account 账号
+     * @param provider 注册方式(phone、email、tencent、wechat)
+     * @return true:是注销过的;false:没有注销过
+     */
+    public boolean isCancelMember(String account, String provider){
+        return cancelMemberService.isCancelMember(account,provider);
+    }
 }

+ 59 - 44
backend-core/src/main/resources/sqlmap/CancelMemberMapper.xml

@@ -3,10 +3,11 @@
 <mapper namespace="cn.kdan.pdf.backend.core.mapper.CancelMemberMapper">
   <resultMap id="BaseResultMap" type="cn.kdan.pdf.backend.core.model.CancelMember">
     <id column="id" jdbcType="VARCHAR" property="id" />
-    <result column="member_account" jdbcType="VARCHAR" property="memberAccount" />
-    <result column="third_account" jdbcType="VARCHAR" property="thirdAccount" />
+    <result column="phone" jdbcType="VARCHAR" property="phone" />
+    <result column="email" jdbcType="VARCHAR" property="email" />
+    <result column="tencent" jdbcType="VARCHAR" property="tencent" />
+    <result column="wechat" jdbcType="VARCHAR" property="wechat" />
     <result column="cancel_reason" jdbcType="VARCHAR" property="cancelReason" />
-    <result column="count" jdbcType="INTEGER" property="count" />
     <result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
     <result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
   </resultMap>
@@ -69,7 +70,7 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, member_account, third_account, cancel_reason, `count`, created_at, updated_at
+    id, phone, email, tencent, wechat, cancel_reason, created_at, updated_at
   </sql>
   <select id="selectByExample" parameterType="cn.kdan.pdf.backend.core.model.CancelMemberExample" resultMap="BaseResultMap">
     select
@@ -102,12 +103,12 @@
     </if>
   </delete>
   <insert id="insert" parameterType="cn.kdan.pdf.backend.core.model.CancelMember">
-    insert into cancel_member (id, member_account, third_account, 
-      cancel_reason, `count`, created_at, 
-      updated_at)
-    values (#{id,jdbcType=VARCHAR}, #{memberAccount,jdbcType=VARCHAR}, #{thirdAccount,jdbcType=VARCHAR}, 
-      #{cancelReason,jdbcType=VARCHAR}, #{count,jdbcType=INTEGER}, #{createdAt,jdbcType=TIMESTAMP}, 
-      #{updatedAt,jdbcType=TIMESTAMP})
+    insert into cancel_member (id, phone, email, 
+      tencent, wechat, cancel_reason, 
+      created_at, updated_at)
+    values (#{id,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{email,jdbcType=VARCHAR}, 
+      #{tencent,jdbcType=VARCHAR}, #{wechat,jdbcType=VARCHAR}, #{cancelReason,jdbcType=VARCHAR}, 
+      #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP})
   </insert>
   <insert id="insertSelective" parameterType="cn.kdan.pdf.backend.core.model.CancelMember">
     insert into cancel_member
@@ -115,18 +116,21 @@
       <if test="id != null">
         id,
       </if>
-      <if test="memberAccount != null">
-        member_account,
+      <if test="phone != null">
+        phone,
       </if>
-      <if test="thirdAccount != null">
-        third_account,
+      <if test="email != null">
+        email,
+      </if>
+      <if test="tencent != null">
+        tencent,
+      </if>
+      <if test="wechat != null">
+        wechat,
       </if>
       <if test="cancelReason != null">
         cancel_reason,
       </if>
-      <if test="count != null">
-        `count`,
-      </if>
       <if test="createdAt != null">
         created_at,
       </if>
@@ -138,18 +142,21 @@
       <if test="id != null">
         #{id,jdbcType=VARCHAR},
       </if>
-      <if test="memberAccount != null">
-        #{memberAccount,jdbcType=VARCHAR},
+      <if test="phone != null">
+        #{phone,jdbcType=VARCHAR},
       </if>
-      <if test="thirdAccount != null">
-        #{thirdAccount,jdbcType=VARCHAR},
+      <if test="email != null">
+        #{email,jdbcType=VARCHAR},
+      </if>
+      <if test="tencent != null">
+        #{tencent,jdbcType=VARCHAR},
+      </if>
+      <if test="wechat != null">
+        #{wechat,jdbcType=VARCHAR},
       </if>
       <if test="cancelReason != null">
         #{cancelReason,jdbcType=VARCHAR},
       </if>
-      <if test="count != null">
-        #{count,jdbcType=INTEGER},
-      </if>
       <if test="createdAt != null">
         #{createdAt,jdbcType=TIMESTAMP},
       </if>
@@ -170,18 +177,21 @@
       <if test="record.id != null">
         id = #{record.id,jdbcType=VARCHAR},
       </if>
-      <if test="record.memberAccount != null">
-        member_account = #{record.memberAccount,jdbcType=VARCHAR},
+      <if test="record.phone != null">
+        phone = #{record.phone,jdbcType=VARCHAR},
       </if>
-      <if test="record.thirdAccount != null">
-        third_account = #{record.thirdAccount,jdbcType=VARCHAR},
+      <if test="record.email != null">
+        email = #{record.email,jdbcType=VARCHAR},
+      </if>
+      <if test="record.tencent != null">
+        tencent = #{record.tencent,jdbcType=VARCHAR},
+      </if>
+      <if test="record.wechat != null">
+        wechat = #{record.wechat,jdbcType=VARCHAR},
       </if>
       <if test="record.cancelReason != null">
         cancel_reason = #{record.cancelReason,jdbcType=VARCHAR},
       </if>
-      <if test="record.count != null">
-        `count` = #{record.count,jdbcType=INTEGER},
-      </if>
       <if test="record.createdAt != null">
         created_at = #{record.createdAt,jdbcType=TIMESTAMP},
       </if>
@@ -196,10 +206,11 @@
   <update id="updateByExample" parameterType="map">
     update cancel_member
     set id = #{record.id,jdbcType=VARCHAR},
-      member_account = #{record.memberAccount,jdbcType=VARCHAR},
-      third_account = #{record.thirdAccount,jdbcType=VARCHAR},
+      phone = #{record.phone,jdbcType=VARCHAR},
+      email = #{record.email,jdbcType=VARCHAR},
+      tencent = #{record.tencent,jdbcType=VARCHAR},
+      wechat = #{record.wechat,jdbcType=VARCHAR},
       cancel_reason = #{record.cancelReason,jdbcType=VARCHAR},
-      `count` = #{record.count,jdbcType=INTEGER},
       created_at = #{record.createdAt,jdbcType=TIMESTAMP},
       updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}
     <if test="_parameter != null">
@@ -209,18 +220,21 @@
   <update id="updateByPrimaryKeySelective" parameterType="cn.kdan.pdf.backend.core.model.CancelMember">
     update cancel_member
     <set>
-      <if test="memberAccount != null">
-        member_account = #{memberAccount,jdbcType=VARCHAR},
+      <if test="phone != null">
+        phone = #{phone,jdbcType=VARCHAR},
       </if>
-      <if test="thirdAccount != null">
-        third_account = #{thirdAccount,jdbcType=VARCHAR},
+      <if test="email != null">
+        email = #{email,jdbcType=VARCHAR},
+      </if>
+      <if test="tencent != null">
+        tencent = #{tencent,jdbcType=VARCHAR},
+      </if>
+      <if test="wechat != null">
+        wechat = #{wechat,jdbcType=VARCHAR},
       </if>
       <if test="cancelReason != null">
         cancel_reason = #{cancelReason,jdbcType=VARCHAR},
       </if>
-      <if test="count != null">
-        `count` = #{count,jdbcType=INTEGER},
-      </if>
       <if test="createdAt != null">
         created_at = #{createdAt,jdbcType=TIMESTAMP},
       </if>
@@ -232,10 +246,11 @@
   </update>
   <update id="updateByPrimaryKey" parameterType="cn.kdan.pdf.backend.core.model.CancelMember">
     update cancel_member
-    set member_account = #{memberAccount,jdbcType=VARCHAR},
-      third_account = #{thirdAccount,jdbcType=VARCHAR},
+    set phone = #{phone,jdbcType=VARCHAR},
+      email = #{email,jdbcType=VARCHAR},
+      tencent = #{tencent,jdbcType=VARCHAR},
+      wechat = #{wechat,jdbcType=VARCHAR},
       cancel_reason = #{cancelReason,jdbcType=VARCHAR},
-      `count` = #{count,jdbcType=INTEGER},
       created_at = #{createdAt,jdbcType=TIMESTAMP},
       updated_at = #{updatedAt,jdbcType=TIMESTAMP}
     where id = #{id,jdbcType=VARCHAR}