Support users related rpc calls

This commit is contained in:
2024-10-31 21:07:53 +08:00
parent 8ff2648e4c
commit 8326c716e3
17 changed files with 698 additions and 490 deletions

View File

@ -2,6 +2,8 @@ package models
import (
"fmt"
"git.solsynth.dev/hypernet/nexus/pkg/nex"
"git.solsynth.dev/hypernet/nexus/pkg/proto"
"gorm.io/datatypes"
"time"
@ -58,6 +60,15 @@ func (v Account) GetPrimaryEmail() AccountContact {
return val
}
func (v Account) EncodeToUserInfo() *proto.UserInfo {
return &proto.UserInfo{
Id: uint64(v.ID),
Name: v.Name,
PermNodes: nex.EncodeMap(v.PermNodes),
Metadata: nex.EncodeMap(v),
}
}
type AccountContactType = int8
const (