62 lines
1.7 KiB
Go
62 lines
1.7 KiB
Go
// Code generated by goctl. DO NOT EDIT.
|
|
// Source: app.proto
|
|
|
|
package appclient
|
|
|
|
import (
|
|
"context"
|
|
|
|
"mingyang-admin-app-rpc/types/app"
|
|
|
|
"github.com/zeromicro/go-zero/zrpc"
|
|
"google.golang.org/grpc"
|
|
)
|
|
|
|
type (
|
|
AuthToken = app.AuthToken
|
|
LoginRequest = app.LoginRequest
|
|
LoginResponse = app.LoginResponse
|
|
RegisterUserRequest = app.RegisterUserRequest
|
|
RegisterUserResponse = app.RegisterUserResponse
|
|
UserInfo = app.UserInfo
|
|
VerifyCodeReq = app.VerifyCodeReq
|
|
VerifyCodeResp = app.VerifyCodeResp
|
|
|
|
App interface {
|
|
// 获取验证码
|
|
GetVerifyCode(ctx context.Context, in *VerifyCodeReq, opts ...grpc.CallOption) (*VerifyCodeResp, error)
|
|
// 用户注册
|
|
RegisterUser(ctx context.Context, in *RegisterUserRequest, opts ...grpc.CallOption) (*RegisterUserResponse, error)
|
|
// 用户登录
|
|
LoginUser(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error)
|
|
}
|
|
|
|
defaultApp struct {
|
|
cli zrpc.Client
|
|
}
|
|
)
|
|
|
|
func NewApp(cli zrpc.Client) App {
|
|
return &defaultApp{
|
|
cli: cli,
|
|
}
|
|
}
|
|
|
|
// 获取验证码
|
|
func (m *defaultApp) GetVerifyCode(ctx context.Context, in *VerifyCodeReq, opts ...grpc.CallOption) (*VerifyCodeResp, error) {
|
|
client := app.NewAppClient(m.cli.Conn())
|
|
return client.GetVerifyCode(ctx, in, opts...)
|
|
}
|
|
|
|
// 用户注册
|
|
func (m *defaultApp) RegisterUser(ctx context.Context, in *RegisterUserRequest, opts ...grpc.CallOption) (*RegisterUserResponse, error) {
|
|
client := app.NewAppClient(m.cli.Conn())
|
|
return client.RegisterUser(ctx, in, opts...)
|
|
}
|
|
|
|
// 用户登录
|
|
func (m *defaultApp) LoginUser(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) {
|
|
client := app.NewAppClient(m.cli.Conn())
|
|
return client.LoginUser(ctx, in, opts...)
|
|
}
|