43 lines
1.0 KiB
Go
43 lines
1.0 KiB
Go
// Code generated by goctl. DO NOT EDIT.
|
|
// goctl 1.7.2
|
|
// Source: user.proto
|
|
|
|
package server
|
|
|
|
import (
|
|
"context"
|
|
|
|
"tianyuan-api/apps/user/internal/logic/auth"
|
|
"tianyuan-api/apps/user/internal/svc"
|
|
"tianyuan-api/apps/user/user"
|
|
)
|
|
|
|
type AuthServer struct {
|
|
svcCtx *svc.ServiceContext
|
|
user.UnimplementedAuthServer
|
|
}
|
|
|
|
func NewAuthServer(svcCtx *svc.ServiceContext) *AuthServer {
|
|
return &AuthServer{
|
|
svcCtx: svcCtx,
|
|
}
|
|
}
|
|
|
|
// 注册接口
|
|
func (s *AuthServer) RegisterUser(ctx context.Context, in *user.RegisterReq) (*user.EmptyResponse, error) {
|
|
l := authlogic.NewRegisterUserLogic(ctx, s.svcCtx)
|
|
return l.RegisterUser(in)
|
|
}
|
|
|
|
// 登录接口
|
|
func (s *AuthServer) LoginUser(ctx context.Context, in *user.LoginReq) (*user.LoginResp, error) {
|
|
l := authlogic.NewLoginUserLogic(ctx, s.svcCtx)
|
|
return l.LoginUser(in)
|
|
}
|
|
|
|
// 手机登录接口
|
|
func (s *AuthServer) PhoneLoginUser(ctx context.Context, in *user.PhoneLoginReq) (*user.LoginResp, error) {
|
|
l := authlogic.NewPhoneLoginUserLogic(ctx, s.svcCtx)
|
|
return l.PhoneLoginUser(in)
|
|
}
|