chore: update id order

This commit is contained in:
2026-03-28 17:00:00 +01:00
parent 5380abe8ed
commit 3bf3f5e605
48 changed files with 2347 additions and 3693 deletions
+10 -4
View File
@@ -1,8 +1,14 @@
package models
import "time"
type User struct {
ID int `json:"id"`
Username string `json:"username"`
Password string `json:"password,omitempty"` // omitempty pour ne pas l'exposer dans les réponses JSON
Role string `json:"role"` // "user" ou "admin"
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" }