68 lines
1.9 KiB
Go
68 lines
1.9 KiB
Go
// Code generated by goctl. DO NOT EDIT.
|
|
// Source: app.proto
|
|
|
|
package server
|
|
|
|
import (
|
|
"context"
|
|
|
|
"mingyang-admin-app-rpc/internal/logic/auth"
|
|
"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,
|
|
}
|
|
}
|
|
|
|
// 校验token
|
|
func (s *AppServer) AuthToken(ctx context.Context, in *app.AuthReq) (*app.AuthInfoResp, error) {
|
|
l := auth.NewAuthTokenLogic(ctx, s.svcCtx)
|
|
return l.AuthToken(in)
|
|
}
|
|
|
|
// 获取验证码
|
|
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) LogoutUser(ctx context.Context, in *app.UserToken) (*app.LogoutUserRequest, error) {
|
|
l := user.NewLogoutUserLogic(ctx, s.svcCtx)
|
|
return l.LogoutUser(in)
|
|
}
|
|
|
|
func (s *AppServer) InitDatabase(ctx context.Context, in *app.Empty) (*app.BaseResp, error) {
|
|
l := base.NewInitDatabaseLogic(ctx, s.svcCtx)
|
|
return l.InitDatabase(in)
|
|
}
|