26 lines
592 B
Go
26 lines
592 B
Go
package model
|
|
|
|
import "time"
|
|
|
|
// User is the business entity; it has no dependency on HTTP or a database driver.
|
|
type User struct {
|
|
ID int64 `json:"id"`
|
|
Name string `json:"name"`
|
|
Email string `json:"email"`
|
|
CreatedAt time.Time `json:"createdAt"`
|
|
UpdatedAt time.Time `json:"updatedAt"`
|
|
}
|
|
|
|
// UserInput is shared by creation and full replacement (PUT).
|
|
type UserInput struct {
|
|
Name string
|
|
Email string
|
|
}
|
|
|
|
type UserPage struct {
|
|
Items []User `json:"items"`
|
|
Total int `json:"total"`
|
|
Page int `json:"page"`
|
|
PageSize int `json:"pageSize"`
|
|
}
|