实现用户注册/审核功能

This commit is contained in:
GoEdgeLab
2022-01-05 10:45:28 +08:00
parent ac20b32bd5
commit 6b02f3f812
17 changed files with 226 additions and 28 deletions

View File

@@ -7,6 +7,8 @@ import (
"github.com/iwind/TeaGo/maps"
)
var ErrUserNotFound = errors.New("not found user")
// InitUser 查找用户基本信息
func InitUser(p *actionutils.ParentAction, userId int64) error {
resp, err := p.RPC().UserRPC().FindEnabledUser(p.AdminContext(), &pb.FindEnabledUserRequest{UserId: userId})
@@ -14,7 +16,7 @@ func InitUser(p *actionutils.ParentAction, userId int64) error {
return err
}
if resp.User == nil {
return errors.New("not found user")
return ErrUserNotFound
}
// AccessKey数量