mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-12-15 05:16:34 +08:00
优化代码
This commit is contained in:
@@ -12,4 +12,5 @@ message ServerBandwidthStat {
|
||||
string timeAt = 5;
|
||||
int64 bytes = 6;
|
||||
int64 bits = 7;
|
||||
int64 regionId = 8;
|
||||
}
|
||||
@@ -17,4 +17,7 @@ message UserBill {
|
||||
int64 paidAt = 9;
|
||||
string code = 10;
|
||||
bool canPay = 11;
|
||||
string dayFrom = 12;
|
||||
string dayTo = 13;
|
||||
string pricePeriod = 14;
|
||||
}
|
||||
23
pkg/rpc/protos/service_price.proto
Normal file
23
pkg/rpc/protos/service_price.proto
Normal file
@@ -0,0 +1,23 @@
|
||||
syntax = "proto3";
|
||||
option go_package = "./pb";
|
||||
|
||||
package pb;
|
||||
|
||||
// 价格相关服务
|
||||
service PriceService {
|
||||
// 计算费用
|
||||
rpc calculatePrice(CalculatePriceRequest) returns (CalculatePriceResponse);
|
||||
}
|
||||
|
||||
// 计算费用
|
||||
message CalculatePriceRequest {
|
||||
string priceType = 1;
|
||||
float trafficGB = 2;
|
||||
float bandwidthMB = 3;
|
||||
int64 regionId = 4;
|
||||
}
|
||||
|
||||
message CalculatePriceResponse {
|
||||
float amount = 1;
|
||||
bool hasRegionPrice = 2;
|
||||
}
|
||||
@@ -80,6 +80,7 @@ message FindDailyServerBandwidthStatsBetweenDaysRequest {
|
||||
string dayFrom = 3; // 开始日期 YYYYMMDD
|
||||
string dayTo = 4; // 结束日期 YYYYMMDD
|
||||
int32 percentile = 5; // 可选项,百分位(nth)带宽位置,0-100之间
|
||||
int64 regionId = 6; // 区域ID,可选项(目前只有用户整体统计支持区域ID)
|
||||
}
|
||||
|
||||
message FindDailyServerBandwidthStatsBetweenDaysResponse {
|
||||
|
||||
@@ -115,6 +115,7 @@ message FindServer5MinutelyStatsWithDayResponse {
|
||||
// 读取最近N日的统计数据
|
||||
message FindLatestServerDailyStatsRequest {
|
||||
int64 serverId = 1;
|
||||
int64 regionId = 3; // 区域ID,可选
|
||||
int32 days = 2; // 天数
|
||||
}
|
||||
|
||||
@@ -136,6 +137,7 @@ message FindServerDailyStatsBetweenDaysRequest {
|
||||
int64 serverId = 2; // 服务ID,和用户ID二选一
|
||||
string dayFrom = 3; // 开始日期 YYYYMMDD
|
||||
string dayTo = 4; // 结束日期 YYYYMMDD
|
||||
int64 regionId = 5; // 区域ID
|
||||
}
|
||||
|
||||
message FindServerDailyStatsBetweenDaysResponse {
|
||||
@@ -166,6 +168,8 @@ message SumCurrentServerDailyStatsResponse {
|
||||
message SumServerDailyStatsRequest {
|
||||
int64 userId = 3;
|
||||
int64 serverId = 1;
|
||||
int64 regionId = 6;
|
||||
|
||||
string day = 2; // YYYYMMDD
|
||||
|
||||
string dayFrom = 4; // day 和 dayFrom+dayTo 二选一, YYYYMMDD
|
||||
|
||||
@@ -30,6 +30,7 @@ service UserBillService {
|
||||
// 手工生成账单
|
||||
message GenerateAllUserBillsRequest {
|
||||
string month = 1;
|
||||
string day = 2;
|
||||
}
|
||||
|
||||
// 计算所有账单数量
|
||||
|
||||
Reference in New Issue
Block a user