diff --git a/pkg/rpc/pb/model_plan.pb.go b/pkg/rpc/pb/model_plan.pb.go new file mode 100644 index 0000000..447f136 --- /dev/null +++ b/pkg/rpc/pb/model_plan.pb.go @@ -0,0 +1,247 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.12.3 +// source: models/model_plan.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 Plan 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"` + ClusterId int64 `protobuf:"varint,4,opt,name=clusterId,proto3" json:"clusterId,omitempty"` + BandwidthLimitJSON []byte `protobuf:"bytes,5,opt,name=bandwidthLimitJSON,proto3" json:"bandwidthLimitJSON,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"` + BandwidthPriceJSON []byte `protobuf:"bytes,8,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() { + *x = Plan{} + if protoimpl.UnsafeEnabled { + mi := &file_models_model_plan_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Plan) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Plan) ProtoMessage() {} + +func (x *Plan) ProtoReflect() protoreflect.Message { + mi := &file_models_model_plan_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 Plan.ProtoReflect.Descriptor instead. +func (*Plan) Descriptor() ([]byte, []int) { + return file_models_model_plan_proto_rawDescGZIP(), []int{0} +} + +func (x *Plan) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *Plan) GetIsOn() bool { + if x != nil { + return x.IsOn + } + return false +} + +func (x *Plan) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *Plan) GetClusterId() int64 { + if x != nil { + return x.ClusterId + } + return 0 +} + +func (x *Plan) GetBandwidthLimitJSON() []byte { + if x != nil { + return x.BandwidthLimitJSON + } + return nil +} + +func (x *Plan) GetFeaturesJSON() []byte { + if x != nil { + return x.FeaturesJSON + } + return nil +} + +func (x *Plan) GetPriceType() string { + if x != nil { + return x.PriceType + } + return "" +} + +func (x *Plan) GetBandwidthPriceJSON() []byte { + if x != nil { + return x.BandwidthPriceJSON + } + return nil +} + +func (x *Plan) GetMonthlyPrice() float32 { + if x != nil { + return x.MonthlyPrice + } + return 0 +} + +func (x *Plan) GetSeasonallyPrice() float32 { + if x != nil { + return x.SeasonallyPrice + } + return 0 +} + +func (x *Plan) GetYearlyPrice() float32 { + if x != nil { + return x.YearlyPrice + } + return 0 +} + +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, 0xee, 0x02, + 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, + 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, + 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x12, + 0x62, 0x61, 0x6e, 0x64, 0x77, 0x69, 0x64, 0x74, 0x68, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4a, 0x53, + 0x4f, 0x4e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x12, 0x62, 0x61, 0x6e, 0x64, 0x77, 0x69, + 0x64, 0x74, 0x68, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x22, 0x0a, 0x0c, + 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x0c, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x4a, 0x53, 0x4f, 0x4e, + 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2e, + 0x0a, 0x12, 0x62, 0x61, 0x6e, 0x64, 0x77, 0x69, 0x64, 0x74, 0x68, 0x50, 0x72, 0x69, 0x63, 0x65, + 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x08, 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, 0x61, 0x73, 0x6f, 0x6e, 0x61, 0x6c, 0x6c, 0x79, + 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0f, 0x73, 0x65, 0x61, + 0x73, 0x6f, 0x6e, 0x61, 0x6c, 0x6c, 0x79, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x20, 0x0a, 0x0b, + 0x79, 0x65, 0x61, 0x72, 0x6c, 0x79, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, + 0x02, 0x52, 0x0b, 0x79, 0x65, 0x61, 0x72, 0x6c, 0x79, 0x50, 0x72, 0x69, 0x63, 0x65, 0x42, 0x06, + 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_models_model_plan_proto_rawDescOnce sync.Once + file_models_model_plan_proto_rawDescData = file_models_model_plan_proto_rawDesc +) + +func file_models_model_plan_proto_rawDescGZIP() []byte { + file_models_model_plan_proto_rawDescOnce.Do(func() { + file_models_model_plan_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_model_plan_proto_rawDescData) + }) + return file_models_model_plan_proto_rawDescData +} + +var file_models_model_plan_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_models_model_plan_proto_goTypes = []interface{}{ + (*Plan)(nil), // 0: pb.Plan +} +var file_models_model_plan_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_plan_proto_init() } +func file_models_model_plan_proto_init() { + if File_models_model_plan_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_models_model_plan_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Plan); 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_plan_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_models_model_plan_proto_goTypes, + DependencyIndexes: file_models_model_plan_proto_depIdxs, + MessageInfos: file_models_model_plan_proto_msgTypes, + }.Build() + File_models_model_plan_proto = out.File + file_models_model_plan_proto_rawDesc = nil + file_models_model_plan_proto_goTypes = nil + file_models_model_plan_proto_depIdxs = nil +} diff --git a/pkg/rpc/pb/model_user_plan.pb.go b/pkg/rpc/pb/model_user_plan.pb.go new file mode 100644 index 0000000..94add7f --- /dev/null +++ b/pkg/rpc/pb/model_user_plan.pb.go @@ -0,0 +1,213 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.12.3 +// source: models/model_user_plan.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 UserPlan struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + UserId int64 `protobuf:"varint,2,opt,name=userId,proto3" json:"userId,omitempty"` + PlanId int64 `protobuf:"varint,3,opt,name=planId,proto3" json:"planId,omitempty"` + IsOn bool `protobuf:"varint,4,opt,name=isOn,proto3" json:"isOn,omitempty"` + DayTo string `protobuf:"bytes,5,opt,name=dayTo,proto3" json:"dayTo,omitempty"` + User *User `protobuf:"bytes,30,opt,name=user,proto3" json:"user,omitempty"` + Plan *Plan `protobuf:"bytes,31,opt,name=plan,proto3" json:"plan,omitempty"` +} + +func (x *UserPlan) Reset() { + *x = UserPlan{} + if protoimpl.UnsafeEnabled { + mi := &file_models_model_user_plan_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserPlan) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserPlan) ProtoMessage() {} + +func (x *UserPlan) ProtoReflect() protoreflect.Message { + mi := &file_models_model_user_plan_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 UserPlan.ProtoReflect.Descriptor instead. +func (*UserPlan) Descriptor() ([]byte, []int) { + return file_models_model_user_plan_proto_rawDescGZIP(), []int{0} +} + +func (x *UserPlan) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UserPlan) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *UserPlan) GetPlanId() int64 { + if x != nil { + return x.PlanId + } + return 0 +} + +func (x *UserPlan) GetIsOn() bool { + if x != nil { + return x.IsOn + } + return false +} + +func (x *UserPlan) GetDayTo() string { + if x != nil { + return x.DayTo + } + return "" +} + +func (x *UserPlan) GetUser() *User { + if x != nil { + return x.User + } + return nil +} + +func (x *UserPlan) GetPlan() *Plan { + if x != nil { + return x.Plan + } + return nil +} + +var File_models_model_user_plan_proto protoreflect.FileDescriptor + +var file_models_model_user_plan_proto_rawDesc = []byte{ + 0x0a, 0x1c, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x75, + 0x73, 0x65, 0x72, 0x5f, 0x70, 0x6c, 0x61, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, + 0x70, 0x62, 0x1a, 0x17, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x6d, 0x6f, 0x64, + 0x65, 0x6c, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x70, 0x6c, 0x61, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb0, 0x01, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x50, 0x6c, 0x61, + 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x6c, 0x61, + 0x6e, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x70, 0x6c, 0x61, 0x6e, 0x49, + 0x64, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x61, 0x79, 0x54, 0x6f, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x61, 0x79, 0x54, 0x6f, 0x12, 0x1c, 0x0a, 0x04, 0x75, + 0x73, 0x65, 0x72, 0x18, 0x1e, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x55, + 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x1c, 0x0a, 0x04, 0x70, 0x6c, 0x61, + 0x6e, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, + 0x6e, 0x52, 0x04, 0x70, 0x6c, 0x61, 0x6e, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_models_model_user_plan_proto_rawDescOnce sync.Once + file_models_model_user_plan_proto_rawDescData = file_models_model_user_plan_proto_rawDesc +) + +func file_models_model_user_plan_proto_rawDescGZIP() []byte { + file_models_model_user_plan_proto_rawDescOnce.Do(func() { + file_models_model_user_plan_proto_rawDescData = protoimpl.X.CompressGZIP(file_models_model_user_plan_proto_rawDescData) + }) + return file_models_model_user_plan_proto_rawDescData +} + +var file_models_model_user_plan_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_models_model_user_plan_proto_goTypes = []interface{}{ + (*UserPlan)(nil), // 0: pb.UserPlan + (*User)(nil), // 1: pb.User + (*Plan)(nil), // 2: pb.Plan +} +var file_models_model_user_plan_proto_depIdxs = []int32{ + 1, // 0: pb.UserPlan.user:type_name -> pb.User + 2, // 1: pb.UserPlan.plan:type_name -> pb.Plan + 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 +} + +func init() { file_models_model_user_plan_proto_init() } +func file_models_model_user_plan_proto_init() { + if File_models_model_user_plan_proto != nil { + return + } + file_models_model_user_proto_init() + file_models_model_plan_proto_init() + if !protoimpl.UnsafeEnabled { + file_models_model_user_plan_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserPlan); 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_user_plan_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_models_model_user_plan_proto_goTypes, + DependencyIndexes: file_models_model_user_plan_proto_depIdxs, + MessageInfos: file_models_model_user_plan_proto_msgTypes, + }.Build() + File_models_model_user_plan_proto = out.File + file_models_model_user_plan_proto_rawDesc = nil + file_models_model_user_plan_proto_goTypes = nil + file_models_model_user_plan_proto_depIdxs = nil +} diff --git a/pkg/rpc/pb/service_plan.pb.go b/pkg/rpc/pb/service_plan.pb.go new file mode 100644 index 0000000..e8bcc10 --- /dev/null +++ b/pkg/rpc/pb/service_plan.pb.go @@ -0,0 +1,1273 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.12.3 +// source: service_plan.proto + +package pb + +import ( + context "context" + proto "github.com/golang/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + 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 CreatePlanRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + ClusterId int64 `protobuf:"varint,2,opt,name=clusterId,proto3" json:"clusterId,omitempty"` + BandwidthLimitJSON []byte `protobuf:"bytes,3,opt,name=bandwidthLimitJSON,proto3" json:"bandwidthLimitJSON,omitempty"` + FeaturesJSON []byte `protobuf:"bytes,4,opt,name=featuresJSON,proto3" json:"featuresJSON,omitempty"` + PriceType string `protobuf:"bytes,5,opt,name=priceType,proto3" json:"priceType,omitempty"` + BandwidthPriceJSON []byte `protobuf:"bytes,6,opt,name=bandwidthPriceJSON,proto3" json:"bandwidthPriceJSON,omitempty"` + MonthlyPrice float32 `protobuf:"fixed32,7,opt,name=monthlyPrice,proto3" json:"monthlyPrice,omitempty"` + SeasonallyPrice float32 `protobuf:"fixed32,8,opt,name=seasonallyPrice,proto3" json:"seasonallyPrice,omitempty"` + YearlyPrice float32 `protobuf:"fixed32,9,opt,name=yearlyPrice,proto3" json:"yearlyPrice,omitempty"` +} + +func (x *CreatePlanRequest) Reset() { + *x = CreatePlanRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_plan_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreatePlanRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreatePlanRequest) ProtoMessage() {} + +func (x *CreatePlanRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_plan_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 CreatePlanRequest.ProtoReflect.Descriptor instead. +func (*CreatePlanRequest) Descriptor() ([]byte, []int) { + return file_service_plan_proto_rawDescGZIP(), []int{0} +} + +func (x *CreatePlanRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CreatePlanRequest) GetClusterId() int64 { + if x != nil { + return x.ClusterId + } + return 0 +} + +func (x *CreatePlanRequest) GetBandwidthLimitJSON() []byte { + if x != nil { + return x.BandwidthLimitJSON + } + return nil +} + +func (x *CreatePlanRequest) GetFeaturesJSON() []byte { + if x != nil { + return x.FeaturesJSON + } + return nil +} + +func (x *CreatePlanRequest) GetPriceType() string { + if x != nil { + return x.PriceType + } + return "" +} + +func (x *CreatePlanRequest) GetBandwidthPriceJSON() []byte { + if x != nil { + return x.BandwidthPriceJSON + } + return nil +} + +func (x *CreatePlanRequest) GetMonthlyPrice() float32 { + if x != nil { + return x.MonthlyPrice + } + return 0 +} + +func (x *CreatePlanRequest) GetSeasonallyPrice() float32 { + if x != nil { + return x.SeasonallyPrice + } + return 0 +} + +func (x *CreatePlanRequest) GetYearlyPrice() float32 { + if x != nil { + return x.YearlyPrice + } + return 0 +} + +type CreatePlanResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PlanId int64 `protobuf:"varint,1,opt,name=planId,proto3" json:"planId,omitempty"` +} + +func (x *CreatePlanResponse) Reset() { + *x = CreatePlanResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_plan_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreatePlanResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreatePlanResponse) ProtoMessage() {} + +func (x *CreatePlanResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_plan_proto_msgTypes[1] + 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 CreatePlanResponse.ProtoReflect.Descriptor instead. +func (*CreatePlanResponse) Descriptor() ([]byte, []int) { + return file_service_plan_proto_rawDescGZIP(), []int{1} +} + +func (x *CreatePlanResponse) GetPlanId() int64 { + if x != nil { + return x.PlanId + } + return 0 +} + +// 修改套餐 +type UpdatePlanRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PlanId int64 `protobuf:"varint,1,opt,name=planId,proto3" json:"planId,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"` + ClusterId int64 `protobuf:"varint,4,opt,name=clusterId,proto3" json:"clusterId,omitempty"` + BandwidthLimitJSON []byte `protobuf:"bytes,5,opt,name=bandwidthLimitJSON,proto3" json:"bandwidthLimitJSON,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"` + BandwidthPriceJSON []byte `protobuf:"bytes,8,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 *UpdatePlanRequest) Reset() { + *x = UpdatePlanRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_plan_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdatePlanRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdatePlanRequest) ProtoMessage() {} + +func (x *UpdatePlanRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_plan_proto_msgTypes[2] + 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 UpdatePlanRequest.ProtoReflect.Descriptor instead. +func (*UpdatePlanRequest) Descriptor() ([]byte, []int) { + return file_service_plan_proto_rawDescGZIP(), []int{2} +} + +func (x *UpdatePlanRequest) GetPlanId() int64 { + if x != nil { + return x.PlanId + } + return 0 +} + +func (x *UpdatePlanRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UpdatePlanRequest) GetIsOn() bool { + if x != nil { + return x.IsOn + } + return false +} + +func (x *UpdatePlanRequest) GetClusterId() int64 { + if x != nil { + return x.ClusterId + } + return 0 +} + +func (x *UpdatePlanRequest) GetBandwidthLimitJSON() []byte { + if x != nil { + return x.BandwidthLimitJSON + } + return nil +} + +func (x *UpdatePlanRequest) GetFeaturesJSON() []byte { + if x != nil { + return x.FeaturesJSON + } + return nil +} + +func (x *UpdatePlanRequest) GetPriceType() string { + if x != nil { + return x.PriceType + } + return "" +} + +func (x *UpdatePlanRequest) GetBandwidthPriceJSON() []byte { + if x != nil { + return x.BandwidthPriceJSON + } + return nil +} + +func (x *UpdatePlanRequest) GetMonthlyPrice() float32 { + if x != nil { + return x.MonthlyPrice + } + return 0 +} + +func (x *UpdatePlanRequest) GetSeasonallyPrice() float32 { + if x != nil { + return x.SeasonallyPrice + } + return 0 +} + +func (x *UpdatePlanRequest) GetYearlyPrice() float32 { + if x != nil { + return x.YearlyPrice + } + return 0 +} + +// 删除套餐 +type DeletePlanRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PlanId int64 `protobuf:"varint,1,opt,name=planId,proto3" json:"planId,omitempty"` +} + +func (x *DeletePlanRequest) Reset() { + *x = DeletePlanRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_plan_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeletePlanRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeletePlanRequest) ProtoMessage() {} + +func (x *DeletePlanRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_plan_proto_msgTypes[3] + 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 DeletePlanRequest.ProtoReflect.Descriptor instead. +func (*DeletePlanRequest) Descriptor() ([]byte, []int) { + return file_service_plan_proto_rawDescGZIP(), []int{3} +} + +func (x *DeletePlanRequest) GetPlanId() int64 { + if x != nil { + return x.PlanId + } + return 0 +} + +// 查找单个套餐 +type FindEnabledPlanRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PlanId int64 `protobuf:"varint,1,opt,name=planId,proto3" json:"planId,omitempty"` +} + +func (x *FindEnabledPlanRequest) Reset() { + *x = FindEnabledPlanRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_plan_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindEnabledPlanRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindEnabledPlanRequest) ProtoMessage() {} + +func (x *FindEnabledPlanRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_plan_proto_msgTypes[4] + 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 FindEnabledPlanRequest.ProtoReflect.Descriptor instead. +func (*FindEnabledPlanRequest) Descriptor() ([]byte, []int) { + return file_service_plan_proto_rawDescGZIP(), []int{4} +} + +func (x *FindEnabledPlanRequest) GetPlanId() int64 { + if x != nil { + return x.PlanId + } + return 0 +} + +type FindEnabledPlanResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Plan *Plan `protobuf:"bytes,1,opt,name=plan,proto3" json:"plan,omitempty"` +} + +func (x *FindEnabledPlanResponse) Reset() { + *x = FindEnabledPlanResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_plan_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindEnabledPlanResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindEnabledPlanResponse) ProtoMessage() {} + +func (x *FindEnabledPlanResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_plan_proto_msgTypes[5] + 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 FindEnabledPlanResponse.ProtoReflect.Descriptor instead. +func (*FindEnabledPlanResponse) Descriptor() ([]byte, []int) { + return file_service_plan_proto_rawDescGZIP(), []int{5} +} + +func (x *FindEnabledPlanResponse) GetPlan() *Plan { + if x != nil { + return x.Plan + } + return nil +} + +// 计算套餐数量 +type CountAllEnabledPlansRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CountAllEnabledPlansRequest) Reset() { + *x = CountAllEnabledPlansRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_plan_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CountAllEnabledPlansRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CountAllEnabledPlansRequest) ProtoMessage() {} + +func (x *CountAllEnabledPlansRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_plan_proto_msgTypes[6] + 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 CountAllEnabledPlansRequest.ProtoReflect.Descriptor instead. +func (*CountAllEnabledPlansRequest) Descriptor() ([]byte, []int) { + return file_service_plan_proto_rawDescGZIP(), []int{6} +} + +// 列出单页套餐 +type ListEnabledPlansRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Offset int64 `protobuf:"varint,1,opt,name=offset,proto3" json:"offset,omitempty"` + Size int64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` +} + +func (x *ListEnabledPlansRequest) Reset() { + *x = ListEnabledPlansRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_plan_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListEnabledPlansRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListEnabledPlansRequest) ProtoMessage() {} + +func (x *ListEnabledPlansRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_plan_proto_msgTypes[7] + 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 ListEnabledPlansRequest.ProtoReflect.Descriptor instead. +func (*ListEnabledPlansRequest) Descriptor() ([]byte, []int) { + return file_service_plan_proto_rawDescGZIP(), []int{7} +} + +func (x *ListEnabledPlansRequest) GetOffset() int64 { + if x != nil { + return x.Offset + } + return 0 +} + +func (x *ListEnabledPlansRequest) GetSize() int64 { + if x != nil { + return x.Size + } + return 0 +} + +type ListEnabledPlansResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Plans []*Plan `protobuf:"bytes,1,rep,name=plans,proto3" json:"plans,omitempty"` +} + +func (x *ListEnabledPlansResponse) Reset() { + *x = ListEnabledPlansResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_plan_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListEnabledPlansResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListEnabledPlansResponse) ProtoMessage() {} + +func (x *ListEnabledPlansResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_plan_proto_msgTypes[8] + 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 ListEnabledPlansResponse.ProtoReflect.Descriptor instead. +func (*ListEnabledPlansResponse) Descriptor() ([]byte, []int) { + return file_service_plan_proto_rawDescGZIP(), []int{8} +} + +func (x *ListEnabledPlansResponse) GetPlans() []*Plan { + if x != nil { + return x.Plans + } + return nil +} + +// 对套餐进行排序 +type SortPlansRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PlanIds []int64 `protobuf:"varint,1,rep,packed,name=planIds,proto3" json:"planIds,omitempty"` +} + +func (x *SortPlansRequest) Reset() { + *x = SortPlansRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_plan_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SortPlansRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SortPlansRequest) ProtoMessage() {} + +func (x *SortPlansRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_plan_proto_msgTypes[9] + 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 SortPlansRequest.ProtoReflect.Descriptor instead. +func (*SortPlansRequest) Descriptor() ([]byte, []int) { + return file_service_plan_proto_rawDescGZIP(), []int{9} +} + +func (x *SortPlansRequest) GetPlanIds() []int64 { + if x != nil { + return x.PlanIds + } + return nil +} + +var File_service_plan_proto protoreflect.FileDescriptor + +var file_service_plan_proto_rawDesc = []byte{ + 0x0a, 0x12, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x70, 0x6c, 0x61, 0x6e, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x17, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, + 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x70, 0x6c, 0x61, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x1a, 0x19, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x5f, 0x6d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd7, 0x02, 0x0a, + 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, 0x65, + 0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x6c, 0x75, 0x73, 0x74, + 0x65, 0x72, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x12, 0x62, 0x61, 0x6e, 0x64, 0x77, 0x69, 0x64, 0x74, + 0x68, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x12, 0x62, 0x61, 0x6e, 0x64, 0x77, 0x69, 0x64, 0x74, 0x68, 0x4c, 0x69, 0x6d, 0x69, 0x74, + 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x22, 0x0a, 0x0c, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, + 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x66, 0x65, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, 0x69, 0x63, + 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x69, + 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2e, 0x0a, 0x12, 0x62, 0x61, 0x6e, 0x64, 0x77, 0x69, + 0x64, 0x74, 0x68, 0x50, 0x72, 0x69, 0x63, 0x65, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x06, 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, 0x07, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0c, 0x6d, 0x6f, + 0x6e, 0x74, 0x68, 0x6c, 0x79, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x28, 0x0a, 0x0f, 0x73, 0x65, + 0x61, 0x73, 0x6f, 0x6e, 0x61, 0x6c, 0x6c, 0x79, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x08, 0x20, + 0x01, 0x28, 0x02, 0x52, 0x0f, 0x73, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x61, 0x6c, 0x6c, 0x79, 0x50, + 0x72, 0x69, 0x63, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x79, 0x65, 0x61, 0x72, 0x6c, 0x79, 0x50, 0x72, + 0x69, 0x63, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0b, 0x79, 0x65, 0x61, 0x72, 0x6c, + 0x79, 0x50, 0x72, 0x69, 0x63, 0x65, 0x22, 0x2c, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, + 0x70, 0x6c, 0x61, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x70, 0x6c, + 0x61, 0x6e, 0x49, 0x64, 0x22, 0x83, 0x03, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, + 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x6c, + 0x61, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x70, 0x6c, 0x61, 0x6e, + 0x49, 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, 0x1c, 0x0a, 0x09, 0x63, 0x6c, + 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, + 0x6c, 0x75, 0x73, 0x74, 0x65, 0x72, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x12, 0x62, 0x61, 0x6e, 0x64, + 0x77, 0x69, 0x64, 0x74, 0x68, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0c, 0x52, 0x12, 0x62, 0x61, 0x6e, 0x64, 0x77, 0x69, 0x64, 0x74, 0x68, 0x4c, + 0x69, 0x6d, 0x69, 0x74, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x22, 0x0a, 0x0c, 0x66, 0x65, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, + 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x1c, 0x0a, 0x09, + 0x70, 0x72, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x70, 0x72, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x2e, 0x0a, 0x12, 0x62, 0x61, + 0x6e, 0x64, 0x77, 0x69, 0x64, 0x74, 0x68, 0x50, 0x72, 0x69, 0x63, 0x65, 0x4a, 0x53, 0x4f, 0x4e, + 0x18, 0x08, 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, 0x61, 0x73, 0x6f, 0x6e, 0x61, 0x6c, 0x6c, 0x79, 0x50, 0x72, 0x69, 0x63, + 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0f, 0x73, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x61, + 0x6c, 0x6c, 0x79, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x79, 0x65, 0x61, 0x72, + 0x6c, 0x79, 0x50, 0x72, 0x69, 0x63, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0b, 0x79, + 0x65, 0x61, 0x72, 0x6c, 0x79, 0x50, 0x72, 0x69, 0x63, 0x65, 0x22, 0x2b, 0x0a, 0x11, 0x44, 0x65, + 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x16, 0x0a, 0x06, 0x70, 0x6c, 0x61, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x06, 0x70, 0x6c, 0x61, 0x6e, 0x49, 0x64, 0x22, 0x30, 0x0a, 0x16, 0x46, 0x69, 0x6e, 0x64, 0x45, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x6c, 0x61, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x06, 0x70, 0x6c, 0x61, 0x6e, 0x49, 0x64, 0x22, 0x37, 0x0a, 0x17, 0x46, 0x69, 0x6e, + 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x04, 0x70, 0x6c, 0x61, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x04, 0x70, 0x6c, + 0x61, 0x6e, 0x22, 0x1d, 0x0a, 0x1b, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x64, 0x50, 0x6c, 0x61, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x22, 0x45, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, + 0x50, 0x6c, 0x61, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, + 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66, + 0x66, 0x73, 0x65, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x3a, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, + 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x50, 0x6c, 0x61, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1e, 0x0a, 0x05, 0x70, 0x6c, 0x61, 0x6e, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x05, 0x70, + 0x6c, 0x61, 0x6e, 0x73, 0x22, 0x2c, 0x0a, 0x10, 0x53, 0x6f, 0x72, 0x74, 0x50, 0x6c, 0x61, 0x6e, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x6c, 0x61, 0x6e, + 0x49, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x03, 0x52, 0x07, 0x70, 0x6c, 0x61, 0x6e, 0x49, + 0x64, 0x73, 0x32, 0xd1, 0x03, 0x0a, 0x0b, 0x50, 0x6c, 0x61, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x3b, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6c, 0x61, 0x6e, + 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x6c, 0x61, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x33, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6c, 0x61, 0x6e, 0x12, 0x15, 0x2e, + 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x6c, 0x61, 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, 0x33, 0x0a, 0x0a, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6c, + 0x61, 0x6e, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x6c, + 0x61, 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, 0x4a, 0x0a, 0x0f, 0x66, 0x69, 0x6e, + 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x50, 0x6c, 0x61, 0x6e, 0x12, 0x1a, 0x2e, 0x70, + 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x50, 0x6c, 0x61, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, + 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x14, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, + 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x50, 0x6c, 0x61, 0x6e, 0x73, 0x12, 0x1f, 0x2e, + 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, + 0x65, 0x64, 0x50, 0x6c, 0x61, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, + 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x10, 0x6c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x50, 0x6c, 0x61, 0x6e, 0x73, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x50, 0x6c, 0x61, 0x6e, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, + 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x50, 0x6c, 0x61, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a, 0x09, 0x73, 0x6f, 0x72, 0x74, 0x50, 0x6c, 0x61, 0x6e, 0x73, + 0x12, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x50, 0x6c, 0x61, 0x6e, 0x73, 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 ( + file_service_plan_proto_rawDescOnce sync.Once + file_service_plan_proto_rawDescData = file_service_plan_proto_rawDesc +) + +func file_service_plan_proto_rawDescGZIP() []byte { + file_service_plan_proto_rawDescOnce.Do(func() { + file_service_plan_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_plan_proto_rawDescData) + }) + return file_service_plan_proto_rawDescData +} + +var file_service_plan_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_service_plan_proto_goTypes = []interface{}{ + (*CreatePlanRequest)(nil), // 0: pb.CreatePlanRequest + (*CreatePlanResponse)(nil), // 1: pb.CreatePlanResponse + (*UpdatePlanRequest)(nil), // 2: pb.UpdatePlanRequest + (*DeletePlanRequest)(nil), // 3: pb.DeletePlanRequest + (*FindEnabledPlanRequest)(nil), // 4: pb.FindEnabledPlanRequest + (*FindEnabledPlanResponse)(nil), // 5: pb.FindEnabledPlanResponse + (*CountAllEnabledPlansRequest)(nil), // 6: pb.CountAllEnabledPlansRequest + (*ListEnabledPlansRequest)(nil), // 7: pb.ListEnabledPlansRequest + (*ListEnabledPlansResponse)(nil), // 8: pb.ListEnabledPlansResponse + (*SortPlansRequest)(nil), // 9: pb.SortPlansRequest + (*Plan)(nil), // 10: pb.Plan + (*RPCSuccess)(nil), // 11: pb.RPCSuccess + (*RPCCountResponse)(nil), // 12: pb.RPCCountResponse +} +var file_service_plan_proto_depIdxs = []int32{ + 10, // 0: pb.FindEnabledPlanResponse.plan:type_name -> pb.Plan + 10, // 1: pb.ListEnabledPlansResponse.plans:type_name -> pb.Plan + 0, // 2: pb.PlanService.createPlan:input_type -> pb.CreatePlanRequest + 2, // 3: pb.PlanService.updatePlan:input_type -> pb.UpdatePlanRequest + 3, // 4: pb.PlanService.deletePlan:input_type -> pb.DeletePlanRequest + 4, // 5: pb.PlanService.findEnabledPlan:input_type -> pb.FindEnabledPlanRequest + 6, // 6: pb.PlanService.countAllEnabledPlans:input_type -> pb.CountAllEnabledPlansRequest + 7, // 7: pb.PlanService.listEnabledPlans:input_type -> pb.ListEnabledPlansRequest + 9, // 8: pb.PlanService.sortPlans:input_type -> pb.SortPlansRequest + 1, // 9: pb.PlanService.createPlan:output_type -> pb.CreatePlanResponse + 11, // 10: pb.PlanService.updatePlan:output_type -> pb.RPCSuccess + 11, // 11: pb.PlanService.deletePlan:output_type -> pb.RPCSuccess + 5, // 12: pb.PlanService.findEnabledPlan:output_type -> pb.FindEnabledPlanResponse + 12, // 13: pb.PlanService.countAllEnabledPlans:output_type -> pb.RPCCountResponse + 8, // 14: pb.PlanService.listEnabledPlans:output_type -> pb.ListEnabledPlansResponse + 11, // 15: pb.PlanService.sortPlans:output_type -> pb.RPCSuccess + 9, // [9:16] is the sub-list for method output_type + 2, // [2:9] 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 +} + +func init() { file_service_plan_proto_init() } +func file_service_plan_proto_init() { + if File_service_plan_proto != nil { + return + } + file_models_model_plan_proto_init() + file_models_rpc_messages_proto_init() + if !protoimpl.UnsafeEnabled { + file_service_plan_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreatePlanRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_plan_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreatePlanResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_plan_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdatePlanRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_plan_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeletePlanRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_plan_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindEnabledPlanRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_plan_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindEnabledPlanResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_plan_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CountAllEnabledPlansRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_plan_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListEnabledPlansRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_plan_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListEnabledPlansResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_plan_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SortPlansRequest); 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_service_plan_proto_rawDesc, + NumEnums: 0, + NumMessages: 10, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_service_plan_proto_goTypes, + DependencyIndexes: file_service_plan_proto_depIdxs, + MessageInfos: file_service_plan_proto_msgTypes, + }.Build() + File_service_plan_proto = out.File + file_service_plan_proto_rawDesc = nil + file_service_plan_proto_goTypes = nil + file_service_plan_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// PlanServiceClient is the client API for PlanService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type PlanServiceClient interface { + // 创建套餐 + CreatePlan(ctx context.Context, in *CreatePlanRequest, opts ...grpc.CallOption) (*CreatePlanResponse, error) + // 修改套餐 + UpdatePlan(ctx context.Context, in *UpdatePlanRequest, opts ...grpc.CallOption) (*RPCSuccess, error) + // 删除套餐 + DeletePlan(ctx context.Context, in *DeletePlanRequest, opts ...grpc.CallOption) (*RPCSuccess, error) + // 查找单个套餐 + FindEnabledPlan(ctx context.Context, in *FindEnabledPlanRequest, opts ...grpc.CallOption) (*FindEnabledPlanResponse, error) + // 计算套餐数量 + CountAllEnabledPlans(ctx context.Context, in *CountAllEnabledPlansRequest, opts ...grpc.CallOption) (*RPCCountResponse, error) + // 列出单页套餐 + ListEnabledPlans(ctx context.Context, in *ListEnabledPlansRequest, opts ...grpc.CallOption) (*ListEnabledPlansResponse, error) + // 对套餐进行排序 + SortPlans(ctx context.Context, in *SortPlansRequest, opts ...grpc.CallOption) (*RPCSuccess, error) +} + +type planServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewPlanServiceClient(cc grpc.ClientConnInterface) PlanServiceClient { + return &planServiceClient{cc} +} + +func (c *planServiceClient) CreatePlan(ctx context.Context, in *CreatePlanRequest, opts ...grpc.CallOption) (*CreatePlanResponse, error) { + out := new(CreatePlanResponse) + err := c.cc.Invoke(ctx, "/pb.PlanService/createPlan", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *planServiceClient) UpdatePlan(ctx context.Context, in *UpdatePlanRequest, opts ...grpc.CallOption) (*RPCSuccess, error) { + out := new(RPCSuccess) + err := c.cc.Invoke(ctx, "/pb.PlanService/updatePlan", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *planServiceClient) DeletePlan(ctx context.Context, in *DeletePlanRequest, opts ...grpc.CallOption) (*RPCSuccess, error) { + out := new(RPCSuccess) + err := c.cc.Invoke(ctx, "/pb.PlanService/deletePlan", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *planServiceClient) FindEnabledPlan(ctx context.Context, in *FindEnabledPlanRequest, opts ...grpc.CallOption) (*FindEnabledPlanResponse, error) { + out := new(FindEnabledPlanResponse) + err := c.cc.Invoke(ctx, "/pb.PlanService/findEnabledPlan", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *planServiceClient) CountAllEnabledPlans(ctx context.Context, in *CountAllEnabledPlansRequest, opts ...grpc.CallOption) (*RPCCountResponse, error) { + out := new(RPCCountResponse) + err := c.cc.Invoke(ctx, "/pb.PlanService/countAllEnabledPlans", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *planServiceClient) ListEnabledPlans(ctx context.Context, in *ListEnabledPlansRequest, opts ...grpc.CallOption) (*ListEnabledPlansResponse, error) { + out := new(ListEnabledPlansResponse) + err := c.cc.Invoke(ctx, "/pb.PlanService/listEnabledPlans", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *planServiceClient) SortPlans(ctx context.Context, in *SortPlansRequest, opts ...grpc.CallOption) (*RPCSuccess, error) { + out := new(RPCSuccess) + err := c.cc.Invoke(ctx, "/pb.PlanService/sortPlans", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// PlanServiceServer is the server API for PlanService service. +type PlanServiceServer interface { + // 创建套餐 + CreatePlan(context.Context, *CreatePlanRequest) (*CreatePlanResponse, error) + // 修改套餐 + UpdatePlan(context.Context, *UpdatePlanRequest) (*RPCSuccess, error) + // 删除套餐 + DeletePlan(context.Context, *DeletePlanRequest) (*RPCSuccess, error) + // 查找单个套餐 + FindEnabledPlan(context.Context, *FindEnabledPlanRequest) (*FindEnabledPlanResponse, error) + // 计算套餐数量 + CountAllEnabledPlans(context.Context, *CountAllEnabledPlansRequest) (*RPCCountResponse, error) + // 列出单页套餐 + ListEnabledPlans(context.Context, *ListEnabledPlansRequest) (*ListEnabledPlansResponse, error) + // 对套餐进行排序 + SortPlans(context.Context, *SortPlansRequest) (*RPCSuccess, error) +} + +// UnimplementedPlanServiceServer can be embedded to have forward compatible implementations. +type UnimplementedPlanServiceServer struct { +} + +func (*UnimplementedPlanServiceServer) CreatePlan(context.Context, *CreatePlanRequest) (*CreatePlanResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreatePlan not implemented") +} +func (*UnimplementedPlanServiceServer) UpdatePlan(context.Context, *UpdatePlanRequest) (*RPCSuccess, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdatePlan not implemented") +} +func (*UnimplementedPlanServiceServer) DeletePlan(context.Context, *DeletePlanRequest) (*RPCSuccess, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeletePlan not implemented") +} +func (*UnimplementedPlanServiceServer) FindEnabledPlan(context.Context, *FindEnabledPlanRequest) (*FindEnabledPlanResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FindEnabledPlan not implemented") +} +func (*UnimplementedPlanServiceServer) CountAllEnabledPlans(context.Context, *CountAllEnabledPlansRequest) (*RPCCountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CountAllEnabledPlans not implemented") +} +func (*UnimplementedPlanServiceServer) ListEnabledPlans(context.Context, *ListEnabledPlansRequest) (*ListEnabledPlansResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListEnabledPlans not implemented") +} +func (*UnimplementedPlanServiceServer) SortPlans(context.Context, *SortPlansRequest) (*RPCSuccess, error) { + return nil, status.Errorf(codes.Unimplemented, "method SortPlans not implemented") +} + +func RegisterPlanServiceServer(s *grpc.Server, srv PlanServiceServer) { + s.RegisterService(&_PlanService_serviceDesc, srv) +} + +func _PlanService_CreatePlan_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreatePlanRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlanServiceServer).CreatePlan(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.PlanService/CreatePlan", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlanServiceServer).CreatePlan(ctx, req.(*CreatePlanRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlanService_UpdatePlan_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdatePlanRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlanServiceServer).UpdatePlan(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.PlanService/UpdatePlan", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlanServiceServer).UpdatePlan(ctx, req.(*UpdatePlanRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlanService_DeletePlan_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeletePlanRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlanServiceServer).DeletePlan(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.PlanService/DeletePlan", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlanServiceServer).DeletePlan(ctx, req.(*DeletePlanRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlanService_FindEnabledPlan_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FindEnabledPlanRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlanServiceServer).FindEnabledPlan(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.PlanService/FindEnabledPlan", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlanServiceServer).FindEnabledPlan(ctx, req.(*FindEnabledPlanRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlanService_CountAllEnabledPlans_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CountAllEnabledPlansRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlanServiceServer).CountAllEnabledPlans(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.PlanService/CountAllEnabledPlans", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlanServiceServer).CountAllEnabledPlans(ctx, req.(*CountAllEnabledPlansRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlanService_ListEnabledPlans_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListEnabledPlansRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlanServiceServer).ListEnabledPlans(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.PlanService/ListEnabledPlans", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlanServiceServer).ListEnabledPlans(ctx, req.(*ListEnabledPlansRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _PlanService_SortPlans_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SortPlansRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(PlanServiceServer).SortPlans(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.PlanService/SortPlans", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(PlanServiceServer).SortPlans(ctx, req.(*SortPlansRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _PlanService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "pb.PlanService", + HandlerType: (*PlanServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "createPlan", + Handler: _PlanService_CreatePlan_Handler, + }, + { + MethodName: "updatePlan", + Handler: _PlanService_UpdatePlan_Handler, + }, + { + MethodName: "deletePlan", + Handler: _PlanService_DeletePlan_Handler, + }, + { + MethodName: "findEnabledPlan", + Handler: _PlanService_FindEnabledPlan_Handler, + }, + { + MethodName: "countAllEnabledPlans", + Handler: _PlanService_CountAllEnabledPlans_Handler, + }, + { + MethodName: "listEnabledPlans", + Handler: _PlanService_ListEnabledPlans_Handler, + }, + { + MethodName: "sortPlans", + Handler: _PlanService_SortPlans_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "service_plan.proto", +} diff --git a/pkg/rpc/pb/service_user_plan.pb.go b/pkg/rpc/pb/service_user_plan.pb.go new file mode 100644 index 0000000..ac3234d --- /dev/null +++ b/pkg/rpc/pb/service_user_plan.pb.go @@ -0,0 +1,1119 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.12.3 +// source: service_user_plan.proto + +package pb + +import ( + context "context" + proto "github.com/golang/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + 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 CreateUserPlanRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` + PlanId int64 `protobuf:"varint,2,opt,name=planId,proto3" json:"planId,omitempty"` + DayTo string `protobuf:"bytes,3,opt,name=dayTo,proto3" json:"dayTo,omitempty"` +} + +func (x *CreateUserPlanRequest) Reset() { + *x = CreateUserPlanRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_user_plan_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateUserPlanRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateUserPlanRequest) ProtoMessage() {} + +func (x *CreateUserPlanRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_user_plan_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 CreateUserPlanRequest.ProtoReflect.Descriptor instead. +func (*CreateUserPlanRequest) Descriptor() ([]byte, []int) { + return file_service_user_plan_proto_rawDescGZIP(), []int{0} +} + +func (x *CreateUserPlanRequest) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *CreateUserPlanRequest) GetPlanId() int64 { + if x != nil { + return x.PlanId + } + return 0 +} + +func (x *CreateUserPlanRequest) GetDayTo() string { + if x != nil { + return x.DayTo + } + return "" +} + +type CreateUserPlanResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserPlanId int64 `protobuf:"varint,1,opt,name=userPlanId,proto3" json:"userPlanId,omitempty"` +} + +func (x *CreateUserPlanResponse) Reset() { + *x = CreateUserPlanResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_user_plan_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateUserPlanResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateUserPlanResponse) ProtoMessage() {} + +func (x *CreateUserPlanResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_user_plan_proto_msgTypes[1] + 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 CreateUserPlanResponse.ProtoReflect.Descriptor instead. +func (*CreateUserPlanResponse) Descriptor() ([]byte, []int) { + return file_service_user_plan_proto_rawDescGZIP(), []int{1} +} + +func (x *CreateUserPlanResponse) GetUserPlanId() int64 { + if x != nil { + return x.UserPlanId + } + return 0 +} + +// 查找单个已购套餐信息 +type FindEnabledUserPlanRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserPlanId int64 `protobuf:"varint,1,opt,name=userPlanId,proto3" json:"userPlanId,omitempty"` +} + +func (x *FindEnabledUserPlanRequest) Reset() { + *x = FindEnabledUserPlanRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_user_plan_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindEnabledUserPlanRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindEnabledUserPlanRequest) ProtoMessage() {} + +func (x *FindEnabledUserPlanRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_user_plan_proto_msgTypes[2] + 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 FindEnabledUserPlanRequest.ProtoReflect.Descriptor instead. +func (*FindEnabledUserPlanRequest) Descriptor() ([]byte, []int) { + return file_service_user_plan_proto_rawDescGZIP(), []int{2} +} + +func (x *FindEnabledUserPlanRequest) GetUserPlanId() int64 { + if x != nil { + return x.UserPlanId + } + return 0 +} + +type FindEnabledUserPlanResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserPlan *UserPlan `protobuf:"bytes,1,opt,name=userPlan,proto3" json:"userPlan,omitempty"` +} + +func (x *FindEnabledUserPlanResponse) Reset() { + *x = FindEnabledUserPlanResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_user_plan_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindEnabledUserPlanResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindEnabledUserPlanResponse) ProtoMessage() {} + +func (x *FindEnabledUserPlanResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_user_plan_proto_msgTypes[3] + 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 FindEnabledUserPlanResponse.ProtoReflect.Descriptor instead. +func (*FindEnabledUserPlanResponse) Descriptor() ([]byte, []int) { + return file_service_user_plan_proto_rawDescGZIP(), []int{3} +} + +func (x *FindEnabledUserPlanResponse) GetUserPlan() *UserPlan { + if x != nil { + return x.UserPlan + } + return nil +} + +// 修改已购套餐 +type UpdateUserPlanRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserPlanId int64 `protobuf:"varint,1,opt,name=userPlanId,proto3" json:"userPlanId,omitempty"` + PlanId int64 `protobuf:"varint,2,opt,name=planId,proto3" json:"planId,omitempty"` + DayTo string `protobuf:"bytes,3,opt,name=dayTo,proto3" json:"dayTo,omitempty"` + IsOn bool `protobuf:"varint,4,opt,name=isOn,proto3" json:"isOn,omitempty"` +} + +func (x *UpdateUserPlanRequest) Reset() { + *x = UpdateUserPlanRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_user_plan_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateUserPlanRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateUserPlanRequest) ProtoMessage() {} + +func (x *UpdateUserPlanRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_user_plan_proto_msgTypes[4] + 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 UpdateUserPlanRequest.ProtoReflect.Descriptor instead. +func (*UpdateUserPlanRequest) Descriptor() ([]byte, []int) { + return file_service_user_plan_proto_rawDescGZIP(), []int{4} +} + +func (x *UpdateUserPlanRequest) GetUserPlanId() int64 { + if x != nil { + return x.UserPlanId + } + return 0 +} + +func (x *UpdateUserPlanRequest) GetPlanId() int64 { + if x != nil { + return x.PlanId + } + return 0 +} + +func (x *UpdateUserPlanRequest) GetDayTo() string { + if x != nil { + return x.DayTo + } + return "" +} + +func (x *UpdateUserPlanRequest) GetIsOn() bool { + if x != nil { + return x.IsOn + } + return false +} + +// 删除已购套餐 +type DeleteUserPlanRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserPlanId int64 `protobuf:"varint,1,opt,name=userPlanId,proto3" json:"userPlanId,omitempty"` +} + +func (x *DeleteUserPlanRequest) Reset() { + *x = DeleteUserPlanRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_user_plan_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteUserPlanRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteUserPlanRequest) ProtoMessage() {} + +func (x *DeleteUserPlanRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_user_plan_proto_msgTypes[5] + 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 DeleteUserPlanRequest.ProtoReflect.Descriptor instead. +func (*DeleteUserPlanRequest) Descriptor() ([]byte, []int) { + return file_service_user_plan_proto_rawDescGZIP(), []int{5} +} + +func (x *DeleteUserPlanRequest) GetUserPlanId() int64 { + if x != nil { + return x.UserPlanId + } + return 0 +} + +// 计算已购套餐数 +type CountAllEnabledUserPlansRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IsAvailable bool `protobuf:"varint,1,opt,name=isAvailable,proto3" json:"isAvailable,omitempty"` + IsExpired bool `protobuf:"varint,2,opt,name=isExpired,proto3" json:"isExpired,omitempty"` + ExpiringDays int32 `protobuf:"varint,3,opt,name=expiringDays,proto3" json:"expiringDays,omitempty"` + UserId int64 `protobuf:"varint,4,opt,name=userId,proto3" json:"userId,omitempty"` +} + +func (x *CountAllEnabledUserPlansRequest) Reset() { + *x = CountAllEnabledUserPlansRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_user_plan_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CountAllEnabledUserPlansRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CountAllEnabledUserPlansRequest) ProtoMessage() {} + +func (x *CountAllEnabledUserPlansRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_user_plan_proto_msgTypes[6] + 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 CountAllEnabledUserPlansRequest.ProtoReflect.Descriptor instead. +func (*CountAllEnabledUserPlansRequest) Descriptor() ([]byte, []int) { + return file_service_user_plan_proto_rawDescGZIP(), []int{6} +} + +func (x *CountAllEnabledUserPlansRequest) GetIsAvailable() bool { + if x != nil { + return x.IsAvailable + } + return false +} + +func (x *CountAllEnabledUserPlansRequest) GetIsExpired() bool { + if x != nil { + return x.IsExpired + } + return false +} + +func (x *CountAllEnabledUserPlansRequest) GetExpiringDays() int32 { + if x != nil { + return x.ExpiringDays + } + return 0 +} + +func (x *CountAllEnabledUserPlansRequest) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +// 列出单页已购套餐 +type ListEnabledUserPlansRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + IsAvailable bool `protobuf:"varint,1,opt,name=isAvailable,proto3" json:"isAvailable,omitempty"` + IsExpired bool `protobuf:"varint,2,opt,name=isExpired,proto3" json:"isExpired,omitempty"` + ExpiringDays int32 `protobuf:"varint,3,opt,name=expiringDays,proto3" json:"expiringDays,omitempty"` + UserId int64 `protobuf:"varint,4,opt,name=userId,proto3" json:"userId,omitempty"` + Offset int64 `protobuf:"varint,5,opt,name=offset,proto3" json:"offset,omitempty"` + Size int64 `protobuf:"varint,6,opt,name=size,proto3" json:"size,omitempty"` +} + +func (x *ListEnabledUserPlansRequest) Reset() { + *x = ListEnabledUserPlansRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_user_plan_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListEnabledUserPlansRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListEnabledUserPlansRequest) ProtoMessage() {} + +func (x *ListEnabledUserPlansRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_user_plan_proto_msgTypes[7] + 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 ListEnabledUserPlansRequest.ProtoReflect.Descriptor instead. +func (*ListEnabledUserPlansRequest) Descriptor() ([]byte, []int) { + return file_service_user_plan_proto_rawDescGZIP(), []int{7} +} + +func (x *ListEnabledUserPlansRequest) GetIsAvailable() bool { + if x != nil { + return x.IsAvailable + } + return false +} + +func (x *ListEnabledUserPlansRequest) GetIsExpired() bool { + if x != nil { + return x.IsExpired + } + return false +} + +func (x *ListEnabledUserPlansRequest) GetExpiringDays() int32 { + if x != nil { + return x.ExpiringDays + } + return 0 +} + +func (x *ListEnabledUserPlansRequest) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *ListEnabledUserPlansRequest) GetOffset() int64 { + if x != nil { + return x.Offset + } + return 0 +} + +func (x *ListEnabledUserPlansRequest) GetSize() int64 { + if x != nil { + return x.Size + } + return 0 +} + +type ListEnabledUserPlansResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserPlans []*UserPlan `protobuf:"bytes,1,rep,name=userPlans,proto3" json:"userPlans,omitempty"` +} + +func (x *ListEnabledUserPlansResponse) Reset() { + *x = ListEnabledUserPlansResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_user_plan_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListEnabledUserPlansResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListEnabledUserPlansResponse) ProtoMessage() {} + +func (x *ListEnabledUserPlansResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_user_plan_proto_msgTypes[8] + 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 ListEnabledUserPlansResponse.ProtoReflect.Descriptor instead. +func (*ListEnabledUserPlansResponse) Descriptor() ([]byte, []int) { + return file_service_user_plan_proto_rawDescGZIP(), []int{8} +} + +func (x *ListEnabledUserPlansResponse) GetUserPlans() []*UserPlan { + if x != nil { + return x.UserPlans + } + return nil +} + +var File_service_user_plan_proto protoreflect.FileDescriptor + +var file_service_user_plan_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x70, + 0x6c, 0x61, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x19, 0x6d, + 0x6f, 0x64, 0x65, 0x6c, 0x73, 0x2f, 0x72, 0x70, 0x63, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x73, + 0x2f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x70, 0x6c, 0x61, 0x6e, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5d, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x55, 0x73, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x6c, 0x61, 0x6e, 0x49, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x70, 0x6c, 0x61, 0x6e, 0x49, 0x64, 0x12, + 0x14, 0x0a, 0x05, 0x64, 0x61, 0x79, 0x54, 0x6f, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x64, 0x61, 0x79, 0x54, 0x6f, 0x22, 0x38, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, + 0x73, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x1e, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x6e, 0x49, 0x64, 0x22, + 0x3c, 0x0a, 0x1a, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, + 0x65, 0x72, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, + 0x0a, 0x75, 0x73, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x6e, 0x49, 0x64, 0x22, 0x47, 0x0a, + 0x1b, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, + 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x28, 0x0a, 0x08, + 0x75, 0x73, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, + 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x08, 0x75, 0x73, + 0x65, 0x72, 0x50, 0x6c, 0x61, 0x6e, 0x22, 0x79, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x55, 0x73, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x1e, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x03, 0x52, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x6e, 0x49, 0x64, 0x12, + 0x16, 0x0a, 0x06, 0x70, 0x6c, 0x61, 0x6e, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x06, 0x70, 0x6c, 0x61, 0x6e, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x61, 0x79, 0x54, 0x6f, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x64, 0x61, 0x79, 0x54, 0x6f, 0x12, 0x12, 0x0a, + 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, + 0x6e, 0x22, 0x37, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x50, + 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x75, 0x73, + 0x65, 0x72, 0x50, 0x6c, 0x61, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, + 0x75, 0x73, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x6e, 0x49, 0x64, 0x22, 0x9d, 0x01, 0x0a, 0x1f, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, + 0x65, 0x72, 0x50, 0x6c, 0x61, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, + 0x0a, 0x0b, 0x69, 0x73, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x0b, 0x69, 0x73, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, + 0x12, 0x1c, 0x0a, 0x09, 0x69, 0x73, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x12, 0x22, + 0x0a, 0x0c, 0x65, 0x78, 0x70, 0x69, 0x72, 0x69, 0x6e, 0x67, 0x44, 0x61, 0x79, 0x73, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x65, 0x78, 0x70, 0x69, 0x72, 0x69, 0x6e, 0x67, 0x44, 0x61, + 0x79, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0xc5, 0x01, 0x0a, 0x1b, 0x4c, + 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x50, 0x6c, + 0x61, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x69, 0x73, + 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x0b, 0x69, 0x73, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, + 0x69, 0x73, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, + 0x09, 0x69, 0x73, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x65, 0x78, + 0x70, 0x69, 0x72, 0x69, 0x6e, 0x67, 0x44, 0x61, 0x79, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x0c, 0x65, 0x78, 0x70, 0x69, 0x72, 0x69, 0x6e, 0x67, 0x44, 0x61, 0x79, 0x73, 0x12, 0x16, + 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, + 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x12, 0x12, + 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, + 0x7a, 0x65, 0x22, 0x4a, 0x0a, 0x1c, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, + 0x64, 0x55, 0x73, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x6e, 0x73, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x50, + 0x6c, 0x61, 0x6e, 0x52, 0x09, 0x75, 0x73, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x6e, 0x73, 0x32, 0xde, + 0x03, 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x12, 0x47, 0x0a, 0x0e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, + 0x50, 0x6c, 0x61, 0x6e, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x55, 0x73, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x50, + 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x13, 0x66, + 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x50, 0x6c, + 0x61, 0x6e, 0x12, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x0e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, + 0x72, 0x50, 0x6c, 0x61, 0x6e, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x55, 0x73, 0x65, 0x72, 0x50, 0x6c, 0x61, 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, 0x3b, 0x0a, 0x0e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x50, 0x6c, + 0x61, 0x6e, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, + 0x65, 0x72, 0x50, 0x6c, 0x61, 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, 0x55, 0x0a, + 0x18, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, + 0x55, 0x73, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x6e, 0x73, 0x12, 0x23, 0x2e, 0x70, 0x62, 0x2e, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, + 0x65, 0x72, 0x50, 0x6c, 0x61, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, + 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x59, 0x0a, 0x14, 0x6c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x50, 0x6c, 0x61, 0x6e, 0x73, 0x12, 0x1f, 0x2e, 0x70, + 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, + 0x72, 0x50, 0x6c, 0x61, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, + 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, + 0x65, 0x72, 0x50, 0x6c, 0x61, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, + 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_service_user_plan_proto_rawDescOnce sync.Once + file_service_user_plan_proto_rawDescData = file_service_user_plan_proto_rawDesc +) + +func file_service_user_plan_proto_rawDescGZIP() []byte { + file_service_user_plan_proto_rawDescOnce.Do(func() { + file_service_user_plan_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_user_plan_proto_rawDescData) + }) + return file_service_user_plan_proto_rawDescData +} + +var file_service_user_plan_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_service_user_plan_proto_goTypes = []interface{}{ + (*CreateUserPlanRequest)(nil), // 0: pb.CreateUserPlanRequest + (*CreateUserPlanResponse)(nil), // 1: pb.CreateUserPlanResponse + (*FindEnabledUserPlanRequest)(nil), // 2: pb.FindEnabledUserPlanRequest + (*FindEnabledUserPlanResponse)(nil), // 3: pb.FindEnabledUserPlanResponse + (*UpdateUserPlanRequest)(nil), // 4: pb.UpdateUserPlanRequest + (*DeleteUserPlanRequest)(nil), // 5: pb.DeleteUserPlanRequest + (*CountAllEnabledUserPlansRequest)(nil), // 6: pb.CountAllEnabledUserPlansRequest + (*ListEnabledUserPlansRequest)(nil), // 7: pb.ListEnabledUserPlansRequest + (*ListEnabledUserPlansResponse)(nil), // 8: pb.ListEnabledUserPlansResponse + (*UserPlan)(nil), // 9: pb.UserPlan + (*RPCSuccess)(nil), // 10: pb.RPCSuccess + (*RPCCountResponse)(nil), // 11: pb.RPCCountResponse +} +var file_service_user_plan_proto_depIdxs = []int32{ + 9, // 0: pb.FindEnabledUserPlanResponse.userPlan:type_name -> pb.UserPlan + 9, // 1: pb.ListEnabledUserPlansResponse.userPlans:type_name -> pb.UserPlan + 0, // 2: pb.UserPlanService.createUserPlan:input_type -> pb.CreateUserPlanRequest + 2, // 3: pb.UserPlanService.findEnabledUserPlan:input_type -> pb.FindEnabledUserPlanRequest + 4, // 4: pb.UserPlanService.updateUserPlan:input_type -> pb.UpdateUserPlanRequest + 5, // 5: pb.UserPlanService.deleteUserPlan:input_type -> pb.DeleteUserPlanRequest + 6, // 6: pb.UserPlanService.countAllEnabledUserPlans:input_type -> pb.CountAllEnabledUserPlansRequest + 7, // 7: pb.UserPlanService.listEnabledUserPlans:input_type -> pb.ListEnabledUserPlansRequest + 1, // 8: pb.UserPlanService.createUserPlan:output_type -> pb.CreateUserPlanResponse + 3, // 9: pb.UserPlanService.findEnabledUserPlan:output_type -> pb.FindEnabledUserPlanResponse + 10, // 10: pb.UserPlanService.updateUserPlan:output_type -> pb.RPCSuccess + 10, // 11: pb.UserPlanService.deleteUserPlan:output_type -> pb.RPCSuccess + 11, // 12: pb.UserPlanService.countAllEnabledUserPlans:output_type -> pb.RPCCountResponse + 8, // 13: pb.UserPlanService.listEnabledUserPlans:output_type -> pb.ListEnabledUserPlansResponse + 8, // [8:14] is the sub-list for method output_type + 2, // [2:8] 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 +} + +func init() { file_service_user_plan_proto_init() } +func file_service_user_plan_proto_init() { + if File_service_user_plan_proto != nil { + return + } + file_models_rpc_messages_proto_init() + file_models_model_user_plan_proto_init() + if !protoimpl.UnsafeEnabled { + file_service_user_plan_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateUserPlanRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_user_plan_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateUserPlanResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_user_plan_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindEnabledUserPlanRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_user_plan_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindEnabledUserPlanResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_user_plan_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateUserPlanRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_user_plan_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteUserPlanRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_user_plan_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CountAllEnabledUserPlansRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_user_plan_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListEnabledUserPlansRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_user_plan_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListEnabledUserPlansResponse); 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_service_user_plan_proto_rawDesc, + NumEnums: 0, + NumMessages: 9, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_service_user_plan_proto_goTypes, + DependencyIndexes: file_service_user_plan_proto_depIdxs, + MessageInfos: file_service_user_plan_proto_msgTypes, + }.Build() + File_service_user_plan_proto = out.File + file_service_user_plan_proto_rawDesc = nil + file_service_user_plan_proto_goTypes = nil + file_service_user_plan_proto_depIdxs = nil +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConnInterface + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion6 + +// UserPlanServiceClient is the client API for UserPlanService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type UserPlanServiceClient interface { + // 添加已购套餐 + CreateUserPlan(ctx context.Context, in *CreateUserPlanRequest, opts ...grpc.CallOption) (*CreateUserPlanResponse, error) + // 查找单个已购套餐信息 + FindEnabledUserPlan(ctx context.Context, in *FindEnabledUserPlanRequest, opts ...grpc.CallOption) (*FindEnabledUserPlanResponse, error) + // 修改已购套餐 + UpdateUserPlan(ctx context.Context, in *UpdateUserPlanRequest, opts ...grpc.CallOption) (*RPCSuccess, error) + // 删除已购套餐 + DeleteUserPlan(ctx context.Context, in *DeleteUserPlanRequest, opts ...grpc.CallOption) (*RPCSuccess, error) + // 计算已购套餐数 + CountAllEnabledUserPlans(ctx context.Context, in *CountAllEnabledUserPlansRequest, opts ...grpc.CallOption) (*RPCCountResponse, error) + // 列出单页已购套餐 + ListEnabledUserPlans(ctx context.Context, in *ListEnabledUserPlansRequest, opts ...grpc.CallOption) (*ListEnabledUserPlansResponse, error) +} + +type userPlanServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewUserPlanServiceClient(cc grpc.ClientConnInterface) UserPlanServiceClient { + return &userPlanServiceClient{cc} +} + +func (c *userPlanServiceClient) CreateUserPlan(ctx context.Context, in *CreateUserPlanRequest, opts ...grpc.CallOption) (*CreateUserPlanResponse, error) { + out := new(CreateUserPlanResponse) + err := c.cc.Invoke(ctx, "/pb.UserPlanService/createUserPlan", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userPlanServiceClient) FindEnabledUserPlan(ctx context.Context, in *FindEnabledUserPlanRequest, opts ...grpc.CallOption) (*FindEnabledUserPlanResponse, error) { + out := new(FindEnabledUserPlanResponse) + err := c.cc.Invoke(ctx, "/pb.UserPlanService/findEnabledUserPlan", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userPlanServiceClient) UpdateUserPlan(ctx context.Context, in *UpdateUserPlanRequest, opts ...grpc.CallOption) (*RPCSuccess, error) { + out := new(RPCSuccess) + err := c.cc.Invoke(ctx, "/pb.UserPlanService/updateUserPlan", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userPlanServiceClient) DeleteUserPlan(ctx context.Context, in *DeleteUserPlanRequest, opts ...grpc.CallOption) (*RPCSuccess, error) { + out := new(RPCSuccess) + err := c.cc.Invoke(ctx, "/pb.UserPlanService/deleteUserPlan", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userPlanServiceClient) CountAllEnabledUserPlans(ctx context.Context, in *CountAllEnabledUserPlansRequest, opts ...grpc.CallOption) (*RPCCountResponse, error) { + out := new(RPCCountResponse) + err := c.cc.Invoke(ctx, "/pb.UserPlanService/countAllEnabledUserPlans", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userPlanServiceClient) ListEnabledUserPlans(ctx context.Context, in *ListEnabledUserPlansRequest, opts ...grpc.CallOption) (*ListEnabledUserPlansResponse, error) { + out := new(ListEnabledUserPlansResponse) + err := c.cc.Invoke(ctx, "/pb.UserPlanService/listEnabledUserPlans", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// UserPlanServiceServer is the server API for UserPlanService service. +type UserPlanServiceServer interface { + // 添加已购套餐 + CreateUserPlan(context.Context, *CreateUserPlanRequest) (*CreateUserPlanResponse, error) + // 查找单个已购套餐信息 + FindEnabledUserPlan(context.Context, *FindEnabledUserPlanRequest) (*FindEnabledUserPlanResponse, error) + // 修改已购套餐 + UpdateUserPlan(context.Context, *UpdateUserPlanRequest) (*RPCSuccess, error) + // 删除已购套餐 + DeleteUserPlan(context.Context, *DeleteUserPlanRequest) (*RPCSuccess, error) + // 计算已购套餐数 + CountAllEnabledUserPlans(context.Context, *CountAllEnabledUserPlansRequest) (*RPCCountResponse, error) + // 列出单页已购套餐 + ListEnabledUserPlans(context.Context, *ListEnabledUserPlansRequest) (*ListEnabledUserPlansResponse, error) +} + +// UnimplementedUserPlanServiceServer can be embedded to have forward compatible implementations. +type UnimplementedUserPlanServiceServer struct { +} + +func (*UnimplementedUserPlanServiceServer) CreateUserPlan(context.Context, *CreateUserPlanRequest) (*CreateUserPlanResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateUserPlan not implemented") +} +func (*UnimplementedUserPlanServiceServer) FindEnabledUserPlan(context.Context, *FindEnabledUserPlanRequest) (*FindEnabledUserPlanResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FindEnabledUserPlan not implemented") +} +func (*UnimplementedUserPlanServiceServer) UpdateUserPlan(context.Context, *UpdateUserPlanRequest) (*RPCSuccess, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateUserPlan not implemented") +} +func (*UnimplementedUserPlanServiceServer) DeleteUserPlan(context.Context, *DeleteUserPlanRequest) (*RPCSuccess, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteUserPlan not implemented") +} +func (*UnimplementedUserPlanServiceServer) CountAllEnabledUserPlans(context.Context, *CountAllEnabledUserPlansRequest) (*RPCCountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CountAllEnabledUserPlans not implemented") +} +func (*UnimplementedUserPlanServiceServer) ListEnabledUserPlans(context.Context, *ListEnabledUserPlansRequest) (*ListEnabledUserPlansResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListEnabledUserPlans not implemented") +} + +func RegisterUserPlanServiceServer(s *grpc.Server, srv UserPlanServiceServer) { + s.RegisterService(&_UserPlanService_serviceDesc, srv) +} + +func _UserPlanService_CreateUserPlan_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateUserPlanRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserPlanServiceServer).CreateUserPlan(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.UserPlanService/CreateUserPlan", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserPlanServiceServer).CreateUserPlan(ctx, req.(*CreateUserPlanRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserPlanService_FindEnabledUserPlan_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FindEnabledUserPlanRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserPlanServiceServer).FindEnabledUserPlan(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.UserPlanService/FindEnabledUserPlan", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserPlanServiceServer).FindEnabledUserPlan(ctx, req.(*FindEnabledUserPlanRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserPlanService_UpdateUserPlan_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateUserPlanRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserPlanServiceServer).UpdateUserPlan(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.UserPlanService/UpdateUserPlan", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserPlanServiceServer).UpdateUserPlan(ctx, req.(*UpdateUserPlanRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserPlanService_DeleteUserPlan_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteUserPlanRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserPlanServiceServer).DeleteUserPlan(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.UserPlanService/DeleteUserPlan", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserPlanServiceServer).DeleteUserPlan(ctx, req.(*DeleteUserPlanRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserPlanService_CountAllEnabledUserPlans_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CountAllEnabledUserPlansRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserPlanServiceServer).CountAllEnabledUserPlans(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.UserPlanService/CountAllEnabledUserPlans", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserPlanServiceServer).CountAllEnabledUserPlans(ctx, req.(*CountAllEnabledUserPlansRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserPlanService_ListEnabledUserPlans_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListEnabledUserPlansRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserPlanServiceServer).ListEnabledUserPlans(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.UserPlanService/ListEnabledUserPlans", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserPlanServiceServer).ListEnabledUserPlans(ctx, req.(*ListEnabledUserPlansRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _UserPlanService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "pb.UserPlanService", + HandlerType: (*UserPlanServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "createUserPlan", + Handler: _UserPlanService_CreateUserPlan_Handler, + }, + { + MethodName: "findEnabledUserPlan", + Handler: _UserPlanService_FindEnabledUserPlan_Handler, + }, + { + MethodName: "updateUserPlan", + Handler: _UserPlanService_UpdateUserPlan_Handler, + }, + { + MethodName: "deleteUserPlan", + Handler: _UserPlanService_DeleteUserPlan_Handler, + }, + { + MethodName: "countAllEnabledUserPlans", + Handler: _UserPlanService_CountAllEnabledUserPlans_Handler, + }, + { + MethodName: "listEnabledUserPlans", + Handler: _UserPlanService_ListEnabledUserPlans_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "service_user_plan.proto", +} diff --git a/pkg/rpc/protos/models/model_plan.proto b/pkg/rpc/protos/models/model_plan.proto new file mode 100644 index 0000000..bdee74c --- /dev/null +++ b/pkg/rpc/protos/models/model_plan.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; +option go_package = "./pb"; + +package pb; + +message Plan { + int64 id = 1; + bool isOn = 2; + string name = 3; + int64 clusterId = 4; + bytes bandwidthLimitJSON = 5; + bytes featuresJSON = 6; + string priceType = 7; + bytes bandwidthPriceJSON = 8; + float monthlyPrice = 9; + float seasonallyPrice = 10; + float yearlyPrice = 11; +} \ No newline at end of file diff --git a/pkg/rpc/protos/models/model_user_plan.proto b/pkg/rpc/protos/models/model_user_plan.proto new file mode 100644 index 0000000..0213e1a --- /dev/null +++ b/pkg/rpc/protos/models/model_user_plan.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; +option go_package = "./pb"; + +package pb; + +import "models/model_user.proto"; +import "models/model_plan.proto"; + +message UserPlan { + int64 id = 1; + int64 userId = 2; + int64 planId = 3; + bool isOn = 4; + string dayTo = 5; + + User user = 30; + Plan plan = 31; +} + diff --git a/pkg/rpc/protos/service_plan.proto b/pkg/rpc/protos/service_plan.proto new file mode 100644 index 0000000..e513071 --- /dev/null +++ b/pkg/rpc/protos/service_plan.proto @@ -0,0 +1,97 @@ +syntax = "proto3"; +option go_package = "./pb"; + +package pb; + +import "models/model_plan.proto"; +import "models/rpc_messages.proto"; + +// 套餐相关服务 +service PlanService { + // 创建套餐 + rpc createPlan(CreatePlanRequest) returns (CreatePlanResponse); + + // 修改套餐 + rpc updatePlan(UpdatePlanRequest) returns (RPCSuccess); + + // 删除套餐 + rpc deletePlan(DeletePlanRequest) returns (RPCSuccess); + + // 查找单个套餐 + rpc findEnabledPlan(FindEnabledPlanRequest) returns (FindEnabledPlanResponse); + + // 计算套餐数量 + rpc countAllEnabledPlans(CountAllEnabledPlansRequest) returns (RPCCountResponse); + + // 列出单页套餐 + rpc listEnabledPlans(ListEnabledPlansRequest) returns (ListEnabledPlansResponse); + + // 对套餐进行排序 + rpc sortPlans(SortPlansRequest) returns (RPCSuccess); +} + +// 创建套餐 +message CreatePlanRequest { + string name = 1; + int64 clusterId = 2; + bytes bandwidthLimitJSON = 3; + bytes featuresJSON = 4; + string priceType = 5; + bytes bandwidthPriceJSON = 6; + float monthlyPrice = 7; + float seasonallyPrice = 8; + float yearlyPrice = 9; +} + +message CreatePlanResponse { + int64 planId = 1; +} + +// 修改套餐 +message UpdatePlanRequest { + int64 planId = 1; + string name = 2; + bool isOn = 3; + int64 clusterId = 4; + bytes bandwidthLimitJSON = 5; + bytes featuresJSON = 6; + string priceType = 7; + bytes bandwidthPriceJSON = 8; + float monthlyPrice = 9; + float seasonallyPrice = 10; + float yearlyPrice = 11; +} + +// 删除套餐 +message DeletePlanRequest { + int64 planId = 1; +} + +// 查找单个套餐 +message FindEnabledPlanRequest { + int64 planId = 1; +} + +message FindEnabledPlanResponse { + Plan plan = 1; +} + +// 计算套餐数量 +message CountAllEnabledPlansRequest { + +} + +// 列出单页套餐 +message ListEnabledPlansRequest { + int64 offset = 1; + int64 size = 2; +} + +message ListEnabledPlansResponse { + repeated Plan plans = 1; +} + +// 对套餐进行排序 +message SortPlansRequest { + repeated int64 planIds = 1; +} \ No newline at end of file diff --git a/pkg/rpc/protos/service_user_plan.proto b/pkg/rpc/protos/service_user_plan.proto new file mode 100644 index 0000000..6f41921 --- /dev/null +++ b/pkg/rpc/protos/service_user_plan.proto @@ -0,0 +1,83 @@ +syntax = "proto3"; +option go_package = "./pb"; + +package pb; + +import "models/rpc_messages.proto"; +import "models/model_user_plan.proto"; + +// 用户购买的套餐 +service UserPlanService { + // 添加已购套餐 + rpc createUserPlan(CreateUserPlanRequest) returns (CreateUserPlanResponse); + + // 查找单个已购套餐信息 + rpc findEnabledUserPlan(FindEnabledUserPlanRequest) returns (FindEnabledUserPlanResponse); + + // 修改已购套餐 + rpc updateUserPlan(UpdateUserPlanRequest) returns (RPCSuccess); + + // 删除已购套餐 + rpc deleteUserPlan(DeleteUserPlanRequest) returns (RPCSuccess); + + // 计算已购套餐数 + rpc countAllEnabledUserPlans(CountAllEnabledUserPlansRequest) returns (RPCCountResponse); + + // 列出单页已购套餐 + rpc listEnabledUserPlans(ListEnabledUserPlansRequest) returns (ListEnabledUserPlansResponse); +} + +// 添加已购套餐 +message CreateUserPlanRequest{ + int64 userId = 1; + int64 planId = 2; + string dayTo = 3; +} + +message CreateUserPlanResponse { + int64 userPlanId = 1; +} + +// 查找单个已购套餐信息 +message FindEnabledUserPlanRequest { + int64 userPlanId = 1; +} + +message FindEnabledUserPlanResponse { + UserPlan userPlan = 1; +} + +// 修改已购套餐 +message UpdateUserPlanRequest { + int64 userPlanId = 1; + int64 planId = 2; + string dayTo = 3; + bool isOn = 4; +} + +// 删除已购套餐 +message DeleteUserPlanRequest { + int64 userPlanId = 1; +} + +// 计算已购套餐数 +message CountAllEnabledUserPlansRequest { + bool isAvailable = 1; + bool isExpired = 2; + int32 expiringDays = 3; + int64 userId = 4; +} + +// 列出单页已购套餐 +message ListEnabledUserPlansRequest { + bool isAvailable = 1; + bool isExpired = 2; + int32 expiringDays = 3; + int64 userId = 4; + int64 offset = 5; + int64 size = 6; +} + +message ListEnabledUserPlansResponse { + repeated UserPlan userPlans = 1; +} \ No newline at end of file diff --git a/pkg/serverconfigs/plan_price_types.go b/pkg/serverconfigs/plan_price_types.go new file mode 100644 index 0000000..9adc625 --- /dev/null +++ b/pkg/serverconfigs/plan_price_types.go @@ -0,0 +1,24 @@ +// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved. + +package serverconfigs + +type PlanPriceType = string + +const ( + PlanPriceTypeBandwidth PlanPriceType = "bandwidth" + PlanPriceTypePeriod PlanPriceType = "period" +) + +func FindPlanPriceTypeName(priceType PlanPriceType) string { + switch priceType { + case PlanPriceTypeBandwidth: + return "带宽用量" + case PlanPriceTypePeriod: + return "时间周期" + } + return "" +} + +type PlanBandwidthPrice struct { + Base float32 `yaml:"base" json:"base"` // 基础价格,单位是 元/GB +}