Files
EdgeCommon/pkg/rpc/protos/service_plan.proto
2024-01-13 19:32:41 +08:00

157 lines
4.8 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_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 findBasicPlan(FindBasicPlanRequest) returns (FindBasicPlanResponse);
// 计算套餐数量
rpc countAllEnabledPlans(CountAllEnabledPlansRequest) returns (RPCCountResponse);
// 列出单页套餐
rpc listEnabledPlans(ListEnabledPlansRequest) returns (ListEnabledPlansResponse);
// 列出所有可用的套餐
rpc findAllAvailablePlans(FindAllAvailablePlansRequest) returns (FindAllAvailablePlansResponse);
// 列出所有可用的套餐的基本信息
rpc findAllAvailableBasicPlans(FindAllAvailableBasicPlansRequest) returns (FindAllAvailableBasicPlansResponse);
// 对套餐进行排序
rpc sortPlans(SortPlansRequest) returns (RPCSuccess);
}
// 创建套餐
message CreatePlanRequest {
string name = 1; // 套餐名称
string description = 19; // 套餐简介
int64 clusterId = 2; // 集群ID
bytes trafficLimitJSON = 3; // 流量限制
bytes bandwidthLimitPerNodeJSON = 20; // 单节点带宽限制 @link json:bit_size_capacity
bool hasFullFeatures = 18; // 是否有所有权限
bytes featuresJSON = 4; // 权限列表,[code1, code2, ...]
string priceType = 5; // 价格类型traffic, bandwidth, period
bytes trafficPriceJSON = 6; // 流量价格配置
bytes bandwidthPriceJSON = 10; // 带宽价格配置
float monthlyPrice = 7; // 月度价格
float seasonallyPrice = 8; // 季度价格
float yearlyPrice = 9; // 年度价格
int32 totalServers = 11; // 可以添加的网站数
int32 totalServerNamesPerServer = 12; // 每个网站可以添加的域名数
int32 totalServerNames = 13; // 可以添加的域名总数
int64 dailyRequests = 14; // 每日访问量额度
int64 monthlyRequests = 15; // 每月访问量额度
int64 dailyWebsocketConnections = 16; // 每日Websocket连接数额度
int64 monthlyWebsocketConnections = 17; // 每月Websocket连接数额度
bytes maxUploadSizeJSON = 21; // 文件最大上传尺寸 @link json:size_capacity
}
message CreatePlanResponse {
int64 planId = 1;
}
// 修改套餐
message UpdatePlanRequest {
int64 planId = 1; // 套餐ID
string name = 2; // 套餐名称
string description = 21; // 套餐简介
bool isOn = 3; // 是否启用
int64 clusterId = 4; // 集群ID
bytes trafficLimitJSON = 5; // 流量限制
bytes bandwidthLimitPerNodeJSON = 22; // 单节点带宽限制
bool hasFullFeatures = 20; // 是否有所有权限
bytes featuresJSON = 6; // 权限列表,[code1, code2, ...]
string priceType = 7; // 价格类型traffic, bandwidth, period
bytes trafficPriceJSON = 8; // 流量价格配置
bytes bandwidthPriceJSON = 12; // 带宽价格配置
float monthlyPrice = 9; // 月费用
float seasonallyPrice = 10; // 季度费用
float yearlyPrice = 11; // 年度费用
int32 totalServers = 13; // 可以添加的网站数
int32 totalServerNamesPerServer = 14; // 每个网站可以添加的域名数
int32 totalServerNames = 15; // 可以添加的域名总数
int64 dailyRequests = 16; // 每日访问量额度
int64 monthlyRequests = 17; // 每月访问量额度
int64 dailyWebsocketConnections = 18; // 每日Websocket连接数额度
int64 monthlyWebsocketConnections = 19; // 每月Websocket连接数额度
bytes maxUploadSizeJSON = 23; // 文件最大上传尺寸 @link json:size_capacity
}
// 删除套餐
message DeletePlanRequest {
int64 planId = 1; // 套餐ID
}
// 查找单个套餐
message FindEnabledPlanRequest {
int64 planId = 1; // 套餐ID
}
message FindEnabledPlanResponse {
Plan plan = 1; // 套餐信息
}
// 查找套餐基本信息
message FindBasicPlanRequest {
int64 planId = 1; // 套餐ID
}
message FindBasicPlanResponse {
Plan plan = 1; // 套餐信息(只读取基本信息)
}
// 计算套餐数量
message CountAllEnabledPlansRequest {
}
// 列出单页套餐
message ListEnabledPlansRequest {
int64 offset = 1;
int64 size = 2;
}
message ListEnabledPlansResponse {
repeated Plan plans = 1; // 套餐列表
}
// 列出所有可用的套餐
message FindAllAvailablePlansRequest {
}
message FindAllAvailablePlansResponse {
repeated Plan plans = 1; // 套餐列表
}
// 列出所有可用的套餐的基本信息
message FindAllAvailableBasicPlansRequest {
}
message FindAllAvailableBasicPlansResponse {
repeated Plan plans = 1; // 套餐列表
}
// 对套餐进行排序
message SortPlansRequest {
repeated int64 planIds = 1; // 排序后的套餐ID列表
}