110 lines
3.3 KiB
Go
110 lines
3.3 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)
|
|
}
|
|
|
|
// C端用户分页查询
|
|
func (s *AppServer) QueryUserPagePc(ctx context.Context, in *app.PageUserRequest) (*app.PageUserResponse, error) {
|
|
l := user.NewQueryUserPagePcLogic(ctx, s.svcCtx)
|
|
return l.QueryUserPagePc(in)
|
|
}
|
|
|
|
// C端用户详情
|
|
func (s *AppServer) GetUserPc(ctx context.Context, in *app.IDReq) (*app.UserInfo, error) {
|
|
l := user.NewGetUserPcLogic(ctx, s.svcCtx)
|
|
return l.GetUserPc(in)
|
|
}
|
|
|
|
// C端用户强制登出
|
|
func (s *AppServer) ForceLogoutPc(ctx context.Context, in *app.IDReq) (*app.BaseResp, error) {
|
|
l := user.NewForceLogoutPcLogic(ctx, s.svcCtx)
|
|
return l.ForceLogoutPc(in)
|
|
}
|
|
|
|
// C端用户修改密码
|
|
func (s *AppServer) UpdateUserPcPassword(ctx context.Context, in *app.UpdateUserPcPasswordReq) (*app.BaseResp, error) {
|
|
l := user.NewUpdateUserPcPasswordLogic(ctx, s.svcCtx)
|
|
return l.UpdateUserPcPassword(in)
|
|
}
|
|
|
|
// C端用户修改信息
|
|
func (s *AppServer) UpdateUserPcInfo(ctx context.Context, in *app.UserInfo) (*app.BaseResp, error) {
|
|
l := user.NewUpdateUserPcInfoLogic(ctx, s.svcCtx)
|
|
return l.UpdateUserPcInfo(in)
|
|
}
|
|
|
|
// C端用户修改头像
|
|
func (s *AppServer) UpdateUserPcAvatar(ctx context.Context, in *app.UpdateUserAvatarReq) (*app.BaseResp, error) {
|
|
l := user.NewUpdateUserPcAvatarLogic(ctx, s.svcCtx)
|
|
return l.UpdateUserPcAvatar(in)
|
|
}
|
|
|
|
// C端用户修改状态
|
|
func (s *AppServer) UpdateUserPcStatus(ctx context.Context, in *app.IDReq) (*app.BaseResp, error) {
|
|
l := user.NewUpdateUserPcStatusLogic(ctx, s.svcCtx)
|
|
return l.UpdateUserPcStatus(in)
|
|
}
|