[区域]可以设置区域-价格项目之间的价格

This commit is contained in:
刘祥超
2020-12-10 22:07:58 +08:00
parent 36862359b7
commit b529888ada
9 changed files with 1640 additions and 181 deletions

View File

@@ -1,119 +0,0 @@
package pb
import (
"encoding/json"
"github.com/golang/protobuf/proto"
"runtime"
"strconv"
"testing"
"time"
)
func TestHTTPAccessLog_Marshal(t *testing.T) {
data, err := proto.Marshal(&HTTPAccessLog{
ServerId: 1,
LocationId: 1,
RewriteId: 1,
NodeId: 1,
})
if err != nil {
t.Fatal(err)
}
t.Log(len(data), "bytes")
accessLog := &HTTPAccessLog{}
err = proto.Unmarshal(data, accessLog)
if err != nil {
t.Fatal(err)
}
t.Log("accessLog:", accessLog)
}
func TestHTTPAccessLog_Memory(t *testing.T) {
s := []*HTTPAccessLog{}
for i := 0; i < 100000; i++ {
s = append(s, &HTTPAccessLog{
ServerId: 1,
LocationId: 1,
RewriteId: 1,
NodeId: 1,
RequestPath: "/hello",
RequestURI: "/hello?name=lu&age=20",
RequestMethod: "POST",
RequestFilename: "/hello.html",
Header: map[string]*Strings{
"User-Agent": {
Values: []string{"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"},
},
},
})
}
time.Sleep(10 * time.Second)
}
func TestHTTPAccessLog_RequestId(t *testing.T) {
u := time.Now().UnixNano()
t.Logf("%d, %d", u, len(strconv.FormatInt(u, 10)))
}
func BenchmarkHTTPAccessLog_Proto_Marshal(b *testing.B) {
runtime.GOMAXPROCS(1)
for i := 0; i < b.N; i++ {
_, _ = proto.Marshal(&HTTPAccessLog{
ServerId: 1,
LocationId: 1,
RewriteId: 1,
NodeId: 1,
RequestPath: "/hello",
RequestURI: "/hello?name=lu&age=20",
RequestMethod: "POST",
RequestFilename: "/hello.html",
Header: map[string]*Strings{
"User-Agent": {
Values: []string{"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"},
},
},
})
}
}
func BenchmarkHTTPAccessLog_JSON_Marshal(b *testing.B) {
runtime.GOMAXPROCS(1)
for i := 0; i < b.N; i++ {
_, _ = json.Marshal(&HTTPAccessLog{
ServerId: 1,
LocationId: 1,
RewriteId: 1,
NodeId: 1,
RequestPath: "/hello",
RequestURI: "/hello?name=lu&age=20",
RequestMethod: "POST",
RequestFilename: "/hello.html",
Header: map[string]*Strings{
"User-Agent": {
Values: []string{"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"},
},
},
})
}
}
func BenchmarkHTTPAccessLog_JSON_Marshal_Map(b *testing.B) {
runtime.GOMAXPROCS(1)
for i := 0; i < b.N; i++ {
m := map[string]interface{}{
"ServerId": "1",
"LocationId": "1",
"RewriteId": "1",
"NodeId": "1",
"RequestPath": "/hello",
"RequestURI": "/hello?name=lu&age=20",
"RequestMethod": "POST",
"RequestFilename": "/hello.html",
"Header": map[string]interface{}{
"User-Agent": []string{"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"},
},
}
_, _ = json.Marshal(m)
}
}

View File

@@ -0,0 +1,194 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.3
// source: model_node_price_item.proto
package pb
import (
proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
type NodePriceItem struct {
state protoimpl.MessageState
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"`
Type string `protobuf:"bytes,4,opt,name=type,proto3" json:"type,omitempty"`
BitsFrom int64 `protobuf:"varint,5,opt,name=bitsFrom,proto3" json:"bitsFrom,omitempty"`
BitsTo int64 `protobuf:"varint,6,opt,name=bitsTo,proto3" json:"bitsTo,omitempty"`
}
func (x *NodePriceItem) Reset() {
*x = NodePriceItem{}
if protoimpl.UnsafeEnabled {
mi := &file_model_node_price_item_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *NodePriceItem) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*NodePriceItem) ProtoMessage() {}
func (x *NodePriceItem) ProtoReflect() protoreflect.Message {
mi := &file_model_node_price_item_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use NodePriceItem.ProtoReflect.Descriptor instead.
func (*NodePriceItem) Descriptor() ([]byte, []int) {
return file_model_node_price_item_proto_rawDescGZIP(), []int{0}
}
func (x *NodePriceItem) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *NodePriceItem) GetIsOn() bool {
if x != nil {
return x.IsOn
}
return false
}
func (x *NodePriceItem) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *NodePriceItem) GetType() string {
if x != nil {
return x.Type
}
return ""
}
func (x *NodePriceItem) GetBitsFrom() int64 {
if x != nil {
return x.BitsFrom
}
return 0
}
func (x *NodePriceItem) GetBitsTo() int64 {
if x != nil {
return x.BitsTo
}
return 0
}
var File_model_node_price_item_proto protoreflect.FileDescriptor
var file_model_node_price_item_proto_rawDesc = []byte{
0x0a, 0x1b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x70, 0x72, 0x69,
0x63, 0x65, 0x5f, 0x69, 0x74, 0x65, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70,
0x62, 0x22, 0x8f, 0x01, 0x0a, 0x0d, 0x4e, 0x6f, 0x64, 0x65, 0x50, 0x72, 0x69, 0x63, 0x65, 0x49,
0x74, 0x65, 0x6d, 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, 0x6d, 0x65, 0x18,
0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74,
0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12,
0x1a, 0x0a, 0x08, 0x62, 0x69, 0x74, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28,
0x03, 0x52, 0x08, 0x62, 0x69, 0x74, 0x73, 0x46, 0x72, 0x6f, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x62,
0x69, 0x74, 0x73, 0x54, 0x6f, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x62, 0x69, 0x74,
0x73, 0x54, 0x6f, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
}
var (
file_model_node_price_item_proto_rawDescOnce sync.Once
file_model_node_price_item_proto_rawDescData = file_model_node_price_item_proto_rawDesc
)
func file_model_node_price_item_proto_rawDescGZIP() []byte {
file_model_node_price_item_proto_rawDescOnce.Do(func() {
file_model_node_price_item_proto_rawDescData = protoimpl.X.CompressGZIP(file_model_node_price_item_proto_rawDescData)
})
return file_model_node_price_item_proto_rawDescData
}
var file_model_node_price_item_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_model_node_price_item_proto_goTypes = []interface{}{
(*NodePriceItem)(nil), // 0: pb.NodePriceItem
}
var file_model_node_price_item_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_model_node_price_item_proto_init() }
func file_model_node_price_item_proto_init() {
if File_model_node_price_item_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_model_node_price_item_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*NodePriceItem); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_model_node_price_item_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_model_node_price_item_proto_goTypes,
DependencyIndexes: file_model_node_price_item_proto_depIdxs,
MessageInfos: file_model_node_price_item_proto_msgTypes,
}.Build()
File_model_node_price_item_proto = out.File
file_model_node_price_item_proto_rawDesc = nil
file_model_node_price_item_proto_goTypes = nil
file_model_node_price_item_proto_depIdxs = nil
}

View File

@@ -30,9 +30,10 @@ type NodeRegion 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"`
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"`
PricesJSON []byte `protobuf:"bytes,4,opt,name=pricesJSON,proto3" json:"pricesJSON,omitempty"`
}
func (x *NodeRegion) Reset() {
@@ -88,16 +89,25 @@ func (x *NodeRegion) GetName() string {
return ""
}
func (x *NodeRegion) GetPricesJSON() []byte {
if x != nil {
return x.PricesJSON
}
return nil
}
var File_model_node_region_proto protoreflect.FileDescriptor
var file_model_node_region_proto_rawDesc = []byte{
0x0a, 0x17, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x72, 0x65, 0x67,
0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x44, 0x0a,
0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x64, 0x0a,
0x0a, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x67, 0x69, 0x6f, 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, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e,
0x61, 0x6d, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x72, 0x69, 0x63, 0x65, 0x73, 0x4a, 0x53, 0x4f,
0x4e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x70, 0x72, 0x69, 0x63, 0x65, 0x73, 0x4a,
0x53, 0x4f, 0x4e, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
}

File diff suppressed because it is too large Load Diff

View File

@@ -551,6 +551,70 @@ func (x *FindEnabledNodeRegionResponse) GetNodeRegion() *NodeRegion {
return nil
}
// 修改价格项价格
type UpdateNodeRegionPriceRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
NodeRegionId int64 `protobuf:"varint,1,opt,name=nodeRegionId,proto3" json:"nodeRegionId,omitempty"`
NodeItemId int64 `protobuf:"varint,2,opt,name=nodeItemId,proto3" json:"nodeItemId,omitempty"`
Price float32 `protobuf:"fixed32,3,opt,name=price,proto3" json:"price,omitempty"`
}
func (x *UpdateNodeRegionPriceRequest) Reset() {
*x = UpdateNodeRegionPriceRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_service_node_region_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UpdateNodeRegionPriceRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UpdateNodeRegionPriceRequest) ProtoMessage() {}
func (x *UpdateNodeRegionPriceRequest) ProtoReflect() protoreflect.Message {
mi := &file_service_node_region_proto_msgTypes[11]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UpdateNodeRegionPriceRequest.ProtoReflect.Descriptor instead.
func (*UpdateNodeRegionPriceRequest) Descriptor() ([]byte, []int) {
return file_service_node_region_proto_rawDescGZIP(), []int{11}
}
func (x *UpdateNodeRegionPriceRequest) GetNodeRegionId() int64 {
if x != nil {
return x.NodeRegionId
}
return 0
}
func (x *UpdateNodeRegionPriceRequest) GetNodeItemId() int64 {
if x != nil {
return x.NodeItemId
}
return 0
}
func (x *UpdateNodeRegionPriceRequest) GetPrice() float32 {
if x != nil {
return x.Price
}
return 0
}
var File_service_node_region_proto protoreflect.FileDescriptor
var file_service_node_region_proto_rawDesc = []byte{
@@ -605,48 +669,60 @@ var file_service_node_region_proto_rawDesc = []byte{
0x65, 0x67, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a,
0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x67, 0x69, 0x6f,
0x6e, 0x52, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x32, 0xf2, 0x04,
0x0a, 0x11, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76,
0x69, 0x63, 0x65, 0x12, 0x4d, 0x0a, 0x10, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64,
0x65, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65,
0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,
0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x12, 0x3f, 0x0a, 0x10, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65,
0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61,
0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63,
0x65, 0x73, 0x73, 0x12, 0x3f, 0x0a, 0x10, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4e, 0x6f, 0x64,
0x65, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c,
0x65, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63,
0x63, 0x65, 0x73, 0x73, 0x12, 0x68, 0x0a, 0x19, 0x66, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45,
0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e,
0x73, 0x12, 0x24, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e,
0x6e, 0x52, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x22, 0x78, 0x0a,
0x1c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x67, 0x69, 0x6f,
0x6e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a,
0x0c, 0x6e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x03, 0x52, 0x0c, 0x6e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x49,
0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x18,
0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x49,
0x64, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02,
0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x32, 0xbd, 0x05, 0x0a, 0x11, 0x4e, 0x6f, 0x64, 0x65,
0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x4d, 0x0a,
0x10, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x67, 0x69, 0x6f,
0x6e, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64,
0x65, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c,
0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65,
0x67, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x10,
0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e,
0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65,
0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e,
0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x3f, 0x0a,
0x10, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x67, 0x69, 0x6f,
0x6e, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x4e, 0x6f, 0x64,
0x65, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e,
0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x68,
0x0a, 0x19, 0x66, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64,
0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x24, 0x2e, 0x70, 0x62,
0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e,
0x6f, 0x64, 0x65, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x1a, 0x25, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e,
0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x73,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e,
0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x52,
0x65, 0x67, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x77,
0x0a, 0x1e, 0x66, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64,
0x41, 0x6e, 0x64, 0x4f, 0x6e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x73,
0x12, 0x29, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61,
0x62, 0x6c, 0x65, 0x64, 0x41, 0x6e, 0x64, 0x4f, 0x6e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x67,
0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x70, 0x62,
0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x41,
0x6e, 0x64, 0x4f, 0x6e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x73, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x16, 0x75, 0x70, 0x64, 0x61, 0x74,
0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x4f, 0x72, 0x64, 0x65, 0x72,
0x73, 0x12, 0x21, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64,
0x65, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63,
0x63, 0x65, 0x73, 0x73, 0x12, 0x5c, 0x0a, 0x15, 0x66, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62,
0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x2e,
0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f,
0x64, 0x65, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x21, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64,
0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x33,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x77, 0x0a, 0x1e, 0x66, 0x69, 0x6e, 0x64,
0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x41, 0x6e, 0x64, 0x4f, 0x6e, 0x4e,
0x6f, 0x64, 0x65, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x29, 0x2e, 0x70, 0x62, 0x2e,
0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x41, 0x6e,
0x64, 0x4f, 0x6e, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x41,
0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x41, 0x6e, 0x64, 0x4f, 0x6e, 0x4e, 0x6f,
0x64, 0x65, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x12, 0x4b, 0x0a, 0x16, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52,
0x65, 0x67, 0x69, 0x6f, 0x6e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x12, 0x21, 0x2e, 0x70, 0x62,
0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x67, 0x69, 0x6f,
0x6e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e,
0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x5c,
0x0a, 0x15, 0x66, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64,
0x65, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e,
0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x67, 0x69,
0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x70, 0x62, 0x2e, 0x46,
0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65,
0x67, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x15,
0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e,
0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x20, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74,
0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x69, 0x63, 0x65,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43,
0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -661,7 +737,7 @@ func file_service_node_region_proto_rawDescGZIP() []byte {
return file_service_node_region_proto_rawDescData
}
var file_service_node_region_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
var file_service_node_region_proto_msgTypes = make([]protoimpl.MessageInfo, 12)
var file_service_node_region_proto_goTypes = []interface{}{
(*CreateNodeRegionRequest)(nil), // 0: pb.CreateNodeRegionRequest
(*CreateNodeRegionResponse)(nil), // 1: pb.CreateNodeRegionResponse
@@ -674,13 +750,14 @@ var file_service_node_region_proto_goTypes = []interface{}{
(*UpdateNodeRegionOrdersRequest)(nil), // 8: pb.UpdateNodeRegionOrdersRequest
(*FindEnabledNodeRegionRequest)(nil), // 9: pb.FindEnabledNodeRegionRequest
(*FindEnabledNodeRegionResponse)(nil), // 10: pb.FindEnabledNodeRegionResponse
(*NodeRegion)(nil), // 11: pb.NodeRegion
(*RPCSuccess)(nil), // 12: pb.RPCSuccess
(*UpdateNodeRegionPriceRequest)(nil), // 11: pb.UpdateNodeRegionPriceRequest
(*NodeRegion)(nil), // 12: pb.NodeRegion
(*RPCSuccess)(nil), // 13: pb.RPCSuccess
}
var file_service_node_region_proto_depIdxs = []int32{
11, // 0: pb.FindAllEnabledNodeRegionsResponse.nodeRegions:type_name -> pb.NodeRegion
11, // 1: pb.FindAllEnabledAndOnNodeRegionsResponse.nodeRegions:type_name -> pb.NodeRegion
11, // 2: pb.FindEnabledNodeRegionResponse.nodeRegion:type_name -> pb.NodeRegion
12, // 0: pb.FindAllEnabledNodeRegionsResponse.nodeRegions:type_name -> pb.NodeRegion
12, // 1: pb.FindAllEnabledAndOnNodeRegionsResponse.nodeRegions:type_name -> pb.NodeRegion
12, // 2: pb.FindEnabledNodeRegionResponse.nodeRegion:type_name -> pb.NodeRegion
0, // 3: pb.NodeRegionService.createNodeRegion:input_type -> pb.CreateNodeRegionRequest
2, // 4: pb.NodeRegionService.updateNodeRegion:input_type -> pb.UpdateNodeRegionRequest
3, // 5: pb.NodeRegionService.deleteNodeRegion:input_type -> pb.DeleteNodeRegionRequest
@@ -688,15 +765,17 @@ var file_service_node_region_proto_depIdxs = []int32{
6, // 7: pb.NodeRegionService.findAllEnabledAndOnNodeRegions:input_type -> pb.FindAllEnabledAndOnNodeRegionsRequest
8, // 8: pb.NodeRegionService.updateNodeRegionOrders:input_type -> pb.UpdateNodeRegionOrdersRequest
9, // 9: pb.NodeRegionService.findEnabledNodeRegion:input_type -> pb.FindEnabledNodeRegionRequest
1, // 10: pb.NodeRegionService.createNodeRegion:output_type -> pb.CreateNodeRegionResponse
12, // 11: pb.NodeRegionService.updateNodeRegion:output_type -> pb.RPCSuccess
12, // 12: pb.NodeRegionService.deleteNodeRegion:output_type -> pb.RPCSuccess
5, // 13: pb.NodeRegionService.findAllEnabledNodeRegions:output_type -> pb.FindAllEnabledNodeRegionsResponse
7, // 14: pb.NodeRegionService.findAllEnabledAndOnNodeRegions:output_type -> pb.FindAllEnabledAndOnNodeRegionsResponse
12, // 15: pb.NodeRegionService.updateNodeRegionOrders:output_type -> pb.RPCSuccess
10, // 16: pb.NodeRegionService.findEnabledNodeRegion:output_type -> pb.FindEnabledNodeRegionResponse
10, // [10:17] is the sub-list for method output_type
3, // [3:10] is the sub-list for method input_type
11, // 10: pb.NodeRegionService.updateNodeRegionPrice:input_type -> pb.UpdateNodeRegionPriceRequest
1, // 11: pb.NodeRegionService.createNodeRegion:output_type -> pb.CreateNodeRegionResponse
13, // 12: pb.NodeRegionService.updateNodeRegion:output_type -> pb.RPCSuccess
13, // 13: pb.NodeRegionService.deleteNodeRegion:output_type -> pb.RPCSuccess
5, // 14: pb.NodeRegionService.findAllEnabledNodeRegions:output_type -> pb.FindAllEnabledNodeRegionsResponse
7, // 15: pb.NodeRegionService.findAllEnabledAndOnNodeRegions:output_type -> pb.FindAllEnabledAndOnNodeRegionsResponse
13, // 16: pb.NodeRegionService.updateNodeRegionOrders:output_type -> pb.RPCSuccess
10, // 17: pb.NodeRegionService.findEnabledNodeRegion:output_type -> pb.FindEnabledNodeRegionResponse
13, // 18: pb.NodeRegionService.updateNodeRegionPrice:output_type -> pb.RPCSuccess
11, // [11:19] is the sub-list for method output_type
3, // [3:11] is the sub-list for method input_type
3, // [3:3] is the sub-list for extension type_name
3, // [3:3] is the sub-list for extension extendee
0, // [0:3] is the sub-list for field type_name
@@ -842,6 +921,18 @@ func file_service_node_region_proto_init() {
return nil
}
}
file_service_node_region_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UpdateNodeRegionPriceRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
@@ -849,7 +940,7 @@ func file_service_node_region_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_service_node_region_proto_rawDesc,
NumEnums: 0,
NumMessages: 11,
NumMessages: 12,
NumExtensions: 0,
NumServices: 1,
},
@@ -889,6 +980,8 @@ type NodeRegionServiceClient interface {
UpdateNodeRegionOrders(ctx context.Context, in *UpdateNodeRegionOrdersRequest, opts ...grpc.CallOption) (*RPCSuccess, error)
// 查找单个区域信息
FindEnabledNodeRegion(ctx context.Context, in *FindEnabledNodeRegionRequest, opts ...grpc.CallOption) (*FindEnabledNodeRegionResponse, error)
// 修改价格项价格
UpdateNodeRegionPrice(ctx context.Context, in *UpdateNodeRegionPriceRequest, opts ...grpc.CallOption) (*RPCSuccess, error)
}
type nodeRegionServiceClient struct {
@@ -962,6 +1055,15 @@ func (c *nodeRegionServiceClient) FindEnabledNodeRegion(ctx context.Context, in
return out, nil
}
func (c *nodeRegionServiceClient) UpdateNodeRegionPrice(ctx context.Context, in *UpdateNodeRegionPriceRequest, opts ...grpc.CallOption) (*RPCSuccess, error) {
out := new(RPCSuccess)
err := c.cc.Invoke(ctx, "/pb.NodeRegionService/updateNodeRegionPrice", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// NodeRegionServiceServer is the server API for NodeRegionService service.
type NodeRegionServiceServer interface {
// 创建区域
@@ -978,6 +1080,8 @@ type NodeRegionServiceServer interface {
UpdateNodeRegionOrders(context.Context, *UpdateNodeRegionOrdersRequest) (*RPCSuccess, error)
// 查找单个区域信息
FindEnabledNodeRegion(context.Context, *FindEnabledNodeRegionRequest) (*FindEnabledNodeRegionResponse, error)
// 修改价格项价格
UpdateNodeRegionPrice(context.Context, *UpdateNodeRegionPriceRequest) (*RPCSuccess, error)
}
// UnimplementedNodeRegionServiceServer can be embedded to have forward compatible implementations.
@@ -1005,6 +1109,9 @@ func (*UnimplementedNodeRegionServiceServer) UpdateNodeRegionOrders(context.Cont
func (*UnimplementedNodeRegionServiceServer) FindEnabledNodeRegion(context.Context, *FindEnabledNodeRegionRequest) (*FindEnabledNodeRegionResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method FindEnabledNodeRegion not implemented")
}
func (*UnimplementedNodeRegionServiceServer) UpdateNodeRegionPrice(context.Context, *UpdateNodeRegionPriceRequest) (*RPCSuccess, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateNodeRegionPrice not implemented")
}
func RegisterNodeRegionServiceServer(s *grpc.Server, srv NodeRegionServiceServer) {
s.RegisterService(&_NodeRegionService_serviceDesc, srv)
@@ -1136,6 +1243,24 @@ func _NodeRegionService_FindEnabledNodeRegion_Handler(srv interface{}, ctx conte
return interceptor(ctx, in, info, handler)
}
func _NodeRegionService_UpdateNodeRegionPrice_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateNodeRegionPriceRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(NodeRegionServiceServer).UpdateNodeRegionPrice(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.NodeRegionService/UpdateNodeRegionPrice",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(NodeRegionServiceServer).UpdateNodeRegionPrice(ctx, req.(*UpdateNodeRegionPriceRequest))
}
return interceptor(ctx, in, info, handler)
}
var _NodeRegionService_serviceDesc = grpc.ServiceDesc{
ServiceName: "pb.NodeRegionService",
HandlerType: (*NodeRegionServiceServer)(nil),
@@ -1168,6 +1293,10 @@ var _NodeRegionService_serviceDesc = grpc.ServiceDesc{
MethodName: "findEnabledNodeRegion",
Handler: _NodeRegionService_FindEnabledNodeRegion_Handler,
},
{
MethodName: "updateNodeRegionPrice",
Handler: _NodeRegionService_UpdateNodeRegionPrice_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "service_node_region.proto",

View File

@@ -0,0 +1,13 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
message NodePriceItem {
int64 id = 1;
bool isOn = 2;
string name = 3;
string type = 4;
int64 bitsFrom = 5;
int64 bitsTo = 6;
}

View File

@@ -7,4 +7,5 @@ message NodeRegion {
int64 id = 1;
bool isOn = 2;
string name = 3;
bytes pricesJSON = 4;
}

View File

@@ -0,0 +1,81 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "rpc_messages.proto";
import "model_node_price_item.proto";
// 节点区域定价相关服务
service NodePriceItemService {
// 创建区域价格
rpc createNodePriceItem (CreateNodePriceItemRequest) returns (CreateNodePriceItemResponse);
// 修改区域价格
rpc updateNodePriceItem (UpdateNodePriceItemRequest) returns (RPCSuccess);
// 删除区域价格
rpc deleteNodePriceItem (DeleteNodePriceItemRequest) returns (RPCSuccess);
// 查找所有区域价格
rpc findAllEnabledNodePriceItems (FindAllEnabledNodePriceItemsRequest) returns (FindAllEnabledNodePriceItemsResponse);
// 查找所有启用的区域价格
rpc findAllEnabledAndOnNodePriceItems (FindAllEnabledAndOnNodePriceItemsRequest) returns (FindAllEnabledAndOnNodePriceItemsResponse);
// 查找单个区域信息
rpc findEnabledNodePriceItem (FindEnabledNodePriceItemRequest) returns (FindEnabledNodePriceItemResponse);
}
// 创建区域价格
message CreateNodePriceItemRequest {
string name = 1;
string type = 2;
int64 bitsFrom = 3;
int64 bitsTo = 4;
}
message CreateNodePriceItemResponse {
int64 NodePriceItemId = 1;
}
// 修改区域价格
message UpdateNodePriceItemRequest {
int64 NodePriceItemId = 1;
string name = 2;
bool isOn = 3;
int64 bitsFrom = 4;
int64 bitsTo = 5;
}
// 删除区域价格
message DeleteNodePriceItemRequest {
int64 NodePriceItemId = 1;
}
// 查找所有区域价格
message FindAllEnabledNodePriceItemsRequest {
string type = 1;
}
message FindAllEnabledNodePriceItemsResponse {
repeated NodePriceItem NodePriceItems = 1;
}
// 查找所有启用的区域价格
message FindAllEnabledAndOnNodePriceItemsRequest {
string type = 1;
}
message FindAllEnabledAndOnNodePriceItemsResponse {
repeated NodePriceItem NodePriceItems = 1;
}
// 查找单个区域价格信息
message FindEnabledNodePriceItemRequest {
int64 NodePriceItemId = 1;
}
message FindEnabledNodePriceItemResponse {
NodePriceItem NodePriceItem = 1;
}

View File

@@ -28,6 +28,9 @@ service NodeRegionService {
// 查找单个区域信息
rpc findEnabledNodeRegion (FindEnabledNodeRegionRequest) returns (FindEnabledNodeRegionResponse);
// 修改价格项价格
rpc updateNodeRegionPrice (UpdateNodeRegionPriceRequest) returns (RPCSuccess);
}
// 创建区域
@@ -81,4 +84,11 @@ message FindEnabledNodeRegionRequest {
message FindEnabledNodeRegionResponse {
NodeRegion nodeRegion = 1;
}
// 修改价格项价格
message UpdateNodeRegionPriceRequest {
int64 nodeRegionId = 1;
int64 nodeItemId = 2;
float price = 3;
}