diff --git a/base/resource.go b/base/resource.go index 40593c0..4881d29 100644 --- a/base/resource.go +++ b/base/resource.go @@ -45,10 +45,9 @@ type Resource struct { PUuid string `db:"pUuid"` Code string `db:"code"` Name string `db:"name"` + IsResSystem bool `db:"isSystem"` IsResVirtual bool `db:"isVirtual"` Table string `db:"table"` - Namespace string `db:"namespace"` - Workspace string `db:"workspace"` Primarykey string `db:"primaryKey"` IsHistoryRecord bool `db:"isHistoryRecord"` HistoryCacheMax int `db:"historyCacheMax"` @@ -89,7 +88,7 @@ func (this Resource) IsVirtual() bool { // 是否系统资源 func (this Resource) IsSystem() bool { - return this.Namespace == "Framework\\Service" + return this.IsResSystem } // 资源字段 @@ -440,16 +439,15 @@ func (this Resource) onUserEvent(builder *db.Builder, user req.User) { }) } -func NewVirtualResource(pRes Resource, code, name, sql string, fields []ResField) req.Resource { +func NewVirtualResource(pRes req.Resource, code, name, sql string, fields []ResField) req.Resource { return &Resource{ Uuid: code, - PUuid: pRes.Uuid, + PUuid: pRes.GetUuid(), Code: code, Name: name, IsResVirtual: true, Table: sql, - Namespace: pRes.Namespace, - Workspace: pRes.Workspace, + IsResSystem: pRes.IsSystem(), IsHistoryRecord: false, HistoryCacheMax: 0, Fields: fields,