feat(API): optional display name on users
This commit is contained in:
1 parent
792aba433d
commit
7aae704d0a
22 files changed
+1051
-40
No files matched your search
@@ -0,0 +1,28 @@
|
||||
package publicuser
|
||||
|
||||
import (
|
||||
"RenewCMS/internal/domain/user"
|
||||
"time"
|
||||
)
|
||||
|
||||
type PublicUser struct {
|
||||
ID uint32 `json:"id"`
|
||||
Username string `json:"username"`
|
||||
Email string `json:"email"`
|
||||
IsVerified bool `json:"is_verified"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
DisplayName string `json:"display_name"`
|
||||
}
|
||||
|
||||
func New(u user.User) PublicUser {
|
||||
return PublicUser{
|
||||
ID: u.ID,
|
||||
Username: u.Username,
|
||||
Email: u.Email,
|
||||
IsVerified: u.IsVerified,
|
||||
CreatedAt: u.CreatedAt,
|
||||
UpdatedAt: u.UpdatedAt,
|
||||
DisplayName: u.DisplayName,
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user