用户可以使用管理员设置的公用线路

This commit is contained in:
刘祥超
2022-11-24 17:20:26 +08:00
parent e7bf608552
commit 8b2088d498
9 changed files with 9310 additions and 7610 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -31,16 +31,18 @@ type NSRoute 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"`
RangesJSON []byte `protobuf:"bytes,4,opt,name=rangesJSON,proto3" json:"rangesJSON,omitempty"`
IsDeleted bool `protobuf:"varint,5,opt,name=isDeleted,proto3" json:"isDeleted,omitempty"`
Order int64 `protobuf:"varint,6,opt,name=order,proto3" json:"order,omitempty"`
Version int64 `protobuf:"varint,7,opt,name=version,proto3" json:"version,omitempty"`
Code string `protobuf:"bytes,8,opt,name=code,proto3" json:"code,omitempty"`
NsCluster *NSCluster `protobuf:"bytes,30,opt,name=nsCluster,proto3" json:"nsCluster,omitempty"`
NsDomain *NSDomain `protobuf:"bytes,31,opt,name=nsDomain,proto3" json:"nsDomain,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"`
RangesJSON []byte `protobuf:"bytes,4,opt,name=rangesJSON,proto3" json:"rangesJSON,omitempty"`
IsDeleted bool `protobuf:"varint,5,opt,name=isDeleted,proto3" json:"isDeleted,omitempty"`
Order int32 `protobuf:"varint,6,opt,name=order,proto3" json:"order,omitempty"`
Version int64 `protobuf:"varint,7,opt,name=version,proto3" json:"version,omitempty"`
Code string `protobuf:"bytes,8,opt,name=code,proto3" json:"code,omitempty"`
IsPublic bool `protobuf:"varint,9,opt,name=isPublic,proto3" json:"isPublic,omitempty"`
NsCluster *NSCluster `protobuf:"bytes,30,opt,name=nsCluster,proto3" json:"nsCluster,omitempty"`
NsDomain *NSDomain `protobuf:"bytes,31,opt,name=nsDomain,proto3" json:"nsDomain,omitempty"`
NsRouteCategory *NSRouteCategory `protobuf:"bytes,32,opt,name=nsRouteCategory,proto3" json:"nsRouteCategory,omitempty"`
}
func (x *NSRoute) Reset() {
@@ -110,7 +112,7 @@ func (x *NSRoute) GetIsDeleted() bool {
return false
}
func (x *NSRoute) GetOrder() int64 {
func (x *NSRoute) GetOrder() int32 {
if x != nil {
return x.Order
}
@@ -131,6 +133,13 @@ func (x *NSRoute) GetCode() string {
return ""
}
func (x *NSRoute) GetIsPublic() bool {
if x != nil {
return x.IsPublic
}
return false
}
func (x *NSRoute) GetNsCluster() *NSCluster {
if x != nil {
return x.NsCluster
@@ -145,6 +154,13 @@ func (x *NSRoute) GetNsDomain() *NSDomain {
return nil
}
func (x *NSRoute) GetNsRouteCategory() *NSRouteCategory {
if x != nil {
return x.NsRouteCategory
}
return nil
}
var File_models_model_ns_route_proto protoreflect.FileDescriptor
var file_models_model_ns_route_proto_rawDesc = []byte{
@@ -153,26 +169,34 @@ var file_models_model_ns_route_proto_rawDesc = []byte{
0x62, 0x1a, 0x1d, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f,
0x6e, 0x73, 0x5f, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x1a, 0x1c, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e,
0x73, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9a,
0x02, 0x0a, 0x07, 0x4e, 0x53, 0x52, 0x6f, 0x75, 0x74, 0x65, 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, 0x1e, 0x0a, 0x0a, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x4a, 0x53, 0x4f, 0x4e,
0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x4a, 0x53,
0x4f, 0x4e, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18,
0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64,
0x12, 0x14, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52,
0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f,
0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
0x63, 0x6f, 0x64, 0x65, 0x12, 0x2b, 0x0a, 0x09, 0x6e, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65,
0x72, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x53, 0x43,
0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x09, 0x6e, 0x73, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65,
0x72, 0x12, 0x28, 0x0a, 0x08, 0x6e, 0x73, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x1f, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x53, 0x44, 0x6f, 0x6d, 0x61, 0x69,
0x6e, 0x52, 0x08, 0x6e, 0x73, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x42, 0x06, 0x5a, 0x04, 0x2e,
0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x73, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x24,
0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e, 0x73, 0x5f,
0x72, 0x6f, 0x75, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf5, 0x02, 0x0a, 0x07, 0x4e, 0x53, 0x52, 0x6f, 0x75, 0x74, 0x65,
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, 0x1e, 0x0a, 0x0a, 0x72, 0x61, 0x6e, 0x67,
0x65, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0a, 0x72, 0x61,
0x6e, 0x67, 0x65, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x73, 0x44, 0x65,
0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x44,
0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18,
0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07,
0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x76,
0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x08,
0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x73,
0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x18, 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73,
0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x12, 0x2b, 0x0a, 0x09, 0x6e, 0x73, 0x43, 0x6c, 0x75, 0x73,
0x74, 0x65, 0x72, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x70, 0x62, 0x2e, 0x4e,
0x53, 0x43, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x52, 0x09, 0x6e, 0x73, 0x43, 0x6c, 0x75, 0x73,
0x74, 0x65, 0x72, 0x12, 0x28, 0x0a, 0x08, 0x6e, 0x73, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18,
0x1f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x53, 0x44, 0x6f, 0x6d,
0x61, 0x69, 0x6e, 0x52, 0x08, 0x6e, 0x73, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x3d, 0x0a,
0x0f, 0x6e, 0x73, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79,
0x18, 0x20, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x70, 0x62, 0x2e, 0x4e, 0x53, 0x52, 0x6f,
0x75, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x52, 0x0f, 0x6e, 0x73, 0x52,
0x6f, 0x75, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x42, 0x06, 0x5a, 0x04,
0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
@@ -189,18 +213,20 @@ func file_models_model_ns_route_proto_rawDescGZIP() []byte {
var file_models_model_ns_route_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_models_model_ns_route_proto_goTypes = []interface{}{
(*NSRoute)(nil), // 0: pb.NSRoute
(*NSCluster)(nil), // 1: pb.NSCluster
(*NSDomain)(nil), // 2: pb.NSDomain
(*NSRoute)(nil), // 0: pb.NSRoute
(*NSCluster)(nil), // 1: pb.NSCluster
(*NSDomain)(nil), // 2: pb.NSDomain
(*NSRouteCategory)(nil), // 3: pb.NSRouteCategory
}
var file_models_model_ns_route_proto_depIdxs = []int32{
1, // 0: pb.NSRoute.nsCluster:type_name -> pb.NSCluster
2, // 1: pb.NSRoute.nsDomain:type_name -> pb.NSDomain
2, // [2:2] is the sub-list for method output_type
2, // [2:2] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
3, // 2: pb.NSRoute.nsRouteCategory:type_name -> pb.NSRouteCategory
3, // [3:3] is the sub-list for method output_type
3, // [3:3] 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
}
func init() { file_models_model_ns_route_proto_init() }
@@ -210,6 +236,7 @@ func file_models_model_ns_route_proto_init() {
}
file_models_model_ns_cluster_proto_init()
file_models_model_ns_domain_proto_init()
file_models_model_ns_route_category_proto_init()
if !protoimpl.UnsafeEnabled {
file_models_model_ns_route_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*NSRoute); i {

View File

@@ -0,0 +1,176 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.19.4
// source: models/model_ns_route_category.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 NSRouteCategory struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
IsOn bool `protobuf:"varint,3,opt,name=isOn,proto3" json:"isOn,omitempty"`
Order int32 `protobuf:"varint,4,opt,name=order,proto3" json:"order,omitempty"`
}
func (x *NSRouteCategory) Reset() {
*x = NSRouteCategory{}
if protoimpl.UnsafeEnabled {
mi := &file_models_model_ns_route_category_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *NSRouteCategory) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*NSRouteCategory) ProtoMessage() {}
func (x *NSRouteCategory) ProtoReflect() protoreflect.Message {
mi := &file_models_model_ns_route_category_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 NSRouteCategory.ProtoReflect.Descriptor instead.
func (*NSRouteCategory) Descriptor() ([]byte, []int) {
return file_models_model_ns_route_category_proto_rawDescGZIP(), []int{0}
}
func (x *NSRouteCategory) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
func (x *NSRouteCategory) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *NSRouteCategory) GetIsOn() bool {
if x != nil {
return x.IsOn
}
return false
}
func (x *NSRouteCategory) GetOrder() int32 {
if x != nil {
return x.Order
}
return 0
}
var File_models_model_ns_route_category_proto protoreflect.FileDescriptor
var file_models_model_ns_route_category_proto_rawDesc = []byte{
0x0a, 0x24, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x6e,
0x73, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x5f, 0x63, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x5f, 0x0a, 0x0f, 0x4e, 0x53,
0x52, 0x6f, 0x75, 0x74, 0x65, 0x43, 0x61, 0x74, 0x65, 0x67, 0x6f, 0x72, 0x79, 0x12, 0x0e, 0x0a,
0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a,
0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d,
0x65, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52,
0x04, 0x69, 0x73, 0x4f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x04,
0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x42, 0x06, 0x5a, 0x04, 0x2e,
0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_models_model_ns_route_category_proto_rawDescOnce sync.Once
file_models_model_ns_route_category_proto_rawDescData = file_models_model_ns_route_category_proto_rawDesc
)
func file_models_model_ns_route_category_proto_rawDescGZIP() []byte {
file_models_model_ns_route_category_proto_rawDescOnce.Do(func() {
file_models_model_ns_route_category_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_model_ns_route_category_proto_rawDescData)
})
return file_models_model_ns_route_category_proto_rawDescData
}
var file_models_model_ns_route_category_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_models_model_ns_route_category_proto_goTypes = []interface{}{
(*NSRouteCategory)(nil), // 0: pb.NSRouteCategory
}
var file_models_model_ns_route_category_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_models_model_ns_route_category_proto_init() }
func file_models_model_ns_route_category_proto_init() {
if File_models_model_ns_route_category_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_models_model_ns_route_category_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*NSRouteCategory); 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_models_model_ns_route_category_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_models_model_ns_route_category_proto_goTypes,
DependencyIndexes: file_models_model_ns_route_category_proto_depIdxs,
MessageInfos: file_models_model_ns_route_category_proto_msgTypes,
}.Build()
File_models_model_ns_route_category_proto = out.File
file_models_model_ns_route_category_proto_rawDesc = nil
file_models_model_ns_route_category_proto_goTypes = nil
file_models_model_ns_route_category_proto_depIdxs = nil
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -5,6 +5,7 @@ package pb;
import "models/model_ns_cluster.proto";
import "models/model_ns_domain.proto";
import "models/model_ns_route_category.proto";
// 线路
message NSRoute {
@@ -13,10 +14,12 @@ message NSRoute {
string name = 3;
bytes rangesJSON = 4;
bool isDeleted = 5;
int64 order = 6;
int32 order = 6;
int64 version = 7;
string code = 8;
bool isPublic = 9;
NSCluster nsCluster = 30;
NSDomain nsDomain = 31;
NSRouteCategory nsRouteCategory = 32;
}

View File

@@ -0,0 +1,12 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
// 线路分类
message NSRouteCategory {
int64 id = 1;
string name = 2;
bool isOn = 3;
int32 order = 4;
}

View File

@@ -26,6 +26,10 @@ service NSRouteService {
// 读取所有自定义线路
rpc findAllNSRoutes (FindAllNSRoutesRequest) returns (FindAllNSRoutesResponse);
// 读取所有公用的自定义线路
// 目前只允许读取系统管理员设置的公用自定义线路
rpc findAllPublicNSRoutes (FindAllPublicRoutesRequest) returns (FindAllPublicRoutesResponse);
// 设置自定义线路排序
rpc updateNSRouteOrders (UpdateNSRouteOrdersRequest) returns (RPCSuccess);
@@ -49,6 +53,8 @@ message CreateNSRouteRequest {
int64 userId = 3;
string name = 4;
bytes rangesJSON = 5;
bool isPublic = 6;
int64 nsRouteCategoryId = 7;
}
message CreateNSRouteResponse {
@@ -60,6 +66,9 @@ message UpdateNSRouteRequest {
int64 nsRouteId = 1;
string name = 2;
bytes rangesJSON = 3;
bool isPublic = 4;
int64 nsRouteCategoryId = 5;
bool isOn = 6;
}
// 删除自定义线路
@@ -85,15 +94,25 @@ message CountAllNSRoutesRequest {
// 读取所有自定义线路
message FindAllNSRoutesRequest {
int64 nsClusterId = 1;
int64 nsDomainId = 2;
int64 userId = 3;
int64 nsClusterId = 1; // 集群ID
int64 nsDomainId = 2; // 域名ID
int64 userId = 3; // 用户ID
int64 nsRouteCategoryId = 4; // 线路分类ID
}
message FindAllNSRoutesResponse {
repeated NSRoute nsRoutes = 1;
}
// 读取所有公用的自定义线路
message FindAllPublicRoutesRequest {
}
message FindAllPublicRoutesResponse {
repeated NSRoute nsRoutes = 1;
}
// 设置自定义线路排序
message UpdateNSRouteOrdersRequest {
repeated int64 nsRouteIds = 1;

View File

@@ -0,0 +1,72 @@
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_ns_route_category.proto";
import "models/rpc_messages.proto";
// 线路分类服务
service NSRouteCategoryService {
// 创建线路分类
rpc createNSRouteCategory(CreateNSRouteCategoryRequest) returns (CreateNSRouteCategoryResponse);
// 修改线路分类
rpc updateNSRouteCategory(UpdateNSRouteCategoryRequest) returns (RPCSuccess);
// 删除线路分类
rpc deleteNSRouteCategory(DeleteNSRouteCategoryRequest) returns (RPCSuccess);
// 列出所有线路分类
rpc findAllNSRouteCategories(FindAllNSRouteCategoriesRequest) returns (FindAllNSRouteCategoriesResponse);
// 对线路分类进行排序
rpc updateNSRouteCategoryOrders(UpdateNSRouteCategoryOrders) returns (RPCSuccess);
// 查找单个线路分类
rpc findNSRouteCategory(FindNSRouteCategoryRequest) returns (FindNSRouteCategoryResponse);
}
// 创建线路分类
message CreateNSRouteCategoryRequest {
string name = 1;
}
message CreateNSRouteCategoryResponse {
int64 nsRouteCategoryId = 1;
}
// 修改线路分类
message UpdateNSRouteCategoryRequest {
int64 nsRouteCategoryId = 1;
string name = 2;
bool isOn = 3;
}
// 删除线路分类
message DeleteNSRouteCategoryRequest {
int64 nsRouteCategoryId = 1;
}
// 列出所有线路分类
message FindAllNSRouteCategoriesRequest {
}
message FindAllNSRouteCategoriesResponse {
repeated NSRouteCategory nsRouteCategories = 1;
}
// 对线路分类进行排序
message UpdateNSRouteCategoryOrders {
repeated int64 nsRouteCategoryIds = 1;
}
// 查找单个线路分类
message FindNSRouteCategoryRequest {
int64 nsRouteCategoryId = 1;
}
message FindNSRouteCategoryResponse {
NSRouteCategory nsRouteCategory = 1;
}