43 lines
1.0 KiB
Go
43 lines
1.0 KiB
Go
// Code generated by goctl. DO NOT EDIT.
|
|
// Source: app.proto
|
|
|
|
package server
|
|
|
|
import (
|
|
"context"
|
|
|
|
"mingyang-admin-app-rpc/internal/logic/code"
|
|
"mingyang-admin-app-rpc/internal/logic/user"
|
|
"mingyang-admin-app-rpc/internal/svc"
|
|
"mingyang-admin-app-rpc/types/app"
|
|
)
|
|
|
|
type AppServer struct {
|
|
svcCtx *svc.ServiceContext
|
|
app.UnimplementedAppServer
|
|
}
|
|
|
|
func NewAppServer(svcCtx *svc.ServiceContext) *AppServer {
|
|
return &AppServer{
|
|
svcCtx: svcCtx,
|
|
}
|
|
}
|
|
|
|
// 获取验证码
|
|
func (s *AppServer) GetVerifyCode(ctx context.Context, in *app.VerifyCodeReq) (*app.VerifyCodeResp, error) {
|
|
l := code.NewGetVerifyCodeLogic(ctx, s.svcCtx)
|
|
return l.GetVerifyCode(in)
|
|
}
|
|
|
|
// 用户注册
|
|
func (s *AppServer) RegisterUser(ctx context.Context, in *app.RegisterUserRequest) (*app.RegisterUserResponse, error) {
|
|
l := user.NewRegisterUserLogic(ctx, s.svcCtx)
|
|
return l.RegisterUser(in)
|
|
}
|
|
|
|
// 用户登录
|
|
func (s *AppServer) LoginUser(ctx context.Context, in *app.LoginRequest) (*app.LoginResponse, error) {
|
|
l := user.NewLoginUserLogic(ctx, s.svcCtx)
|
|
return l.LoginUser(in)
|
|
}
|