rbac/models/user.go
zhangkun9038@dingtalk.com 008c776d93 user fullname
2025-02-17 19:28:36 +08:00

19 lines
467 B
Go

package models
import (
"time"
"gorm.io/gorm"
)
type User struct {
gorm.Model
Username string `json:"username" gorm:"uniqueIndex;not null"`
Fullname string `json:"fullname" gorm:"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;"`
}