rbac/models/user.go
zhangkun9038@dingtalk.com 3cc2b18081 up
2025-02-16 20:28:47 +08:00

17 lines
411 B
Go

package models
import (
"gorm.io/gorm"
"time"
)
type User struct {
gorm.Model
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;"`
}