19 lines
1.1 KiB
Go
19 lines
1.1 KiB
Go
package models
|
|
|
|
import "gorm.io/gorm"
|
|
|
|
type Role struct {
|
|
ID string `json:"id" gorm:"primaryKey;size:20" comment:"ID" scenarios:"view;export"`
|
|
CreatedAt int64 `json:"created_at" gorm:"autoCreateTime" comment:"创建时间" scenarios:"list;view;export"`
|
|
UpdatedAt int64 `json:"updated_at" gorm:"autoUpdateTime" comment:"更新时间" scenarios:"list;view;export"`
|
|
DeletedAt gorm.DeletedAt `json:"deleted_at" gorm:"index" comment:"删除时间"`
|
|
Name string `json:"name" gorm:"size:60;not null;default:''" rule:"required" comment:"名称" scenarios:"search;list;create;update;view;export" position:"2"`
|
|
Description string `json:"description" gorm:"size:500;not null;default:''" format:"textarea" comment:"备注" scenarios:"create;update;view;export"`
|
|
Permissions string `json:"permissions" gorm:"size:10240;not null;default:''" comment:"权限" scenarios:"create;update"`
|
|
Position int `json:"position" gorm:"not null;default:0" comment:"排序" scenarios:""`
|
|
}
|
|
|
|
func (model *Role) TableName() string {
|
|
return "roles"
|
|
}
|