diff --git a/austin-common/src/main/java/com/java3y/austin/common/dto/account/sms/LinTongSmsAccount.java b/austin-common/src/main/java/com/java3y/austin/common/dto/account/sms/LinTongSmsAccount.java index 542288f..35f7483 100644 --- a/austin-common/src/main/java/com/java3y/austin/common/dto/account/sms/LinTongSmsAccount.java +++ b/austin-common/src/main/java/com/java3y/austin/common/dto/account/sms/LinTongSmsAccount.java @@ -2,6 +2,8 @@ package com.java3y.austin.common.dto.account.sms; import lombok.*; +import java.util.Objects; + /** * Form File *

Description

@@ -13,7 +15,6 @@ import lombok.*; * @Description * @see com.java3y.austin.common.dto.account austin */ -@EqualsAndHashCode(callSuper = true) @Data @Builder @AllArgsConstructor @@ -30,4 +31,36 @@ public class LinTongSmsAccount extends SmsAccount { private String userName; private String password; + /** + * 重写equals方法 + * + * @param o + * @return + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + if (!super.equals(o)) { + return false; + } + LinTongSmsAccount that = (LinTongSmsAccount) o; + return url.equals(that.url) && + userName.equals(that.userName) && + password.equals(that.password); + } + + /** + * 重写hashCode方法 + * + * @return + */ + @Override + public int hashCode() { + return Objects.hash(url, userName, password); + } } diff --git a/austin-common/src/main/java/com/java3y/austin/common/dto/account/sms/SmsAccount.java b/austin-common/src/main/java/com/java3y/austin/common/dto/account/sms/SmsAccount.java index d4a9410..c34b4c0 100644 --- a/austin-common/src/main/java/com/java3y/austin/common/dto/account/sms/SmsAccount.java +++ b/austin-common/src/main/java/com/java3y/austin/common/dto/account/sms/SmsAccount.java @@ -4,6 +4,8 @@ import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; +import java.util.Objects; + /** * @author 3y */ @@ -27,5 +29,33 @@ public class SmsAccount { */ protected String scriptName; + /** + * 重写equals方法 + * + * @param o + * @return + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SmsAccount that = (SmsAccount) o; + return supplierId.equals(that.supplierId) && + supplierName.equals(that.supplierName) && + scriptName.equals(that.scriptName); + } + /** + * 重写hashCode方法 + * + * @return + */ + @Override + public int hashCode() { + return Objects.hash(supplierId, supplierName, scriptName); + } } diff --git a/austin-common/src/main/java/com/java3y/austin/common/dto/account/sms/TencentSmsAccount.java b/austin-common/src/main/java/com/java3y/austin/common/dto/account/sms/TencentSmsAccount.java index bd62d54..bb0717b 100644 --- a/austin-common/src/main/java/com/java3y/austin/common/dto/account/sms/TencentSmsAccount.java +++ b/austin-common/src/main/java/com/java3y/austin/common/dto/account/sms/TencentSmsAccount.java @@ -4,6 +4,8 @@ import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; +import java.util.Objects; + /** * 腾讯短信参数 *

@@ -42,4 +44,41 @@ public class TencentSmsAccount extends SmsAccount { private String smsSdkAppId; private String templateId; private String signName; + + /** + * 重写equals方法 + * + * @param o + * @return + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + if (!super.equals(o)) { + return false; + } + TencentSmsAccount that = (TencentSmsAccount) o; + return url.equals(that.url) && + region.equals(that.region) && + secretId.equals(that.secretId) && + secretKey.equals(that.secretKey) && + smsSdkAppId.equals(that.smsSdkAppId) && + templateId.equals(that.templateId) && + signName.equals(that.signName); + } + + /** + * 重写hashCode方法 + * + * @return + */ + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), url, region, secretId, secretKey, smsSdkAppId, templateId, signName); + } } diff --git a/austin-common/src/main/java/com/java3y/austin/common/dto/account/sms/YunPianSmsAccount.java b/austin-common/src/main/java/com/java3y/austin/common/dto/account/sms/YunPianSmsAccount.java index f33e369..9e1e28a 100644 --- a/austin-common/src/main/java/com/java3y/austin/common/dto/account/sms/YunPianSmsAccount.java +++ b/austin-common/src/main/java/com/java3y/austin/common/dto/account/sms/YunPianSmsAccount.java @@ -4,6 +4,8 @@ import lombok.AllArgsConstructor; import lombok.Data; import lombok.NoArgsConstructor; +import java.util.Objects; + /** * 云片账号信息 *

@@ -31,4 +33,36 @@ public class YunPianSmsAccount extends SmsAccount { */ private String url; + /** + * 重写equals方法 + * + * @param o + * @return + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + if (!super.equals(o)) { + return false; + } + YunPianSmsAccount that = (YunPianSmsAccount) o; + return apikey.equals(that.apikey) && + tplId.equals(that.tplId) && + url.equals(that.url); + } + + /** + * 重写hashCode方法 + * + * @return + */ + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), apikey, tplId, url); + } }