chore: refacto

This commit is contained in:
2026-04-20 19:41:52 +02:00
parent 5fc52c72ee
commit 2e9827af98
46 changed files with 497 additions and 648 deletions
+7 -5
View File
@@ -3,12 +3,14 @@ package models
import "time"
type User struct {
ID int `json:"id" gorm:"primaryKey;autoIncrement"`
Username string `json:"username" gorm:"column:username;uniqueIndex"`
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"`
CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"`
UpdatedAt time.Time `json:"updated_at" gorm:"autoUpdateTime"`
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" }