2021-10-29 14:02:49 +08:00
|
|
|
syntax = "proto3";
|
|
|
|
|
option go_package = "./pb";
|
|
|
|
|
|
|
|
|
|
package pb;
|
|
|
|
|
|
|
|
|
|
import "models/model_plan.proto";
|
|
|
|
|
import "models/rpc_messages.proto";
|
|
|
|
|
|
|
|
|
|
// 套餐相关服务
|
|
|
|
|
service PlanService {
|
|
|
|
|
// 创建套餐
|
|
|
|
|
rpc createPlan(CreatePlanRequest) returns (CreatePlanResponse);
|
|
|
|
|
|
|
|
|
|
// 修改套餐
|
|
|
|
|
rpc updatePlan(UpdatePlanRequest) returns (RPCSuccess);
|
|
|
|
|
|
|
|
|
|
// 删除套餐
|
|
|
|
|
rpc deletePlan(DeletePlanRequest) returns (RPCSuccess);
|
|
|
|
|
|
|
|
|
|
// 查找单个套餐
|
|
|
|
|
rpc findEnabledPlan(FindEnabledPlanRequest) returns (FindEnabledPlanResponse);
|
|
|
|
|
|
|
|
|
|
// 计算套餐数量
|
|
|
|
|
rpc countAllEnabledPlans(CountAllEnabledPlansRequest) returns (RPCCountResponse);
|
|
|
|
|
|
|
|
|
|
// 列出单页套餐
|
|
|
|
|
rpc listEnabledPlans(ListEnabledPlansRequest) returns (ListEnabledPlansResponse);
|
|
|
|
|
|
|
|
|
|
// 对套餐进行排序
|
|
|
|
|
rpc sortPlans(SortPlansRequest) returns (RPCSuccess);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 创建套餐
|
|
|
|
|
message CreatePlanRequest {
|
|
|
|
|
string name = 1;
|
|
|
|
|
int64 clusterId = 2;
|
2021-11-09 17:36:34 +08:00
|
|
|
bytes trafficLimitJSON = 3;
|
2021-10-29 14:02:49 +08:00
|
|
|
bytes featuresJSON = 4;
|
|
|
|
|
string priceType = 5;
|
2021-11-09 17:36:34 +08:00
|
|
|
bytes trafficPriceJSON = 6;
|
2022-01-23 19:16:58 +08:00
|
|
|
bytes bandwidthPriceJSON = 10;
|
2023-12-19 14:57:03 +08:00
|
|
|
float monthlyPrice = 7; // 月度价格
|
|
|
|
|
float seasonallyPrice = 8; // 季度价格
|
|
|
|
|
float yearlyPrice = 9; // 年度价格
|
2023-09-06 16:31:14 +08:00
|
|
|
int32 totalServers = 11; // 可以添加的网站数
|
|
|
|
|
int32 totalServerNamesPerServer = 12; // 每个网站可以添加的域名数
|
|
|
|
|
int32 totalServerNames = 13; // 可以添加的域名总数
|
2023-09-07 11:46:20 +08:00
|
|
|
int64 dailyRequests = 14; // 每日访问量额度
|
|
|
|
|
int64 monthlyRequests = 15; // 每月访问量额度
|
2023-12-19 14:57:03 +08:00
|
|
|
int64 dailyWebsocketConnections = 16; // 每日Websocket连接数额度
|
|
|
|
|
int64 monthlyWebsocketConnections = 17; // 每月Websocket连接数额度
|
2021-10-29 14:02:49 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message CreatePlanResponse {
|
|
|
|
|
int64 planId = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 修改套餐
|
|
|
|
|
message UpdatePlanRequest {
|
|
|
|
|
int64 planId = 1;
|
|
|
|
|
string name = 2;
|
|
|
|
|
bool isOn = 3;
|
|
|
|
|
int64 clusterId = 4;
|
2021-11-09 17:36:34 +08:00
|
|
|
bytes trafficLimitJSON = 5;
|
2021-10-29 14:02:49 +08:00
|
|
|
bytes featuresJSON = 6;
|
|
|
|
|
string priceType = 7;
|
2021-11-09 17:36:34 +08:00
|
|
|
bytes trafficPriceJSON = 8;
|
2022-01-23 19:16:58 +08:00
|
|
|
bytes bandwidthPriceJSON = 12;
|
2021-10-29 14:02:49 +08:00
|
|
|
float monthlyPrice = 9;
|
|
|
|
|
float seasonallyPrice = 10;
|
|
|
|
|
float yearlyPrice = 11;
|
2023-09-06 16:31:14 +08:00
|
|
|
int32 totalServers = 13; // 可以添加的网站数
|
|
|
|
|
int32 totalServerNamesPerServer = 14; // 每个网站可以添加的域名数
|
|
|
|
|
int32 totalServerNames = 15; // 可以添加的域名总数
|
2023-09-07 11:46:20 +08:00
|
|
|
int64 dailyRequests = 16; // 每日访问量额度
|
|
|
|
|
int64 monthlyRequests = 17; // 每月访问量额度
|
2023-12-19 14:57:03 +08:00
|
|
|
int64 dailyWebsocketConnections = 18; // 每日Websocket连接数额度
|
|
|
|
|
int64 monthlyWebsocketConnections = 19; // 每月Websocket连接数额度
|
2021-10-29 14:02:49 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 删除套餐
|
|
|
|
|
message DeletePlanRequest {
|
|
|
|
|
int64 planId = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 查找单个套餐
|
|
|
|
|
message FindEnabledPlanRequest {
|
|
|
|
|
int64 planId = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message FindEnabledPlanResponse {
|
|
|
|
|
Plan plan = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 计算套餐数量
|
|
|
|
|
message CountAllEnabledPlansRequest {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 列出单页套餐
|
|
|
|
|
message ListEnabledPlansRequest {
|
|
|
|
|
int64 offset = 1;
|
|
|
|
|
int64 size = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message ListEnabledPlansResponse {
|
|
|
|
|
repeated Plan plans = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 对套餐进行排序
|
|
|
|
|
message SortPlansRequest {
|
|
|
|
|
repeated int64 planIds = 1;
|
|
|
|
|
}
|