🐛 Fix UserInfo cannot store in database
This commit is contained in:
parent
7fd0b7695e
commit
ae3583ead1
@ -4,6 +4,7 @@ import (
|
|||||||
"git.solsynth.dev/hypernet/nexus/pkg/nex"
|
"git.solsynth.dev/hypernet/nexus/pkg/nex"
|
||||||
"git.solsynth.dev/hypernet/nexus/pkg/proto"
|
"git.solsynth.dev/hypernet/nexus/pkg/proto"
|
||||||
"github.com/goccy/go-json"
|
"github.com/goccy/go-json"
|
||||||
|
"gorm.io/datatypes"
|
||||||
)
|
)
|
||||||
|
|
||||||
// UserInfo is the basic of userinfo, you can add anything above it.
|
// UserInfo is the basic of userinfo, you can add anything above it.
|
||||||
@ -11,8 +12,8 @@ import (
|
|||||||
type UserInfo struct {
|
type UserInfo struct {
|
||||||
ID uint `json:"id"`
|
ID uint `json:"id"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
PermNodes map[string]any `json:"perm_nodes"`
|
PermNodes datatypes.JSONMap `json:"perm_nodes" gorm:"-"`
|
||||||
Metadata map[string]any `json:"metadata"`
|
Metadata datatypes.JSONMap `json:"metadata"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewUserInfoFromProto(in *proto.UserInfo) UserInfo {
|
func NewUserInfoFromProto(in *proto.UserInfo) UserInfo {
|
||||||
|
Loading…
Reference in New Issue
Block a user