From c7cfd1e6f7a78ee9262453f1560bc157f9ec3349 Mon Sep 17 00:00:00 2001 From: what Date: Sun, 30 Jul 2023 17:04:09 +0800 Subject: [PATCH] =?UTF-8?q?[feat]=20ResFieldByAnys=20=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E7=A7=BB=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- base/res_field.go | 2 +- base/res_listener.go | 18 +++++++----------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/base/res_field.go b/base/res_field.go index aa3f198..982e076 100644 --- a/base/res_field.go +++ b/base/res_field.go @@ -49,7 +49,7 @@ func (this ResField) ToStructField(tags ...string) reflect.StructField { typ = reflect.TypeOf(true) case contracts.ResDataType_Json: if this.Default != "" && this.Default[0:1] == "[" { - typ = reflect.TypeOf(res_type.ResFieldByAnys{}) + typ = reflect.TypeOf([]any{}) } else { typ = reflect.TypeOf(map[string]any{}) } diff --git a/base/res_listener.go b/base/res_listener.go index 836f720..8b38c1b 100644 --- a/base/res_listener.go +++ b/base/res_listener.go @@ -1,17 +1,13 @@ package base -import ( - "git.fsdpf.net/go/contracts/res_type" -) - type ResListener struct { - Uuid string `db:"uuid"` - Code string `db:"code"` - Name string `db:"name"` - ResourceUuid string `db:"resource_uuid"` - Event res_type.ResFieldByAnys `db:"event"` - UpdatedAt string `db:"updated_at"` - CreatedAt string `db:"created_at"` + Uuid string `db:"uuid"` + Code string `db:"code"` + Name string `db:"name"` + ResourceUuid string `db:"resource_uuid"` + Event []any `db:"event"` + UpdatedAt string `db:"updated_at"` + CreatedAt string `db:"created_at"` } type GetResListens func(categoryUuid string, event ...string) []ResListener