chore: update id order
This commit is contained in:
@@ -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" }
|
||||
|
||||
Reference in New Issue
Block a user