55 lines
1.5 KiB
Go
55 lines
1.5 KiB
Go
// Code generated by goctl. DO NOT EDIT.
|
|
// Source: app.proto
|
|
|
|
package server
|
|
|
|
import (
|
|
"context"
|
|
|
|
"mingyang-admin-app-rpc/internal/logic/base"
|
|
"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)
|
|
}
|
|
|
|
// 分页查询用户信息
|
|
func (s *AppServer) ListUsers(ctx context.Context, in *app.PageUserRequest) (*app.PageUserResponse, error) {
|
|
l := user.NewListUsersLogic(ctx, s.svcCtx)
|
|
return l.ListUsers(in)
|
|
}
|
|
|
|
func (s *AppServer) InitDatabase(ctx context.Context, in *app.Empty) (*app.BaseResp, error) {
|
|
l := base.NewInitDatabaseLogic(ctx, s.svcCtx)
|
|
return l.InitDatabase(in)
|
|
}
|