15 lines
544 B
Go
15 lines
544 B
Go
package models
|
|
|
|
import "time"
|
|
|
|
type User struct {
|
|
ID int `json:"id" gorm:"primaryKey;autoIncrement"`
|
|
Username string `json:"username" gorm:"column:username;uniqueIndex"`
|
|
Password string `json:"password,omitempty" gorm:"column:password"`
|
|
Role string `json:"role" gorm:"column:role"`
|
|
CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"`
|
|
UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"`
|
|
}
|
|
|
|
func (User) TableName() string { return "users" }
|