实现带宽计费套餐

This commit is contained in:
GoEdgeLab
2022-01-23 19:16:58 +08:00
parent 83d3ab75c3
commit 64e9fe64b3
14 changed files with 1032 additions and 52 deletions

View File

@@ -30,17 +30,18 @@ type Plan struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
IsOn bool `protobuf:"varint,2,opt,name=isOn,proto3" json:"isOn,omitempty"`
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
ClusterId int64 `protobuf:"varint,4,opt,name=clusterId,proto3" json:"clusterId,omitempty"`
TrafficLimitJSON []byte `protobuf:"bytes,5,opt,name=trafficLimitJSON,proto3" json:"trafficLimitJSON,omitempty"`
FeaturesJSON []byte `protobuf:"bytes,6,opt,name=featuresJSON,proto3" json:"featuresJSON,omitempty"`
PriceType string `protobuf:"bytes,7,opt,name=priceType,proto3" json:"priceType,omitempty"`
TrafficPriceJSON []byte `protobuf:"bytes,8,opt,name=trafficPriceJSON,proto3" json:"trafficPriceJSON,omitempty"`
MonthlyPrice float32 `protobuf:"fixed32,9,opt,name=monthlyPrice,proto3" json:"monthlyPrice,omitempty"`
SeasonallyPrice float32 `protobuf:"fixed32,10,opt,name=seasonallyPrice,proto3" json:"seasonallyPrice,omitempty"`
YearlyPrice float32 `protobuf:"fixed32,11,opt,name=yearlyPrice,proto3" json:"yearlyPrice,omitempty"`
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
IsOn bool `protobuf:"varint,2,opt,name=isOn,proto3" json:"isOn,omitempty"`
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
ClusterId int64 `protobuf:"varint,4,opt,name=clusterId,proto3" json:"clusterId,omitempty"`
TrafficLimitJSON []byte `protobuf:"bytes,5,opt,name=trafficLimitJSON,proto3" json:"trafficLimitJSON,omitempty"`
FeaturesJSON []byte `protobuf:"bytes,6,opt,name=featuresJSON,proto3" json:"featuresJSON,omitempty"`
PriceType string `protobuf:"bytes,7,opt,name=priceType,proto3" json:"priceType,omitempty"`
TrafficPriceJSON []byte `protobuf:"bytes,8,opt,name=trafficPriceJSON,proto3" json:"trafficPriceJSON,omitempty"`
BandwidthPriceJSON []byte `protobuf:"bytes,12,opt,name=bandwidthPriceJSON,proto3" json:"bandwidthPriceJSON,omitempty"`
MonthlyPrice float32 `protobuf:"fixed32,9,opt,name=monthlyPrice,proto3" json:"monthlyPrice,omitempty"`
SeasonallyPrice float32 `protobuf:"fixed32,10,opt,name=seasonallyPrice,proto3" json:"seasonallyPrice,omitempty"`
YearlyPrice float32 `protobuf:"fixed32,11,opt,name=yearlyPrice,proto3" json:"yearlyPrice,omitempty"`
}
func (x *Plan) Reset() {
@@ -131,6 +132,13 @@ func (x *Plan) GetTrafficPriceJSON() []byte {
return nil
}
func (x *Plan) GetBandwidthPriceJSON() []byte {
if x != nil {
return x.BandwidthPriceJSON
}
return nil
}
func (x *Plan) GetMonthlyPrice() float32 {
if x != nil {
return x.MonthlyPrice
@@ -156,7 +164,7 @@ var File_models_model_plan_proto protoreflect.FileDescriptor
var file_models_model_plan_proto_rawDesc = []byte{
0x0a, 0x17, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x70,
0x6c, 0x61, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0xe6, 0x02,
0x6c, 0x61, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x96, 0x03,
0x0a, 0x04, 0x50, 0x6c, 0x61, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18, 0x02,
0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61,
@@ -172,6 +180,9 @@ var file_models_model_plan_proto_rawDesc = []byte{
0x09, 0x70, 0x72, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2a, 0x0a, 0x10, 0x74, 0x72,
0x61, 0x66, 0x66, 0x69, 0x63, 0x50, 0x72, 0x69, 0x63, 0x65, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x08,
0x20, 0x01, 0x28, 0x0c, 0x52, 0x10, 0x74, 0x72, 0x61, 0x66, 0x66, 0x69, 0x63, 0x50, 0x72, 0x69,
0x63, 0x65, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x2e, 0x0a, 0x12, 0x62, 0x61, 0x6e, 0x64, 0x77, 0x69,
0x64, 0x74, 0x68, 0x50, 0x72, 0x69, 0x63, 0x65, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x0c, 0x20, 0x01,
0x28, 0x0c, 0x52, 0x12, 0x62, 0x61, 0x6e, 0x64, 0x77, 0x69, 0x64, 0x74, 0x68, 0x50, 0x72, 0x69,
0x63, 0x65, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x22, 0x0a, 0x0c, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x6c,
0x79, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0c, 0x6d, 0x6f,
0x6e, 0x74, 0x68, 0x6c, 0x79, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x73, 0x65,