From 6675dca35948bead3ba72baeeac0cf098877c5c7 Mon Sep 17 00:00:00 2001 From: what Date: Mon, 25 Nov 2024 15:05:06 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=20=E7=A7=BB=E9=99=A4=E8=B5=84=E6=BA=90?= =?UTF-8?q?=20namespace=20=E5=AD=97=E6=AE=B5,=20=E6=96=B0=E5=A2=9E=20isSys?= =?UTF-8?q?tem=20=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base/resource.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) 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,