From 884df461f146b1362c89e67590bc14294bffb76e Mon Sep 17 00:00:00 2001 From: huanglei19951029 <81128461+huanglei19951029@users.noreply.github.com> Date: Mon, 15 Dec 2025 20:14:01 +0800 Subject: [PATCH] =?UTF-8?q?feat(app):=20=E6=B7=BB=E5=8A=A0C=E7=AB=AF?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=AE=A1=E7=90=86=E7=9B=B8=E5=85=B3=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=92=8C=E6=B6=88=E6=81=AF=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增C端用户分页查询、详情获取、强制登出、修改密码、修改信息、修改头像及修改状态接口 - 定义UpdateUserAvatarReq和UpdateUserPcPasswordReq消息结构 - 更新App服务接口,增加对应的gRPC方法声明和实现 - 扩展用户相关的proto消息类型索引和依赖关系 - 在app.go中暴露新添加的用户管理方法 --- api/desc/all.api | 2 +- api/desc/app/user.api | 9 +- rpc/app.proto | 25 ++ rpc/app/app.go | 168 ++++++++++ rpc/appclient/app.go | 112 +++++-- rpc/desc/app/user.proto | 7 + rpc/desc/pc/user.proto | 35 ++ .../logic/user/force_logout_pc_logic.go | 31 ++ rpc/internal/logic/user/get_user_pc_logic.go | 31 ++ .../logic/user/query_user_page_pc_logic.go | 31 ++ .../logic/user/update_user_pc_avatar_logic.go | 31 ++ .../logic/user/update_user_pc_info_logic.go | 31 ++ .../user/update_user_pc_password_logic.go | 31 ++ .../logic/user/update_user_pc_status_logic.go | 31 ++ rpc/internal/server/app_server.go | 42 +++ rpc/types/app/app.pb.go | 236 ++++++++++---- rpc/types/app/app_grpc.pb.go | 308 +++++++++++++++++- 17 files changed, 1050 insertions(+), 111 deletions(-) create mode 100644 rpc/app/app.go create mode 100644 rpc/desc/pc/user.proto create mode 100644 rpc/internal/logic/user/force_logout_pc_logic.go create mode 100644 rpc/internal/logic/user/get_user_pc_logic.go create mode 100644 rpc/internal/logic/user/query_user_page_pc_logic.go create mode 100644 rpc/internal/logic/user/update_user_pc_avatar_logic.go create mode 100644 rpc/internal/logic/user/update_user_pc_info_logic.go create mode 100644 rpc/internal/logic/user/update_user_pc_password_logic.go create mode 100644 rpc/internal/logic/user/update_user_pc_status_logic.go diff --git a/api/desc/all.api b/api/desc/all.api index d4c5ba0..fee91b3 100644 --- a/api/desc/all.api +++ b/api/desc/all.api @@ -1,2 +1,2 @@ import "base.api" -import "./app/user.api" \ No newline at end of file +import "./app/user.api" diff --git a/api/desc/app/user.api b/api/desc/app/user.api index 04b9925..7a0507f 100644 --- a/api/desc/app/user.api +++ b/api/desc/app/user.api @@ -131,8 +131,6 @@ type ( Data []UserInfo `json:"data"` } OauthAuthorizeReq {} - - OauthAuthorizeResp { BaseMsgResp } @@ -142,9 +140,6 @@ type ( // Password Password string `json:"password"` } - - - ) @server ( @@ -187,7 +182,7 @@ service App { // Logout | 退出登录 不传参数,默认使用请求头的token @handler logout - post /user/logout () returns (BaseMsgResp) + post /user/logout returns (BaseMsgResp) // PassWordReset | 修改密码 @handler passWordReset @@ -200,7 +195,5 @@ service App { //OauthAuthorize | 第三方登录接口 @handler oauthAuthorize post /user/oauthAuthorize (OauthAuthorizeReq) returns (OauthAuthorizeResp) - - } diff --git a/rpc/app.proto b/rpc/app.proto index 06880d9..f85af10 100644 --- a/rpc/app.proto +++ b/rpc/app.proto @@ -170,6 +170,10 @@ message UUIDsReq { repeated string ids = 1; } +message UpdateUserAvatarReq {} + +message UpdateUserPcPasswordReq {} + message UserInfo { optional uint64 id = 1; optional string username = 2; @@ -233,5 +237,26 @@ service App { rpc LogoutUser(UserToken) returns (LogoutUserRequest); // group: base rpc InitDatabase(Empty) returns (BaseResp); + // C端用户分页查询 + // group: user + rpc queryUserPagePc(PageUserRequest) returns (PageUserResponse); + // C端用户详情 + // group: user + rpc getUserPc(IDReq) returns (UserInfo); + // C端用户强制登出 + // group: user + rpc forceLogoutPc(IDReq) returns (BaseResp); + // C端用户修改密码 + // group: user + rpc updateUserPcPassword(UpdateUserPcPasswordReq) returns (BaseResp); + // C端用户修改信息 + // group: user + rpc updateUserPcInfo(UserInfo) returns (BaseResp); + // C端用户修改头像 + // group: user + rpc updateUserPcAvatar(UpdateUserAvatarReq) returns (BaseResp); + // C端用户修改状态 + // group: user + rpc updateUserPcStatus(IDReq) returns (BaseResp); } diff --git a/rpc/app/app.go b/rpc/app/app.go new file mode 100644 index 0000000..f54d1d1 --- /dev/null +++ b/rpc/app/app.go @@ -0,0 +1,168 @@ +// Code generated by goctl. DO NOT EDIT. +// Source: app.proto + +package app + +import ( + "context" + + "mingyang-admin-app-rpc/types/app" + + "github.com/zeromicro/go-zero/zrpc" + "google.golang.org/grpc" +) + +type ( + AuthInfoResp = pc.AuthInfoResp + AuthReq = pc.AuthReq + AuthToken = pc.AuthToken + BaseIDResp = pc.BaseIDResp + BaseMsg = pc.BaseMsg + BaseResp = pc.BaseResp + BaseUUIDResp = pc.BaseUUIDResp + ClaimStrings = pc.ClaimStrings + Empty = pc.Empty + IDReq = pc.IDReq + IDsReq = pc.IDsReq + LoginRequest = pc.LoginRequest + LoginResponse = pc.LoginResponse + LogoutUserRequest = pc.LogoutUserRequest + NumericDate = pc.NumericDate + PageInfoReq = pc.PageInfoReq + PageUserRequest = pc.PageUserRequest + PageUserResponse = pc.PageUserResponse + RegisterUserRequest = pc.RegisterUserRequest + RegisterUserResponse = pc.RegisterUserResponse + RegisteredClaims = pc.RegisteredClaims + UUIDReq = pc.UUIDReq + UUIDsReq = pc.UUIDsReq + UpdateUserAvatarReq = pc.UpdateUserAvatarReq + UpdateUserPcPasswordReq = pc.UpdateUserPcPasswordReq + UserInfo = pc.UserInfo + UserToken = pc.UserToken + VerifyCodeReq = pc.VerifyCodeReq + VerifyCodeResp = pc.VerifyCodeResp + + App interface { + // 校验token + AuthToken(ctx context.Context, in *AuthReq, opts ...grpc.CallOption) (*AuthInfoResp, error) + // 获取验证码 + 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) + // 分页查询用户信息 + ListUsers(ctx context.Context, in *PageUserRequest, opts ...grpc.CallOption) (*PageUserResponse, error) + // 用户退出登录 + LogoutUser(ctx context.Context, in *UserToken, opts ...grpc.CallOption) (*LogoutUserRequest, error) + InitDatabase(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*BaseResp, error) + // C端用户分页查询 + QueryUserPagePc(ctx context.Context, in *PageUserRequest, opts ...grpc.CallOption) (*PageUserResponse, error) + // C端用户详情 + GetUserPc(ctx context.Context, in *IDReq, opts ...grpc.CallOption) (*UserInfo, error) + // C端用户强制登出 + ForceLogoutPc(ctx context.Context, in *IDReq, opts ...grpc.CallOption) (*BaseResp, error) + // C端用户修改密码 + UpdateUserPcPassword(ctx context.Context, in *UpdateUserPcPasswordReq, opts ...grpc.CallOption) (*BaseResp, error) + // C端用户修改信息 + UpdateUserPcInfo(ctx context.Context, in *UserInfo, opts ...grpc.CallOption) (*BaseResp, error) + // C端用户修改头像 + UpdateUserPcAvatar(ctx context.Context, in *UpdateUserAvatarReq, opts ...grpc.CallOption) (*BaseResp, error) + // C端用户修改状态 + UpdateUserPcStatus(ctx context.Context, in *IDReq, opts ...grpc.CallOption) (*BaseResp, error) + } + + defaultApp struct { + cli zrpc.Client + } +) + +func NewApp(cli zrpc.Client) App { + return &defaultApp{ + cli: cli, + } +} + +// 校验token +func (m *defaultApp) AuthToken(ctx context.Context, in *AuthReq, opts ...grpc.CallOption) (*AuthInfoResp, error) { + client := pc.NewAppClient(m.cli.Conn()) + return client.AuthToken(ctx, in, opts...) +} + +// 获取验证码 +func (m *defaultApp) GetVerifyCode(ctx context.Context, in *VerifyCodeReq, opts ...grpc.CallOption) (*VerifyCodeResp, error) { + client := pc.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 := pc.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 := pc.NewAppClient(m.cli.Conn()) + return client.LoginUser(ctx, in, opts...) +} + +// 分页查询用户信息 +func (m *defaultApp) ListUsers(ctx context.Context, in *PageUserRequest, opts ...grpc.CallOption) (*PageUserResponse, error) { + client := pc.NewAppClient(m.cli.Conn()) + return client.ListUsers(ctx, in, opts...) +} + +// 用户退出登录 +func (m *defaultApp) LogoutUser(ctx context.Context, in *UserToken, opts ...grpc.CallOption) (*LogoutUserRequest, error) { + client := pc.NewAppClient(m.cli.Conn()) + return client.LogoutUser(ctx, in, opts...) +} + +func (m *defaultApp) InitDatabase(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*BaseResp, error) { + client := pc.NewAppClient(m.cli.Conn()) + return client.InitDatabase(ctx, in, opts...) +} + +// C端用户分页查询 +func (m *defaultApp) QueryUserPagePc(ctx context.Context, in *PageUserRequest, opts ...grpc.CallOption) (*PageUserResponse, error) { + client := pc.NewAppClient(m.cli.Conn()) + return client.QueryUserPagePc(ctx, in, opts...) +} + +// C端用户详情 +func (m *defaultApp) GetUserPc(ctx context.Context, in *IDReq, opts ...grpc.CallOption) (*UserInfo, error) { + client := pc.NewAppClient(m.cli.Conn()) + return client.GetUserPc(ctx, in, opts...) +} + +// C端用户强制登出 +func (m *defaultApp) ForceLogoutPc(ctx context.Context, in *IDReq, opts ...grpc.CallOption) (*BaseResp, error) { + client := pc.NewAppClient(m.cli.Conn()) + return client.ForceLogoutPc(ctx, in, opts...) +} + +// C端用户修改密码 +func (m *defaultApp) UpdateUserPcPassword(ctx context.Context, in *UpdateUserPcPasswordReq, opts ...grpc.CallOption) (*BaseResp, error) { + client := pc.NewAppClient(m.cli.Conn()) + return client.UpdateUserPcPassword(ctx, in, opts...) +} + +// C端用户修改信息 +func (m *defaultApp) UpdateUserPcInfo(ctx context.Context, in *UserInfo, opts ...grpc.CallOption) (*BaseResp, error) { + client := pc.NewAppClient(m.cli.Conn()) + return client.UpdateUserPcInfo(ctx, in, opts...) +} + +// C端用户修改头像 +func (m *defaultApp) UpdateUserPcAvatar(ctx context.Context, in *UpdateUserAvatarReq, opts ...grpc.CallOption) (*BaseResp, error) { + client := pc.NewAppClient(m.cli.Conn()) + return client.UpdateUserPcAvatar(ctx, in, opts...) +} + +// C端用户修改状态 +func (m *defaultApp) UpdateUserPcStatus(ctx context.Context, in *IDReq, opts ...grpc.CallOption) (*BaseResp, error) { + client := pc.NewAppClient(m.cli.Conn()) + return client.UpdateUserPcStatus(ctx, in, opts...) +} diff --git a/rpc/appclient/app.go b/rpc/appclient/app.go index 2f5f7f2..d5e5e10 100644 --- a/rpc/appclient/app.go +++ b/rpc/appclient/app.go @@ -13,33 +13,35 @@ import ( ) type ( - AuthInfoResp = app.AuthInfoResp - AuthReq = app.AuthReq - AuthToken = app.AuthToken - BaseIDResp = app.BaseIDResp - BaseMsg = app.BaseMsg - BaseResp = app.BaseResp - BaseUUIDResp = app.BaseUUIDResp - ClaimStrings = app.ClaimStrings - Empty = app.Empty - IDReq = app.IDReq - IDsReq = app.IDsReq - LoginRequest = app.LoginRequest - LoginResponse = app.LoginResponse - LogoutUserRequest = app.LogoutUserRequest - NumericDate = app.NumericDate - PageInfoReq = app.PageInfoReq - PageUserRequest = app.PageUserRequest - PageUserResponse = app.PageUserResponse - RegisterUserRequest = app.RegisterUserRequest - RegisterUserResponse = app.RegisterUserResponse - RegisteredClaims = app.RegisteredClaims - UUIDReq = app.UUIDReq - UUIDsReq = app.UUIDsReq - UserInfo = app.UserInfo - UserToken = app.UserToken - VerifyCodeReq = app.VerifyCodeReq - VerifyCodeResp = app.VerifyCodeResp + AuthInfoResp = app.AuthInfoResp + AuthReq = app.AuthReq + AuthToken = app.AuthToken + BaseIDResp = app.BaseIDResp + BaseMsg = app.BaseMsg + BaseResp = app.BaseResp + BaseUUIDResp = app.BaseUUIDResp + ClaimStrings = app.ClaimStrings + Empty = app.Empty + IDReq = app.IDReq + IDsReq = app.IDsReq + LoginRequest = app.LoginRequest + LoginResponse = app.LoginResponse + LogoutUserRequest = app.LogoutUserRequest + NumericDate = app.NumericDate + PageInfoReq = app.PageInfoReq + PageUserRequest = app.PageUserRequest + PageUserResponse = app.PageUserResponse + RegisterUserRequest = app.RegisterUserRequest + RegisterUserResponse = app.RegisterUserResponse + RegisteredClaims = app.RegisteredClaims + UUIDReq = app.UUIDReq + UUIDsReq = app.UUIDsReq + UpdateUserAvatarReq = app.UpdateUserAvatarReq + UpdateUserPcPasswordReq = app.UpdateUserPcPasswordReq + UserInfo = app.UserInfo + UserToken = app.UserToken + VerifyCodeReq = app.VerifyCodeReq + VerifyCodeResp = app.VerifyCodeResp App interface { // 校验token @@ -55,6 +57,20 @@ type ( // 用户退出登录 LogoutUser(ctx context.Context, in *UserToken, opts ...grpc.CallOption) (*LogoutUserRequest, error) InitDatabase(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*BaseResp, error) + // C端用户分页查询 + QueryUserPagePc(ctx context.Context, in *PageUserRequest, opts ...grpc.CallOption) (*PageUserResponse, error) + // C端用户详情 + GetUserPc(ctx context.Context, in *IDReq, opts ...grpc.CallOption) (*UserInfo, error) + // C端用户强制登出 + ForceLogoutPc(ctx context.Context, in *IDReq, opts ...grpc.CallOption) (*BaseResp, error) + // C端用户修改密码 + UpdateUserPcPassword(ctx context.Context, in *UpdateUserPcPasswordReq, opts ...grpc.CallOption) (*BaseResp, error) + // C端用户修改信息 + UpdateUserPcInfo(ctx context.Context, in *UserInfo, opts ...grpc.CallOption) (*BaseResp, error) + // C端用户修改头像 + UpdateUserPcAvatar(ctx context.Context, in *UpdateUserAvatarReq, opts ...grpc.CallOption) (*BaseResp, error) + // C端用户修改状态 + UpdateUserPcStatus(ctx context.Context, in *IDReq, opts ...grpc.CallOption) (*BaseResp, error) } defaultApp struct { @@ -108,3 +124,45 @@ func (m *defaultApp) InitDatabase(ctx context.Context, in *Empty, opts ...grpc.C client := app.NewAppClient(m.cli.Conn()) return client.InitDatabase(ctx, in, opts...) } + +// C端用户分页查询 +func (m *defaultApp) QueryUserPagePc(ctx context.Context, in *PageUserRequest, opts ...grpc.CallOption) (*PageUserResponse, error) { + client := app.NewAppClient(m.cli.Conn()) + return client.QueryUserPagePc(ctx, in, opts...) +} + +// C端用户详情 +func (m *defaultApp) GetUserPc(ctx context.Context, in *IDReq, opts ...grpc.CallOption) (*UserInfo, error) { + client := app.NewAppClient(m.cli.Conn()) + return client.GetUserPc(ctx, in, opts...) +} + +// C端用户强制登出 +func (m *defaultApp) ForceLogoutPc(ctx context.Context, in *IDReq, opts ...grpc.CallOption) (*BaseResp, error) { + client := app.NewAppClient(m.cli.Conn()) + return client.ForceLogoutPc(ctx, in, opts...) +} + +// C端用户修改密码 +func (m *defaultApp) UpdateUserPcPassword(ctx context.Context, in *UpdateUserPcPasswordReq, opts ...grpc.CallOption) (*BaseResp, error) { + client := app.NewAppClient(m.cli.Conn()) + return client.UpdateUserPcPassword(ctx, in, opts...) +} + +// C端用户修改信息 +func (m *defaultApp) UpdateUserPcInfo(ctx context.Context, in *UserInfo, opts ...grpc.CallOption) (*BaseResp, error) { + client := app.NewAppClient(m.cli.Conn()) + return client.UpdateUserPcInfo(ctx, in, opts...) +} + +// C端用户修改头像 +func (m *defaultApp) UpdateUserPcAvatar(ctx context.Context, in *UpdateUserAvatarReq, opts ...grpc.CallOption) (*BaseResp, error) { + client := app.NewAppClient(m.cli.Conn()) + return client.UpdateUserPcAvatar(ctx, in, opts...) +} + +// C端用户修改状态 +func (m *defaultApp) UpdateUserPcStatus(ctx context.Context, in *IDReq, opts ...grpc.CallOption) (*BaseResp, error) { + client := app.NewAppClient(m.cli.Conn()) + return client.UpdateUserPcStatus(ctx, in, opts...) +} diff --git a/rpc/desc/app/user.proto b/rpc/desc/app/user.proto index 9a09e3a..691e6da 100644 --- a/rpc/desc/app/user.proto +++ b/rpc/desc/app/user.proto @@ -91,6 +91,13 @@ message UserToken { message LogoutUserRequest { string access_token = 1; } +message UpdateUserPcPasswordReq{ + +} +message UpdateUserAvatarReq{ + +} + // App 服务定义 diff --git a/rpc/desc/pc/user.proto b/rpc/desc/pc/user.proto new file mode 100644 index 0000000..7ee2cfb --- /dev/null +++ b/rpc/desc/pc/user.proto @@ -0,0 +1,35 @@ +syntax = "proto3"; + +package app; +option go_package = "./app"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; + + + + +// PC端 服务定义 +service App { + // C端用户分页查询 + // group: user + rpc queryUserPagePc(PageUserRequest) returns (PageUserResponse); + // C端用户详情 + // group: user + rpc getUserPc(IDReq) returns (UserInfo); + // C端用户强制登出 + // group: user + rpc forceLogoutPc(IDReq) returns (BaseResp); + // C端用户修改密码 + // group: user + rpc updateUserPcPassword(UpdateUserPcPasswordReq) returns (BaseResp); + // C端用户修改信息 + // group: user + rpc updateUserPcInfo(UserInfo) returns (BaseResp); + // C端用户修改头像 + // group: user + rpc updateUserPcAvatar(UpdateUserAvatarReq) returns (BaseResp); + // C端用户修改状态 + // group: user + rpc updateUserPcStatus(IDReq) returns (BaseResp); + +} \ No newline at end of file diff --git a/rpc/internal/logic/user/force_logout_pc_logic.go b/rpc/internal/logic/user/force_logout_pc_logic.go new file mode 100644 index 0000000..54861ff --- /dev/null +++ b/rpc/internal/logic/user/force_logout_pc_logic.go @@ -0,0 +1,31 @@ +package user + +import ( + "context" + + "mingyang-admin-app-rpc/internal/svc" + "mingyang-admin-app-rpc/types/app" + + "github.com/zeromicro/go-zero/core/logx" +) + +type ForceLogoutPcLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewForceLogoutPcLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ForceLogoutPcLogic { + return &ForceLogoutPcLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +// C端用户强制登出 +func (l *ForceLogoutPcLogic) ForceLogoutPc(in *app.IDReq) (*app.BaseResp, error) { + // todo: add your logic here and delete this line + + return &app.BaseResp{}, nil +} diff --git a/rpc/internal/logic/user/get_user_pc_logic.go b/rpc/internal/logic/user/get_user_pc_logic.go new file mode 100644 index 0000000..0e7aa11 --- /dev/null +++ b/rpc/internal/logic/user/get_user_pc_logic.go @@ -0,0 +1,31 @@ +package user + +import ( + "context" + + "mingyang-admin-app-rpc/internal/svc" + "mingyang-admin-app-rpc/types/app" + + "github.com/zeromicro/go-zero/core/logx" +) + +type GetUserPcLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewGetUserPcLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetUserPcLogic { + return &GetUserPcLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +// C端用户详情 +func (l *GetUserPcLogic) GetUserPc(in *app.IDReq) (*app.UserInfo, error) { + // todo: add your logic here and delete this line + + return &app.UserInfo{}, nil +} diff --git a/rpc/internal/logic/user/query_user_page_pc_logic.go b/rpc/internal/logic/user/query_user_page_pc_logic.go new file mode 100644 index 0000000..4c3356b --- /dev/null +++ b/rpc/internal/logic/user/query_user_page_pc_logic.go @@ -0,0 +1,31 @@ +package user + +import ( + "context" + + "mingyang-admin-app-rpc/internal/svc" + "mingyang-admin-app-rpc/types/app" + + "github.com/zeromicro/go-zero/core/logx" +) + +type QueryUserPagePcLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewQueryUserPagePcLogic(ctx context.Context, svcCtx *svc.ServiceContext) *QueryUserPagePcLogic { + return &QueryUserPagePcLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +// C端用户分页查询 +func (l *QueryUserPagePcLogic) QueryUserPagePc(in *app.PageUserRequest) (*app.PageUserResponse, error) { + // todo: add your logic here and delete this line + + return &app.PageUserResponse{}, nil +} diff --git a/rpc/internal/logic/user/update_user_pc_avatar_logic.go b/rpc/internal/logic/user/update_user_pc_avatar_logic.go new file mode 100644 index 0000000..21d613a --- /dev/null +++ b/rpc/internal/logic/user/update_user_pc_avatar_logic.go @@ -0,0 +1,31 @@ +package user + +import ( + "context" + + "mingyang-admin-app-rpc/internal/svc" + "mingyang-admin-app-rpc/types/app" + + "github.com/zeromicro/go-zero/core/logx" +) + +type UpdateUserPcAvatarLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewUpdateUserPcAvatarLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateUserPcAvatarLogic { + return &UpdateUserPcAvatarLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +// C端用户修改头像 +func (l *UpdateUserPcAvatarLogic) UpdateUserPcAvatar(in *app.UpdateUserAvatarReq) (*app.BaseResp, error) { + // todo: add your logic here and delete this line + + return &app.BaseResp{}, nil +} diff --git a/rpc/internal/logic/user/update_user_pc_info_logic.go b/rpc/internal/logic/user/update_user_pc_info_logic.go new file mode 100644 index 0000000..422e504 --- /dev/null +++ b/rpc/internal/logic/user/update_user_pc_info_logic.go @@ -0,0 +1,31 @@ +package user + +import ( + "context" + + "mingyang-admin-app-rpc/internal/svc" + "mingyang-admin-app-rpc/types/app" + + "github.com/zeromicro/go-zero/core/logx" +) + +type UpdateUserPcInfoLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewUpdateUserPcInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateUserPcInfoLogic { + return &UpdateUserPcInfoLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +// C端用户修改信息 +func (l *UpdateUserPcInfoLogic) UpdateUserPcInfo(in *app.UserInfo) (*app.BaseResp, error) { + // todo: add your logic here and delete this line + + return &app.BaseResp{}, nil +} diff --git a/rpc/internal/logic/user/update_user_pc_password_logic.go b/rpc/internal/logic/user/update_user_pc_password_logic.go new file mode 100644 index 0000000..c6c526a --- /dev/null +++ b/rpc/internal/logic/user/update_user_pc_password_logic.go @@ -0,0 +1,31 @@ +package user + +import ( + "context" + + "mingyang-admin-app-rpc/internal/svc" + "mingyang-admin-app-rpc/types/app" + + "github.com/zeromicro/go-zero/core/logx" +) + +type UpdateUserPcPasswordLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewUpdateUserPcPasswordLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateUserPcPasswordLogic { + return &UpdateUserPcPasswordLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +// C端用户修改密码 +func (l *UpdateUserPcPasswordLogic) UpdateUserPcPassword(in *app.UpdateUserPcPasswordReq) (*app.BaseResp, error) { + // todo: add your logic here and delete this line + + return &app.BaseResp{}, nil +} diff --git a/rpc/internal/logic/user/update_user_pc_status_logic.go b/rpc/internal/logic/user/update_user_pc_status_logic.go new file mode 100644 index 0000000..afe85d0 --- /dev/null +++ b/rpc/internal/logic/user/update_user_pc_status_logic.go @@ -0,0 +1,31 @@ +package user + +import ( + "context" + + "mingyang-admin-app-rpc/internal/svc" + "mingyang-admin-app-rpc/types/app" + + "github.com/zeromicro/go-zero/core/logx" +) + +type UpdateUserPcStatusLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewUpdateUserPcStatusLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateUserPcStatusLogic { + return &UpdateUserPcStatusLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +// C端用户修改状态 +func (l *UpdateUserPcStatusLogic) UpdateUserPcStatus(in *app.IDReq) (*app.BaseResp, error) { + // todo: add your logic here and delete this line + + return &app.BaseResp{}, nil +} diff --git a/rpc/internal/server/app_server.go b/rpc/internal/server/app_server.go index a3231f2..e277ae8 100644 --- a/rpc/internal/server/app_server.go +++ b/rpc/internal/server/app_server.go @@ -65,3 +65,45 @@ func (s *AppServer) InitDatabase(ctx context.Context, in *app.Empty) (*app.BaseR 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) +} diff --git a/rpc/types/app/app.pb.go b/rpc/types/app/app.pb.go index 428598c..1e1f648 100644 --- a/rpc/types/app/app.pb.go +++ b/rpc/types/app/app.pb.go @@ -1478,6 +1478,78 @@ func (x *UUIDsReq) GetIds() []string { return nil } +type UpdateUserAvatarReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateUserAvatarReq) Reset() { + *x = UpdateUserAvatarReq{} + mi := &file_app_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateUserAvatarReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateUserAvatarReq) ProtoMessage() {} + +func (x *UpdateUserAvatarReq) ProtoReflect() protoreflect.Message { + mi := &file_app_proto_msgTypes[23] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateUserAvatarReq.ProtoReflect.Descriptor instead. +func (*UpdateUserAvatarReq) Descriptor() ([]byte, []int) { + return file_app_proto_rawDescGZIP(), []int{23} +} + +type UpdateUserPcPasswordReq struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *UpdateUserPcPasswordReq) Reset() { + *x = UpdateUserPcPasswordReq{} + mi := &file_app_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *UpdateUserPcPasswordReq) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateUserPcPasswordReq) ProtoMessage() {} + +func (x *UpdateUserPcPasswordReq) ProtoReflect() protoreflect.Message { + mi := &file_app_proto_msgTypes[24] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateUserPcPasswordReq.ProtoReflect.Descriptor instead. +func (*UpdateUserPcPasswordReq) Descriptor() ([]byte, []int) { + return file_app_proto_rawDescGZIP(), []int{24} +} + type UserInfo struct { state protoimpl.MessageState `protogen:"open.v1"` Id *uint64 `protobuf:"varint,1,opt,name=id,proto3,oneof" json:"id"` @@ -1508,7 +1580,7 @@ type UserInfo struct { func (x *UserInfo) Reset() { *x = UserInfo{} - mi := &file_app_proto_msgTypes[23] + mi := &file_app_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1520,7 +1592,7 @@ func (x *UserInfo) String() string { func (*UserInfo) ProtoMessage() {} func (x *UserInfo) ProtoReflect() protoreflect.Message { - mi := &file_app_proto_msgTypes[23] + mi := &file_app_proto_msgTypes[25] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1533,7 +1605,7 @@ func (x *UserInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use UserInfo.ProtoReflect.Descriptor instead. func (*UserInfo) Descriptor() ([]byte, []int) { - return file_app_proto_rawDescGZIP(), []int{23} + return file_app_proto_rawDescGZIP(), []int{25} } func (x *UserInfo) GetId() uint64 { @@ -1700,7 +1772,7 @@ type UserToken struct { func (x *UserToken) Reset() { *x = UserToken{} - mi := &file_app_proto_msgTypes[24] + mi := &file_app_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1712,7 +1784,7 @@ func (x *UserToken) String() string { func (*UserToken) ProtoMessage() {} func (x *UserToken) ProtoReflect() protoreflect.Message { - mi := &file_app_proto_msgTypes[24] + mi := &file_app_proto_msgTypes[26] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1725,7 +1797,7 @@ func (x *UserToken) ProtoReflect() protoreflect.Message { // Deprecated: Use UserToken.ProtoReflect.Descriptor instead. func (*UserToken) Descriptor() ([]byte, []int) { - return file_app_proto_rawDescGZIP(), []int{24} + return file_app_proto_rawDescGZIP(), []int{26} } func (x *UserToken) GetAccessToken() string { @@ -1753,7 +1825,7 @@ type VerifyCodeReq struct { func (x *VerifyCodeReq) Reset() { *x = VerifyCodeReq{} - mi := &file_app_proto_msgTypes[25] + mi := &file_app_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1765,7 +1837,7 @@ func (x *VerifyCodeReq) String() string { func (*VerifyCodeReq) ProtoMessage() {} func (x *VerifyCodeReq) ProtoReflect() protoreflect.Message { - mi := &file_app_proto_msgTypes[25] + mi := &file_app_proto_msgTypes[27] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1778,7 +1850,7 @@ func (x *VerifyCodeReq) ProtoReflect() protoreflect.Message { // Deprecated: Use VerifyCodeReq.ProtoReflect.Descriptor instead. func (*VerifyCodeReq) Descriptor() ([]byte, []int) { - return file_app_proto_rawDescGZIP(), []int{25} + return file_app_proto_rawDescGZIP(), []int{27} } func (x *VerifyCodeReq) GetType() VerifyCodeType { @@ -1812,7 +1884,7 @@ type VerifyCodeResp struct { func (x *VerifyCodeResp) Reset() { *x = VerifyCodeResp{} - mi := &file_app_proto_msgTypes[26] + mi := &file_app_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1824,7 +1896,7 @@ func (x *VerifyCodeResp) String() string { func (*VerifyCodeResp) ProtoMessage() {} func (x *VerifyCodeResp) ProtoReflect() protoreflect.Message { - mi := &file_app_proto_msgTypes[26] + mi := &file_app_proto_msgTypes[28] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1837,7 +1909,7 @@ func (x *VerifyCodeResp) ProtoReflect() protoreflect.Message { // Deprecated: Use VerifyCodeResp.ProtoReflect.Descriptor instead. func (*VerifyCodeResp) Descriptor() ([]byte, []int) { - return file_app_proto_rawDescGZIP(), []int{26} + return file_app_proto_rawDescGZIP(), []int{28} } func (x *VerifyCodeResp) GetCaptchaCode() string { @@ -1971,7 +2043,9 @@ const file_app_proto_rawDesc = "" + "\aUUIDReq\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\"\x1c\n" + "\bUUIDsReq\x12\x10\n" + - "\x03ids\x18\x01 \x03(\tR\x03ids\"\x91\t\n" + + "\x03ids\x18\x01 \x03(\tR\x03ids\"\x15\n" + + "\x13UpdateUserAvatarReq\"\x19\n" + + "\x17UpdateUserPcPasswordReq\"\x91\t\n" + "\bUserInfo\x12\x13\n" + "\x02id\x18\x01 \x01(\x04H\x00R\x02id\x88\x01\x01\x12\x1f\n" + "\busername\x18\x02 \x01(\tH\x01R\busername\x88\x01\x01\x12\x19\n" + @@ -2048,7 +2122,7 @@ const file_app_proto_rawDesc = "" + "\fUPDATE_PHONE\x10\x05\x12\x10\n" + "\fUPDATE_EMAIL\x10\x06\x12\f\n" + "\bWITHDRAW\x10\a\x12\x17\n" + - "\x13CHANGE_PAY_PASSWORD\x10\b2\x81\x03\n" + + "\x13CHANGE_PAY_PASSWORD\x10\b2\xfc\x05\n" + "\x03App\x12,\n" + "\tAuthToken\x12\f.app.AuthReq\x1a\x11.app.AuthInfoResp\x128\n" + "\rGetVerifyCode\x12\x12.app.VerifyCodeReq\x1a\x13.app.VerifyCodeResp\x12C\n" + @@ -2058,7 +2132,17 @@ const file_app_proto_rawDesc = "" + "\n" + "LogoutUser\x12\x0e.app.UserToken\x1a\x16.app.LogoutUserRequest\x12)\n" + "\fInitDatabase\x12\n" + - ".app.Empty\x1a\r.app.BaseRespB\aZ\x05./appb\x06proto3" + ".app.Empty\x1a\r.app.BaseResp\x12>\n" + + "\x0fqueryUserPagePc\x12\x14.app.PageUserRequest\x1a\x15.app.PageUserResponse\x12&\n" + + "\tgetUserPc\x12\n" + + ".app.IDReq\x1a\r.app.UserInfo\x12*\n" + + "\rforceLogoutPc\x12\n" + + ".app.IDReq\x1a\r.app.BaseResp\x12C\n" + + "\x14updateUserPcPassword\x12\x1c.app.UpdateUserPcPasswordReq\x1a\r.app.BaseResp\x120\n" + + "\x10updateUserPcInfo\x12\r.app.UserInfo\x1a\r.app.BaseResp\x12=\n" + + "\x12updateUserPcAvatar\x12\x18.app.UpdateUserAvatarReq\x1a\r.app.BaseResp\x12/\n" + + "\x12updateUserPcStatus\x12\n" + + ".app.IDReq\x1a\r.app.BaseRespB\aZ\x05./appb\x06proto3" var ( file_app_proto_rawDescOnce sync.Once @@ -2073,74 +2157,90 @@ func file_app_proto_rawDescGZIP() []byte { } var file_app_proto_enumTypes = make([]protoimpl.EnumInfo, 2) -var file_app_proto_msgTypes = make([]protoimpl.MessageInfo, 27) +var file_app_proto_msgTypes = make([]protoimpl.MessageInfo, 29) var file_app_proto_goTypes = []any{ - (AccountType)(0), // 0: app.AccountType - (VerifyCodeType)(0), // 1: app.VerifyCodeType - (*AuthInfoResp)(nil), // 2: app.AuthInfoResp - (*AuthReq)(nil), // 3: app.AuthReq - (*AuthToken)(nil), // 4: app.AuthToken - (*BaseIDResp)(nil), // 5: app.BaseIDResp - (*BaseMsg)(nil), // 6: app.BaseMsg - (*BaseResp)(nil), // 7: app.BaseResp - (*BaseUUIDResp)(nil), // 8: app.BaseUUIDResp - (*ClaimStrings)(nil), // 9: app.ClaimStrings - (*Empty)(nil), // 10: app.Empty - (*IDReq)(nil), // 11: app.IDReq - (*IDsReq)(nil), // 12: app.IDsReq - (*LoginRequest)(nil), // 13: app.LoginRequest - (*LoginResponse)(nil), // 14: app.LoginResponse - (*LogoutUserRequest)(nil), // 15: app.LogoutUserRequest - (*NumericDate)(nil), // 16: app.NumericDate - (*PageInfoReq)(nil), // 17: app.PageInfoReq - (*PageUserRequest)(nil), // 18: app.PageUserRequest - (*PageUserResponse)(nil), // 19: app.PageUserResponse - (*RegisterUserRequest)(nil), // 20: app.RegisterUserRequest - (*RegisterUserResponse)(nil), // 21: app.RegisterUserResponse - (*RegisteredClaims)(nil), // 22: app.RegisteredClaims - (*UUIDReq)(nil), // 23: app.UUIDReq - (*UUIDsReq)(nil), // 24: app.UUIDsReq - (*UserInfo)(nil), // 25: app.UserInfo - (*UserToken)(nil), // 26: app.UserToken - (*VerifyCodeReq)(nil), // 27: app.VerifyCodeReq - (*VerifyCodeResp)(nil), // 28: app.VerifyCodeResp - (*timestamppb.Timestamp)(nil), // 29: google.protobuf.Timestamp - (*structpb.Struct)(nil), // 30: google.protobuf.Struct + (AccountType)(0), // 0: app.AccountType + (VerifyCodeType)(0), // 1: app.VerifyCodeType + (*AuthInfoResp)(nil), // 2: app.AuthInfoResp + (*AuthReq)(nil), // 3: app.AuthReq + (*AuthToken)(nil), // 4: app.AuthToken + (*BaseIDResp)(nil), // 5: app.BaseIDResp + (*BaseMsg)(nil), // 6: app.BaseMsg + (*BaseResp)(nil), // 7: app.BaseResp + (*BaseUUIDResp)(nil), // 8: app.BaseUUIDResp + (*ClaimStrings)(nil), // 9: app.ClaimStrings + (*Empty)(nil), // 10: app.Empty + (*IDReq)(nil), // 11: app.IDReq + (*IDsReq)(nil), // 12: app.IDsReq + (*LoginRequest)(nil), // 13: app.LoginRequest + (*LoginResponse)(nil), // 14: app.LoginResponse + (*LogoutUserRequest)(nil), // 15: app.LogoutUserRequest + (*NumericDate)(nil), // 16: app.NumericDate + (*PageInfoReq)(nil), // 17: app.PageInfoReq + (*PageUserRequest)(nil), // 18: app.PageUserRequest + (*PageUserResponse)(nil), // 19: app.PageUserResponse + (*RegisterUserRequest)(nil), // 20: app.RegisterUserRequest + (*RegisterUserResponse)(nil), // 21: app.RegisterUserResponse + (*RegisteredClaims)(nil), // 22: app.RegisteredClaims + (*UUIDReq)(nil), // 23: app.UUIDReq + (*UUIDsReq)(nil), // 24: app.UUIDsReq + (*UpdateUserAvatarReq)(nil), // 25: app.UpdateUserAvatarReq + (*UpdateUserPcPasswordReq)(nil), // 26: app.UpdateUserPcPasswordReq + (*UserInfo)(nil), // 27: app.UserInfo + (*UserToken)(nil), // 28: app.UserToken + (*VerifyCodeReq)(nil), // 29: app.VerifyCodeReq + (*VerifyCodeResp)(nil), // 30: app.VerifyCodeResp + (*timestamppb.Timestamp)(nil), // 31: google.protobuf.Timestamp + (*structpb.Struct)(nil), // 32: google.protobuf.Struct } var file_app_proto_depIdxs = []int32{ 22, // 0: app.AuthInfoResp.claims:type_name -> app.RegisteredClaims - 29, // 1: app.AuthReq.time:type_name -> google.protobuf.Timestamp - 29, // 2: app.AuthToken.access_token_expires:type_name -> google.protobuf.Timestamp - 29, // 3: app.AuthToken.refresh_token_expires:type_name -> google.protobuf.Timestamp - 25, // 4: app.LoginResponse.user:type_name -> app.UserInfo + 31, // 1: app.AuthReq.time:type_name -> google.protobuf.Timestamp + 31, // 2: app.AuthToken.access_token_expires:type_name -> google.protobuf.Timestamp + 31, // 3: app.AuthToken.refresh_token_expires:type_name -> google.protobuf.Timestamp + 27, // 4: app.LoginResponse.user:type_name -> app.UserInfo 4, // 5: app.LoginResponse.auth_token:type_name -> app.AuthToken - 29, // 6: app.NumericDate.timestamp:type_name -> google.protobuf.Timestamp - 25, // 7: app.PageUserResponse.data:type_name -> app.UserInfo - 25, // 8: app.RegisterUserResponse.user:type_name -> app.UserInfo + 31, // 6: app.NumericDate.timestamp:type_name -> google.protobuf.Timestamp + 27, // 7: app.PageUserResponse.data:type_name -> app.UserInfo + 27, // 8: app.RegisterUserResponse.user:type_name -> app.UserInfo 4, // 9: app.RegisterUserResponse.auth_token:type_name -> app.AuthToken 9, // 10: app.RegisteredClaims.audience:type_name -> app.ClaimStrings 16, // 11: app.RegisteredClaims.expires_at:type_name -> app.NumericDate 16, // 12: app.RegisteredClaims.not_before:type_name -> app.NumericDate 16, // 13: app.RegisteredClaims.issued_at:type_name -> app.NumericDate - 30, // 14: app.UserInfo.metadata:type_name -> google.protobuf.Struct + 32, // 14: app.UserInfo.metadata:type_name -> google.protobuf.Struct 1, // 15: app.VerifyCodeReq.type:type_name -> app.VerifyCodeType 0, // 16: app.VerifyCodeReq.account_type:type_name -> app.AccountType 3, // 17: app.App.AuthToken:input_type -> app.AuthReq - 27, // 18: app.App.GetVerifyCode:input_type -> app.VerifyCodeReq + 29, // 18: app.App.GetVerifyCode:input_type -> app.VerifyCodeReq 20, // 19: app.App.RegisterUser:input_type -> app.RegisterUserRequest 13, // 20: app.App.LoginUser:input_type -> app.LoginRequest 18, // 21: app.App.ListUsers:input_type -> app.PageUserRequest - 26, // 22: app.App.LogoutUser:input_type -> app.UserToken + 28, // 22: app.App.LogoutUser:input_type -> app.UserToken 10, // 23: app.App.InitDatabase:input_type -> app.Empty - 2, // 24: app.App.AuthToken:output_type -> app.AuthInfoResp - 28, // 25: app.App.GetVerifyCode:output_type -> app.VerifyCodeResp - 21, // 26: app.App.RegisterUser:output_type -> app.RegisterUserResponse - 14, // 27: app.App.LoginUser:output_type -> app.LoginResponse - 19, // 28: app.App.ListUsers:output_type -> app.PageUserResponse - 15, // 29: app.App.LogoutUser:output_type -> app.LogoutUserRequest - 7, // 30: app.App.InitDatabase:output_type -> app.BaseResp - 24, // [24:31] is the sub-list for method output_type - 17, // [17:24] is the sub-list for method input_type + 18, // 24: app.App.queryUserPagePc:input_type -> app.PageUserRequest + 11, // 25: app.App.getUserPc:input_type -> app.IDReq + 11, // 26: app.App.forceLogoutPc:input_type -> app.IDReq + 26, // 27: app.App.updateUserPcPassword:input_type -> app.UpdateUserPcPasswordReq + 27, // 28: app.App.updateUserPcInfo:input_type -> app.UserInfo + 25, // 29: app.App.updateUserPcAvatar:input_type -> app.UpdateUserAvatarReq + 11, // 30: app.App.updateUserPcStatus:input_type -> app.IDReq + 2, // 31: app.App.AuthToken:output_type -> app.AuthInfoResp + 30, // 32: app.App.GetVerifyCode:output_type -> app.VerifyCodeResp + 21, // 33: app.App.RegisterUser:output_type -> app.RegisterUserResponse + 14, // 34: app.App.LoginUser:output_type -> app.LoginResponse + 19, // 35: app.App.ListUsers:output_type -> app.PageUserResponse + 15, // 36: app.App.LogoutUser:output_type -> app.LogoutUserRequest + 7, // 37: app.App.InitDatabase:output_type -> app.BaseResp + 19, // 38: app.App.queryUserPagePc:output_type -> app.PageUserResponse + 27, // 39: app.App.getUserPc:output_type -> app.UserInfo + 7, // 40: app.App.forceLogoutPc:output_type -> app.BaseResp + 7, // 41: app.App.updateUserPcPassword:output_type -> app.BaseResp + 7, // 42: app.App.updateUserPcInfo:output_type -> app.BaseResp + 7, // 43: app.App.updateUserPcAvatar:output_type -> app.BaseResp + 7, // 44: app.App.updateUserPcStatus:output_type -> app.BaseResp + 31, // [31:45] is the sub-list for method output_type + 17, // [17:31] is the sub-list for method input_type 17, // [17:17] is the sub-list for extension type_name 17, // [17:17] is the sub-list for extension extendee 0, // [0:17] is the sub-list for field type_name @@ -2154,14 +2254,14 @@ func file_app_proto_init() { file_app_proto_msgTypes[11].OneofWrappers = []any{} file_app_proto_msgTypes[16].OneofWrappers = []any{} file_app_proto_msgTypes[18].OneofWrappers = []any{} - file_app_proto_msgTypes[23].OneofWrappers = []any{} + file_app_proto_msgTypes[25].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_app_proto_rawDesc), len(file_app_proto_rawDesc)), NumEnums: 2, - NumMessages: 27, + NumMessages: 29, NumExtensions: 0, NumServices: 1, }, diff --git a/rpc/types/app/app_grpc.pb.go b/rpc/types/app/app_grpc.pb.go index c889048..46d19f2 100644 --- a/rpc/types/app/app_grpc.pb.go +++ b/rpc/types/app/app_grpc.pb.go @@ -19,13 +19,20 @@ import ( const _ = grpc.SupportPackageIsVersion9 const ( - App_AuthToken_FullMethodName = "/app.App/AuthToken" - App_GetVerifyCode_FullMethodName = "/app.App/GetVerifyCode" - App_RegisterUser_FullMethodName = "/app.App/RegisterUser" - App_LoginUser_FullMethodName = "/app.App/LoginUser" - App_ListUsers_FullMethodName = "/app.App/ListUsers" - App_LogoutUser_FullMethodName = "/app.App/LogoutUser" - App_InitDatabase_FullMethodName = "/app.App/InitDatabase" + App_AuthToken_FullMethodName = "/app.App/AuthToken" + App_GetVerifyCode_FullMethodName = "/app.App/GetVerifyCode" + App_RegisterUser_FullMethodName = "/app.App/RegisterUser" + App_LoginUser_FullMethodName = "/app.App/LoginUser" + App_ListUsers_FullMethodName = "/app.App/ListUsers" + App_LogoutUser_FullMethodName = "/app.App/LogoutUser" + App_InitDatabase_FullMethodName = "/app.App/InitDatabase" + App_QueryUserPagePc_FullMethodName = "/app.App/queryUserPagePc" + App_GetUserPc_FullMethodName = "/app.App/getUserPc" + App_ForceLogoutPc_FullMethodName = "/app.App/forceLogoutPc" + App_UpdateUserPcPassword_FullMethodName = "/app.App/updateUserPcPassword" + App_UpdateUserPcInfo_FullMethodName = "/app.App/updateUserPcInfo" + App_UpdateUserPcAvatar_FullMethodName = "/app.App/updateUserPcAvatar" + App_UpdateUserPcStatus_FullMethodName = "/app.App/updateUserPcStatus" ) // AppClient is the client API for App service. @@ -54,6 +61,27 @@ type AppClient interface { LogoutUser(ctx context.Context, in *UserToken, opts ...grpc.CallOption) (*LogoutUserRequest, error) // group: base InitDatabase(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*BaseResp, error) + // C端用户分页查询 + // group: user + QueryUserPagePc(ctx context.Context, in *PageUserRequest, opts ...grpc.CallOption) (*PageUserResponse, error) + // C端用户详情 + // group: user + GetUserPc(ctx context.Context, in *IDReq, opts ...grpc.CallOption) (*UserInfo, error) + // C端用户强制登出 + // group: user + ForceLogoutPc(ctx context.Context, in *IDReq, opts ...grpc.CallOption) (*BaseResp, error) + // C端用户修改密码 + // group: user + UpdateUserPcPassword(ctx context.Context, in *UpdateUserPcPasswordReq, opts ...grpc.CallOption) (*BaseResp, error) + // C端用户修改信息 + // group: user + UpdateUserPcInfo(ctx context.Context, in *UserInfo, opts ...grpc.CallOption) (*BaseResp, error) + // C端用户修改头像 + // group: user + UpdateUserPcAvatar(ctx context.Context, in *UpdateUserAvatarReq, opts ...grpc.CallOption) (*BaseResp, error) + // C端用户修改状态 + // group: user + UpdateUserPcStatus(ctx context.Context, in *IDReq, opts ...grpc.CallOption) (*BaseResp, error) } type appClient struct { @@ -134,6 +162,76 @@ func (c *appClient) InitDatabase(ctx context.Context, in *Empty, opts ...grpc.Ca return out, nil } +func (c *appClient) QueryUserPagePc(ctx context.Context, in *PageUserRequest, opts ...grpc.CallOption) (*PageUserResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(PageUserResponse) + err := c.cc.Invoke(ctx, App_QueryUserPagePc_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *appClient) GetUserPc(ctx context.Context, in *IDReq, opts ...grpc.CallOption) (*UserInfo, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(UserInfo) + err := c.cc.Invoke(ctx, App_GetUserPc_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *appClient) ForceLogoutPc(ctx context.Context, in *IDReq, opts ...grpc.CallOption) (*BaseResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(BaseResp) + err := c.cc.Invoke(ctx, App_ForceLogoutPc_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *appClient) UpdateUserPcPassword(ctx context.Context, in *UpdateUserPcPasswordReq, opts ...grpc.CallOption) (*BaseResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(BaseResp) + err := c.cc.Invoke(ctx, App_UpdateUserPcPassword_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *appClient) UpdateUserPcInfo(ctx context.Context, in *UserInfo, opts ...grpc.CallOption) (*BaseResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(BaseResp) + err := c.cc.Invoke(ctx, App_UpdateUserPcInfo_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *appClient) UpdateUserPcAvatar(ctx context.Context, in *UpdateUserAvatarReq, opts ...grpc.CallOption) (*BaseResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(BaseResp) + err := c.cc.Invoke(ctx, App_UpdateUserPcAvatar_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *appClient) UpdateUserPcStatus(ctx context.Context, in *IDReq, opts ...grpc.CallOption) (*BaseResp, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(BaseResp) + err := c.cc.Invoke(ctx, App_UpdateUserPcStatus_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + // AppServer is the server API for App service. // All implementations must embed UnimplementedAppServer // for forward compatibility. @@ -160,6 +258,27 @@ type AppServer interface { LogoutUser(context.Context, *UserToken) (*LogoutUserRequest, error) // group: base InitDatabase(context.Context, *Empty) (*BaseResp, error) + // C端用户分页查询 + // group: user + QueryUserPagePc(context.Context, *PageUserRequest) (*PageUserResponse, error) + // C端用户详情 + // group: user + GetUserPc(context.Context, *IDReq) (*UserInfo, error) + // C端用户强制登出 + // group: user + ForceLogoutPc(context.Context, *IDReq) (*BaseResp, error) + // C端用户修改密码 + // group: user + UpdateUserPcPassword(context.Context, *UpdateUserPcPasswordReq) (*BaseResp, error) + // C端用户修改信息 + // group: user + UpdateUserPcInfo(context.Context, *UserInfo) (*BaseResp, error) + // C端用户修改头像 + // group: user + UpdateUserPcAvatar(context.Context, *UpdateUserAvatarReq) (*BaseResp, error) + // C端用户修改状态 + // group: user + UpdateUserPcStatus(context.Context, *IDReq) (*BaseResp, error) mustEmbedUnimplementedAppServer() } @@ -191,6 +310,27 @@ func (UnimplementedAppServer) LogoutUser(context.Context, *UserToken) (*LogoutUs func (UnimplementedAppServer) InitDatabase(context.Context, *Empty) (*BaseResp, error) { return nil, status.Errorf(codes.Unimplemented, "method InitDatabase not implemented") } +func (UnimplementedAppServer) QueryUserPagePc(context.Context, *PageUserRequest) (*PageUserResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryUserPagePc not implemented") +} +func (UnimplementedAppServer) GetUserPc(context.Context, *IDReq) (*UserInfo, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetUserPc not implemented") +} +func (UnimplementedAppServer) ForceLogoutPc(context.Context, *IDReq) (*BaseResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method ForceLogoutPc not implemented") +} +func (UnimplementedAppServer) UpdateUserPcPassword(context.Context, *UpdateUserPcPasswordReq) (*BaseResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateUserPcPassword not implemented") +} +func (UnimplementedAppServer) UpdateUserPcInfo(context.Context, *UserInfo) (*BaseResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateUserPcInfo not implemented") +} +func (UnimplementedAppServer) UpdateUserPcAvatar(context.Context, *UpdateUserAvatarReq) (*BaseResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateUserPcAvatar not implemented") +} +func (UnimplementedAppServer) UpdateUserPcStatus(context.Context, *IDReq) (*BaseResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateUserPcStatus not implemented") +} func (UnimplementedAppServer) mustEmbedUnimplementedAppServer() {} func (UnimplementedAppServer) testEmbeddedByValue() {} @@ -338,6 +478,132 @@ func _App_InitDatabase_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _App_QueryUserPagePc_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PageUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AppServer).QueryUserPagePc(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: App_QueryUserPagePc_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AppServer).QueryUserPagePc(ctx, req.(*PageUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _App_GetUserPc_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IDReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AppServer).GetUserPc(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: App_GetUserPc_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AppServer).GetUserPc(ctx, req.(*IDReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _App_ForceLogoutPc_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IDReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AppServer).ForceLogoutPc(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: App_ForceLogoutPc_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AppServer).ForceLogoutPc(ctx, req.(*IDReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _App_UpdateUserPcPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateUserPcPasswordReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AppServer).UpdateUserPcPassword(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: App_UpdateUserPcPassword_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AppServer).UpdateUserPcPassword(ctx, req.(*UpdateUserPcPasswordReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _App_UpdateUserPcInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UserInfo) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AppServer).UpdateUserPcInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: App_UpdateUserPcInfo_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AppServer).UpdateUserPcInfo(ctx, req.(*UserInfo)) + } + return interceptor(ctx, in, info, handler) +} + +func _App_UpdateUserPcAvatar_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateUserAvatarReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AppServer).UpdateUserPcAvatar(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: App_UpdateUserPcAvatar_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AppServer).UpdateUserPcAvatar(ctx, req.(*UpdateUserAvatarReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _App_UpdateUserPcStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(IDReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AppServer).UpdateUserPcStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: App_UpdateUserPcStatus_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AppServer).UpdateUserPcStatus(ctx, req.(*IDReq)) + } + return interceptor(ctx, in, info, handler) +} + // App_ServiceDesc is the grpc.ServiceDesc for App service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -373,6 +639,34 @@ var App_ServiceDesc = grpc.ServiceDesc{ MethodName: "InitDatabase", Handler: _App_InitDatabase_Handler, }, + { + MethodName: "queryUserPagePc", + Handler: _App_QueryUserPagePc_Handler, + }, + { + MethodName: "getUserPc", + Handler: _App_GetUserPc_Handler, + }, + { + MethodName: "forceLogoutPc", + Handler: _App_ForceLogoutPc_Handler, + }, + { + MethodName: "updateUserPcPassword", + Handler: _App_UpdateUserPcPassword_Handler, + }, + { + MethodName: "updateUserPcInfo", + Handler: _App_UpdateUserPcInfo_Handler, + }, + { + MethodName: "updateUserPcAvatar", + Handler: _App_UpdateUserPcAvatar_Handler, + }, + { + MethodName: "updateUserPcStatus", + Handler: _App_UpdateUserPcStatus_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "app.proto",