rbac/models/user.go
zhangkun9038@dingtalk.com 6669be1923 up
2025-02-16 17:55:27 +08:00

16 lines
434 B
Go

package models
import (
"time"
)
type User struct {
ID string `json:"id" gorm:"primaryKey"`
Username string `json:"username" gorm:"uniqueIndex;not null"`
Password string `json:"-" gorm:"not null"`
Email string `json:"email" gorm:"uniqueIndex;not null"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Roles []Role `json:"roles" gorm:"many2many:user_roles;"`
}