✨ Support users related rpc calls
This commit is contained in:
@ -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 (
|
||||
|
Reference in New Issue
Block a user