|
@@ -75,6 +75,7 @@ func (service *formatterService) FormatBackendData(ctx context.Context, req *v1.
|
|
|
return string(jsonBytes), nil
|
|
|
}
|
|
|
|
|
|
+// FormatPort 格式化端口
|
|
|
func (service *formatterService) FormatPort(ctx context.Context, req interface{}) []int {
|
|
|
if req == nil {
|
|
|
return []int{}
|
|
@@ -101,6 +102,7 @@ func (service *formatterService) FormatPort(ctx context.Context, req interface{}
|
|
|
return res
|
|
|
}
|
|
|
|
|
|
+// OldFormat 旧格式
|
|
|
func (service *formatterService) OldFormat(ctx context.Context, req *[]model.GameShieldBackend) (map[string]v1.SendGameShieldBackend, error) {
|
|
|
res := make(map[string]v1.SendGameShieldBackend)
|
|
|
var UdpSessionTimeout string
|
|
@@ -214,7 +216,6 @@ func (service *formatterService) TidyFormatBackendData(ctx context.Context, req
|
|
|
}
|
|
|
itemMap.SdkPort = sdkPorts[i]
|
|
|
}
|
|
|
-
|
|
|
output[key] = itemMap
|
|
|
}
|
|
|
}
|
|
@@ -257,6 +258,7 @@ func (service *formatterService) ValidateBackendData(ctx context.Context, data m
|
|
|
maxBandwidthCount := int64(0)
|
|
|
|
|
|
for _, item := range data {
|
|
|
+
|
|
|
// 计算规则条目数
|
|
|
ruleEntriesCount += int64(len(item.Addr))
|
|
|
|