first commit
This commit is contained in:
42
apps/user/internal/server/auth/authserver.go
Normal file
42
apps/user/internal/server/auth/authserver.go
Normal file
@@ -0,0 +1,42 @@
|
||||
// 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)
|
||||
}
|
||||
Reference in New Issue
Block a user