Files
EdgeCommon/pkg/rpc/protos/service_user_account.proto
2023-11-24 09:06:36 +08:00

68 lines
1.9 KiB
Protocol Buffer
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_user_account.proto";
import "models/rpc_messages.proto";
// 用户账户服务
service UserAccountService {
// 计算账户数量
rpc countUserAccounts(CountUserAccountsRequest) returns (RPCCountResponse);
// 列出单页账户
rpc listUserAccounts(ListUserAccountsRequest) returns (ListUserAccountsResponse);
// 根据用户ID查找单个账户
rpc findEnabledUserAccountWithUserId(FindEnabledUserAccountWithUserIdRequest) returns (FindEnabledUserAccountWithUserIdResponse);
// 查找单个账户
rpc findEnabledUserAccount(FindEnabledUserAccountRequest) returns (FindEnabledUserAccountResponse);
// 修改用户账户
rpc updateUserAccount(UpdateUserAccountRequest) returns (RPCSuccess);
}
// 计算账户数量
message CountUserAccountsRequest {
string keyword = 1; // 关键词
}
// 列出单页账户
message ListUserAccountsRequest {
string keyword = 1; // 关键词
int64 offset = 2;
int64 size = 3;
}
message ListUserAccountsResponse {
repeated UserAccount userAccounts = 1; // 用户账户列表
}
// 根据用户ID查找单个账户
message FindEnabledUserAccountWithUserIdRequest {
int64 userId = 1; // 用户ID
}
message FindEnabledUserAccountWithUserIdResponse {
UserAccount userAccount = 1; // 用户账户
}
// 查找单个账户
message FindEnabledUserAccountRequest {
int64 userAccountId = 1; // 用户账户ID
}
message FindEnabledUserAccountResponse {
UserAccount userAccount = 1; // 用户账户
}
// 修改用户账户
message UpdateUserAccountRequest {
int64 userAccountId = 1; // 用户账户ID非用户ID
double delta = 2; // 操作的数值,正值表示增加,负值表示减少
string eventType = 3; // 事件类型charge, award, buyPlan, payBill, refund, withdraw, buyNSPlan, buyTrafficPackage, buyAntiDDoSPackage, renewAntiDDoSPackage
string description = 4; // 描述
bytes paramsJSON = 5; // 相关参数
}