2021-06-07 17:22:07 +08:00
|
|
|
|
package entity
|
|
|
|
|
|
|
2022-06-02 17:41:11 +08:00
|
|
|
|
import "mayfly-go/pkg/model"
|
2021-06-07 17:22:07 +08:00
|
|
|
|
|
|
|
|
|
|
type Resource struct {
|
|
|
|
|
|
model.Model
|
|
|
|
|
|
Pid int `json:"pid"`
|
|
|
|
|
|
Type int8 `json:"type"` // 1:菜单路由;2:资源(按钮等)
|
|
|
|
|
|
Status int8 `json:"status"` // 1:可用;-1:不可用
|
|
|
|
|
|
Code string `json:"code"`
|
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
|
Weight int `json:"weight"`
|
|
|
|
|
|
Meta string `json:"meta"`
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-07-28 18:03:19 +08:00
|
|
|
|
func (a *Resource) TableName() string {
|
|
|
|
|
|
return "t_sys_resource"
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-06-07 17:22:07 +08:00
|
|
|
|
const (
|
|
|
|
|
|
ResourceStatusEnable int8 = 1 // 启用状态
|
|
|
|
|
|
ResourceStatusDisable int8 = -1 // 禁用状态
|
|
|
|
|
|
|
|
|
|
|
|
// 资源状态
|
|
|
|
|
|
ResourceTypeMenu int8 = 1
|
|
|
|
|
|
ResourceTypePermission int8 = 2
|
|
|
|
|
|
)
|