lab1
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package domain
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type User struct {
|
||||
ID uuid.UUID
|
||||
Username string
|
||||
DisplayName string
|
||||
CreatedAt time.Time
|
||||
}
|
||||
|
||||
type UserDraft struct {
|
||||
Username string
|
||||
DisplayName string
|
||||
}
|
||||
|
||||
func (d UserDraft) Validate() error {
|
||||
return validateNotBlank("display_name", d.DisplayName)
|
||||
}
|
||||
Reference in New Issue
Block a user