17 lines
709 B
Go
17 lines
709 B
Go
package models
|
|
|
|
import "time"
|
|
|
|
type User struct {
|
|
ID int `json:"id" gorm:"primaryKey;autoIncrement"`
|
|
Username string `json:"username" gorm:"column:username;not null"`
|
|
Password string `json:"password,omitempty" gorm:"column:password"`
|
|
Role string `json:"role" gorm:"column:role"`
|
|
Total float64 `json:"total" gorm:"column:total;default:0"`
|
|
Livraison float64 `json:"livraison" gorm:"column:livraison;default:0"`
|
|
CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"`
|
|
UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"`
|
|
}
|
|
|
|
func (User) TableName() string { return "users" }
|