优化代码

This commit is contained in:
刘祥超
2022-10-14 10:03:49 +08:00
parent 0d8c8064bf
commit 9af8721d8d
18 changed files with 4447 additions and 4107 deletions

View File

@@ -12,4 +12,5 @@ message ServerBandwidthStat {
string timeAt = 5;
int64 bytes = 6;
int64 bits = 7;
int64 regionId = 8;
}

View File

@@ -17,4 +17,7 @@ message UserBill {
int64 paidAt = 9;
string code = 10;
bool canPay = 11;
string dayFrom = 12;
string dayTo = 13;
string pricePeriod = 14;
}

View 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;
}

View File

@@ -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 {

View File

@@ -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

View File

@@ -30,6 +30,7 @@ service UserBillService {
// 手工生成账单
message GenerateAllUserBillsRequest {
string month = 1;
string day = 2;
}
// 计算所有账单数量