-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
119 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
ddd/multi-layers/src/main/java/org/hzz/domain/dto/EmailQueryDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package org.hzz.domain.dto; | ||
|
||
import javax.validation.constraints.Email; | ||
|
||
//@Validated | ||
public class EmailQueryDTO { | ||
@Email(message = "邮箱格式不正确") | ||
private String email; | ||
|
||
public EmailQueryDTO() { | ||
} | ||
|
||
public @Email(message = "邮箱格式不正确") String getEmail() { | ||
return this.email; | ||
} | ||
|
||
public void setEmail(@Email(message = "邮箱格式不正确") String email) { | ||
this.email = email; | ||
} | ||
|
||
public boolean equals(final Object o) { | ||
if (o == this) return true; | ||
if (!(o instanceof EmailQueryDTO)) return false; | ||
final EmailQueryDTO other = (EmailQueryDTO) o; | ||
if (!other.canEqual((Object) this)) return false; | ||
final Object this$email = this.getEmail(); | ||
final Object other$email = other.getEmail(); | ||
if (this$email == null ? other$email != null : !this$email.equals(other$email)) return false; | ||
return true; | ||
} | ||
|
||
protected boolean canEqual(final Object other) { | ||
return other instanceof EmailQueryDTO; | ||
} | ||
|
||
public int hashCode() { | ||
final int PRIME = 59; | ||
int result = 1; | ||
final Object $email = this.getEmail(); | ||
result = result * PRIME + ($email == null ? 43 : $email.hashCode()); | ||
return result; | ||
} | ||
|
||
public String toString() { | ||
return "EmailQueryDTO(email=" + this.getEmail() + ")"; | ||
} | ||
} |
44 changes: 40 additions & 4 deletions
44
validation/hibernate-use/src/main/java/org/hzz/phone/User.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,46 @@ | ||
package org.hzz.phone; | ||
|
||
import lombok.Data; | ||
|
||
@Data | ||
public class User { | ||
|
||
@MyPhone | ||
|
||
private String phonenumber; | ||
|
||
public User() { | ||
} | ||
|
||
public @MyPhone String getPhonenumber() { | ||
return this.phonenumber; | ||
} | ||
|
||
public void setPhonenumber(@MyPhone String phonenumber) { | ||
this.phonenumber = phonenumber; | ||
} | ||
|
||
public boolean equals(final Object o) { | ||
if (o == this) return true; | ||
if (!(o instanceof User)) return false; | ||
final User other = (User) o; | ||
if (!other.canEqual((Object) this)) return false; | ||
final Object this$phonenumber = this.getPhonenumber(); | ||
final Object other$phonenumber = other.getPhonenumber(); | ||
if (this$phonenumber == null ? other$phonenumber != null : !this$phonenumber.equals(other$phonenumber)) | ||
return false; | ||
return true; | ||
} | ||
|
||
protected boolean canEqual(final Object other) { | ||
return other instanceof User; | ||
} | ||
|
||
public int hashCode() { | ||
final int PRIME = 59; | ||
int result = 1; | ||
final Object $phonenumber = this.getPhonenumber(); | ||
result = result * PRIME + ($phonenumber == null ? 43 : $phonenumber.hashCode()); | ||
return result; | ||
} | ||
|
||
public String toString() { | ||
return "User(phonenumber=" + this.getPhonenumber() + ")"; | ||
} | ||
} |