User /dto update

pull/4/head
shengzhaoli.shengz 2023-10-13 15:28:01 +08:00
parent 7e56e71335
commit 5b6b64e6a2
1 changed files with 106 additions and 2 deletions

View File

@ -2,17 +2,20 @@ package com.monkeyk.sos.domain.user;
import com.monkeyk.sos.domain.AbstractDomain;
import java.io.Serial;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* table: user_
*
* @author Shengzhao Li
*/
public class User extends AbstractDomain {
@Serial
private static final long serialVersionUID = -2921689304753120556L;
@ -27,9 +30,22 @@ public class User extends AbstractDomain {
*/
private String password;
/**
*
*
* @see org.springframework.security.oauth2.core.oidc.OidcScopes#PHONE
*/
private String phone;
/**
*
*
* @see org.springframework.security.oauth2.core.oidc.OidcScopes#EMAIL
*/
private String email;
//Default user is initial when create database, do not delete
/**
* Default user is initial when create database, do not delete
*/
private boolean defaultUser = false;
/**
@ -42,6 +58,33 @@ public class User extends AbstractDomain {
*/
private List<Privilege> privileges = new ArrayList<>();
/**
* true
* false
*/
private boolean enabled = true;
/**
*
*
* @see org.springframework.security.oauth2.core.oidc.OidcScopes#PROFILE
*/
private String nickname;
/**
*
*
* @see org.springframework.security.oauth2.core.oidc.OidcScopes#ADDRESS
*/
private String address;
/**
*
*
* @since 3.0.0
*/
private long updatedAt;
public User() {
}
@ -124,4 +167,65 @@ public class User extends AbstractDomain {
this.password = password;
return this;
}
/**
* @since 3.0.0
*/
public boolean enabled() {
return enabled;
}
/**
* @since 3.0.0
*/
public User enabled(boolean enabled) {
this.enabled = enabled;
return this;
}
/**
* @since 3.0.0
*/
public String nickname() {
return nickname;
}
/**
* @since 3.0.0
*/
public User nickname(String nickname) {
this.nickname = nickname;
return this;
}
/**
* @since 3.0.0
*/
public String address() {
return address;
}
/**
* @since 3.0.0
*/
public User address(String address) {
this.address = address;
return this;
}
/**
* @since 3.0.0
*/
public long updatedAt() {
return updatedAt;
}
/**
* @since 3.0.0
*/
public User updatedAt(long updatedAt) {
this.updatedAt = updatedAt;
return this;
}
}