init commit
This commit is contained in:
@@ -0,0 +1,110 @@
|
||||
package ru.mtusi.messenger.dto;
|
||||
|
||||
import java.util.Objects;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import jakarta.validation.constraints.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.annotation.Generated;
|
||||
import org.hibernate.validator.constraints.CodePointLength;
|
||||
|
||||
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", comments = "Generator version: 7.10.0")
|
||||
public class CreateUserDTO {
|
||||
|
||||
private String username;
|
||||
|
||||
private String displayName;
|
||||
|
||||
private String password;
|
||||
|
||||
public CreateUserDTO() {
|
||||
super();
|
||||
}
|
||||
|
||||
public CreateUserDTO(String username, String displayName, String password) {
|
||||
this.username = username;
|
||||
this.displayName = displayName;
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public CreateUserDTO username(String username) {
|
||||
this.username = username;
|
||||
return this;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Pattern(regexp = "^[a-z0-9_]{3,32}$")
|
||||
@Schema(name = "username", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@JsonProperty("username")
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public CreateUserDTO displayName(String displayName) {
|
||||
this.displayName = displayName;
|
||||
return this;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@CodePointLength(min = 1, max = 100)
|
||||
@Schema(name = "display_name", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@JsonProperty("display_name")
|
||||
public String getDisplayName() {
|
||||
return displayName;
|
||||
}
|
||||
|
||||
public void setDisplayName(String displayName) {
|
||||
this.displayName = displayName;
|
||||
}
|
||||
|
||||
public CreateUserDTO password(String password) {
|
||||
this.password = password;
|
||||
return this;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@CodePointLength(min = 12, max = 128)
|
||||
@Schema(name = "password", requiredMode = Schema.RequiredMode.REQUIRED, accessMode = Schema.AccessMode.WRITE_ONLY)
|
||||
@JsonProperty(value = "password", access = JsonProperty.Access.WRITE_ONLY)
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
CreateUserDTO createUser = (CreateUserDTO) o;
|
||||
return Objects.equals(this.username, createUser.username) &&
|
||||
Objects.equals(this.displayName, createUser.displayName) &&
|
||||
Objects.equals(this.password, createUser.password);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(username, displayName, password);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("class CreateUserDTO {\n");
|
||||
sb.append(" username: ").append(toIndentedString(username)).append("\n");
|
||||
sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n");
|
||||
sb.append(" password: ").append(password != null ? "***" : "null").append("\n");
|
||||
sb.append("}");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
private String toIndentedString(Object o) {
|
||||
if (o == null) return "null";
|
||||
return o.toString().replace("\n", "\n ");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user