From ae3583ead196de2b551486280e931bffae43d405 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sun, 27 Oct 2024 13:12:35 +0800 Subject: [PATCH] :bug: Fix UserInfo cannot store in database --- pkg/nex/sec/info.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/nex/sec/info.go b/pkg/nex/sec/info.go index dcb5747..4632df1 100644 --- a/pkg/nex/sec/info.go +++ b/pkg/nex/sec/info.go @@ -4,15 +4,16 @@ import ( "git.solsynth.dev/hypernet/nexus/pkg/nex" "git.solsynth.dev/hypernet/nexus/pkg/proto" "github.com/goccy/go-json" + "gorm.io/datatypes" ) // UserInfo is the basic of userinfo, you can add anything above it. // Full data from id service was stored in the metadata field. type UserInfo struct { - ID uint `json:"id"` - Name string `json:"name"` - PermNodes map[string]any `json:"perm_nodes"` - Metadata map[string]any `json:"metadata"` + ID uint `json:"id"` + Name string `json:"name"` + PermNodes datatypes.JSONMap `json:"perm_nodes" gorm:"-"` + Metadata datatypes.JSONMap `json:"metadata"` } func NewUserInfoFromProto(in *proto.UserInfo) UserInfo {