go项目脚手架
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
sorbet/internal/entities/system_role.go

20 lines
941 B

package entities
import (
"gorm.io/gorm"
"sorbet/pkg/db"
"time"
)
// SystemRole 系统用户角色表
type SystemRole struct {
ID uint `json:"id" xml:"id" gorm:"primaryKey;not null;comment:角色编号"`
Name string `json:"name" xml:"name" gorm:"size:25;not null;uniqueIndex;comment:角色名称"`
Version db.Version `json:"-" xml:"-" gorm:"comment:乐观锁"`
CreatedAt time.Time `json:"create_time" xml:"create_time" gorm:"<-:false;comment:创建时间"`
UpdatedAt time.Time `json:"update_time" xml:"update_time" gorm:"<-:false;comment:更新时间"`
DeletedAt gorm.DeletedAt `json:"-" xml:"-" gorm:"comment:删除时间"`
Powers []*SystemRolePower `json:"powers" xml:"powers" gorm:"foreignKey:RoleID"`
Users []*SystemUser `json:"users" xml:"users" gorm:"many2many:system_user_to_role_relations"`
}