Files
mayfly-go/server/internal/sys/domain/entity/resource.go
zongyangleo 3c0292b56e !132 fix:
* fix: 表结构同步修复
* fix: 达梦低权限兼容,pgsql bool值转换
2025-03-17 11:12:52 +00:00

37 lines
1.2 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package entity
import "mayfly-go/pkg/model"
type Resource struct {
model.Model
Pid int64 `json:"pid" gorm:"not null;comment:父节点id;"`
UiPath string `json:"ui_path" gorm:"size:300;comment:唯一标识路径;"` // 唯一标识路径
Type int8 `json:"type" gorm:"not null;comment:1菜单路由2资源按钮等;"` // 1菜单路由2资源按钮等
Status int8 `json:"status" gorm:"not null;comment:状态1:可用,-1:禁用;"` // 1可用-1不可用
Code string `json:"code" gorm:"size:300;comment:菜单路由为path其他为唯一标识;"`
Name string `json:"name" gorm:"size:255;not null;"`
Weight int `json:"weight"`
Meta string `json:"meta" gorm:"size:500;"`
}
func (a *Resource) TableName() string {
return "t_sys_resource"
}
func (m *Resource) FillBaseInfo(idGenType model.IdGenType, la *model.LoginAccount) {
// id使用时间戳减少id冲突概率
m.Model.FillBaseInfo(model.IdGenTypeTimestamp, la)
}
const (
ResourceStatusEnable int8 = 1 // 启用状态
ResourceStatusDisable int8 = -1 // 禁用状态
// 资源状态
ResourceTypeMenu int8 = 1
ResourceTypePermission int8 = 2
// 唯一标识路径分隔符
ResourceUiPathSp string = "/"
)