diff --git a/pkg/rpc/pb/model_user_node.pb.go b/pkg/rpc/pb/model_user_node.pb.go new file mode 100644 index 0000000..30ded20 --- /dev/null +++ b/pkg/rpc/pb/model_user_node.pb.go @@ -0,0 +1,234 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.12.3 +// source: model_user_node.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 UserNode 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"` + UniqueId string `protobuf:"bytes,3,opt,name=uniqueId,proto3" json:"uniqueId,omitempty"` + Secret string `protobuf:"bytes,4,opt,name=secret,proto3" json:"secret,omitempty"` + Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,6,opt,name=description,proto3" json:"description,omitempty"` + HttpJSON []byte `protobuf:"bytes,7,opt,name=httpJSON,proto3" json:"httpJSON,omitempty"` + HttpsJSON []byte `protobuf:"bytes,8,opt,name=httpsJSON,proto3" json:"httpsJSON,omitempty"` + AccessAddrsJSON []byte `protobuf:"bytes,9,opt,name=accessAddrsJSON,proto3" json:"accessAddrsJSON,omitempty"` + AccessAddrs []string `protobuf:"bytes,10,rep,name=accessAddrs,proto3" json:"accessAddrs,omitempty"` +} + +func (x *UserNode) Reset() { + *x = UserNode{} + if protoimpl.UnsafeEnabled { + mi := &file_model_user_node_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UserNode) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UserNode) ProtoMessage() {} + +func (x *UserNode) ProtoReflect() protoreflect.Message { + mi := &file_model_user_node_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 UserNode.ProtoReflect.Descriptor instead. +func (*UserNode) Descriptor() ([]byte, []int) { + return file_model_user_node_proto_rawDescGZIP(), []int{0} +} + +func (x *UserNode) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *UserNode) GetIsOn() bool { + if x != nil { + return x.IsOn + } + return false +} + +func (x *UserNode) GetUniqueId() string { + if x != nil { + return x.UniqueId + } + return "" +} + +func (x *UserNode) GetSecret() string { + if x != nil { + return x.Secret + } + return "" +} + +func (x *UserNode) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UserNode) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *UserNode) GetHttpJSON() []byte { + if x != nil { + return x.HttpJSON + } + return nil +} + +func (x *UserNode) GetHttpsJSON() []byte { + if x != nil { + return x.HttpsJSON + } + return nil +} + +func (x *UserNode) GetAccessAddrsJSON() []byte { + if x != nil { + return x.AccessAddrsJSON + } + return nil +} + +func (x *UserNode) GetAccessAddrs() []string { + if x != nil { + return x.AccessAddrs + } + return nil +} + +var File_model_user_node_proto protoreflect.FileDescriptor + +var file_model_user_node_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6e, 0x6f, 0x64, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x9e, 0x02, 0x0a, 0x08, + 0x55, 0x73, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6e, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, + 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x75, 0x6e, 0x69, 0x71, 0x75, 0x65, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x72, + 0x65, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, + 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x74, 0x74, 0x70, 0x4a, 0x53, + 0x4f, 0x4e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x68, 0x74, 0x74, 0x70, 0x4a, 0x53, + 0x4f, 0x4e, 0x12, 0x1c, 0x0a, 0x09, 0x68, 0x74, 0x74, 0x70, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x68, 0x74, 0x74, 0x70, 0x73, 0x4a, 0x53, 0x4f, 0x4e, + 0x12, 0x28, 0x0a, 0x0f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x41, 0x64, 0x64, 0x72, 0x73, 0x4a, + 0x53, 0x4f, 0x4e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x61, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x41, 0x64, 0x64, 0x72, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x63, + 0x63, 0x65, 0x73, 0x73, 0x41, 0x64, 0x64, 0x72, 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x09, 0x52, + 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x41, 0x64, 0x64, 0x72, 0x73, 0x42, 0x06, 0x5a, 0x04, + 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_model_user_node_proto_rawDescOnce sync.Once + file_model_user_node_proto_rawDescData = file_model_user_node_proto_rawDesc +) + +func file_model_user_node_proto_rawDescGZIP() []byte { + file_model_user_node_proto_rawDescOnce.Do(func() { + file_model_user_node_proto_rawDescData = protoimpl.X.CompressGZIP(file_model_user_node_proto_rawDescData) + }) + return file_model_user_node_proto_rawDescData +} + +var file_model_user_node_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_model_user_node_proto_goTypes = []interface{}{ + (*UserNode)(nil), // 0: pb.UserNode +} +var file_model_user_node_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_model_user_node_proto_init() } +func file_model_user_node_proto_init() { + if File_model_user_node_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_model_user_node_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UserNode); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_model_user_node_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_model_user_node_proto_goTypes, + DependencyIndexes: file_model_user_node_proto_depIdxs, + MessageInfos: file_model_user_node_proto_msgTypes, + }.Build() + File_model_user_node_proto = out.File + file_model_user_node_proto_rawDesc = nil + file_model_user_node_proto_goTypes = nil + file_model_user_node_proto_depIdxs = nil +} diff --git a/pkg/rpc/pb/service_user.pb.go b/pkg/rpc/pb/service_user.pb.go index 694635a..a15efa4 100644 --- a/pkg/rpc/pb/service_user.pb.go +++ b/pkg/rpc/pb/service_user.pb.go @@ -681,6 +681,125 @@ func (x *CheckUsernameResponse) GetExists() bool { return false } +// 登录 +type LoginUserRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` +} + +func (x *LoginUserRequest) Reset() { + *x = LoginUserRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_user_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoginUserRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoginUserRequest) ProtoMessage() {} + +func (x *LoginUserRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_user_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use LoginUserRequest.ProtoReflect.Descriptor instead. +func (*LoginUserRequest) Descriptor() ([]byte, []int) { + return file_service_user_proto_rawDescGZIP(), []int{11} +} + +func (x *LoginUserRequest) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *LoginUserRequest) GetPassword() string { + if x != nil { + return x.Password + } + return "" +} + +type LoginUserResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` + IsOk bool `protobuf:"varint,2,opt,name=isOk,proto3" json:"isOk,omitempty"` + Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` +} + +func (x *LoginUserResponse) Reset() { + *x = LoginUserResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_user_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LoginUserResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LoginUserResponse) ProtoMessage() {} + +func (x *LoginUserResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_user_proto_msgTypes[12] + 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 LoginUserResponse.ProtoReflect.Descriptor instead. +func (*LoginUserResponse) Descriptor() ([]byte, []int) { + return file_service_user_proto_rawDescGZIP(), []int{12} +} + +func (x *LoginUserResponse) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *LoginUserResponse) GetIsOk() bool { + if x != nil { + return x.IsOk + } + return false +} + +func (x *LoginUserResponse) GetMessage() string { + if x != nil { + return x.Message + } + return "" +} + var File_service_user_proto protoreflect.FileDescriptor var file_service_user_proto_rawDesc = []byte{ @@ -747,38 +866,52 @@ var file_service_user_proto_rawDesc = []byte{ 0x6d, 0x65, 0x22, 0x2f, 0x0a, 0x15, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x65, 0x78, 0x69, - 0x73, 0x74, 0x73, 0x32, 0xe4, 0x03, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, - 0x69, 0x63, 0x65, 0x12, 0x3b, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, - 0x72, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x33, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x15, - 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 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, 0x55, - 0x73, 0x65, 0x72, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, - 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, - 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x4d, 0x0a, 0x14, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, - 0x72, 0x73, 0x12, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, - 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 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, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x1b, 0x2e, - 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, - 0x65, 0x72, 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, 0x55, 0x73, 0x65, 0x72, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4a, 0x0a, 0x0f, 0x66, 0x69, 0x6e, 0x64, - 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1a, 0x2e, 0x70, 0x62, - 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, - 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x0d, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, - 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, - 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, - 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, - 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x74, 0x73, 0x22, 0x4a, 0x0a, 0x10, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, + 0x59, 0x0a, 0x11, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 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, 0x12, 0x0a, 0x04, + 0x69, 0x73, 0x4f, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6b, + 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x32, 0x9e, 0x04, 0x0a, 0x0b, 0x55, + 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3b, 0x0a, 0x0a, 0x63, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x33, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x55, 0x73, 0x65, 0x72, 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, 0x55, 0x73, 0x65, 0x72, 0x12, 0x15, 0x2e, 0x70, 0x62, 0x2e, + 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, + 0x73, 0x12, 0x4d, 0x0a, 0x14, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, + 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x43, + 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, + 0x65, 0x72, 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, 0x55, + 0x73, 0x65, 0x72, 0x73, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 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, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x4a, 0x0a, 0x0f, 0x66, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, + 0x65, 0x72, 0x12, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, + 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, + 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, 0x0d, 0x63, + 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x2e, 0x70, + 0x62, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x65, 0x63, + 0x6b, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x38, 0x0a, 0x09, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x12, 0x14, + 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, + 0x73, 0x65, 0x72, 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 ( @@ -793,7 +926,7 @@ func file_service_user_proto_rawDescGZIP() []byte { return file_service_user_proto_rawDescData } -var file_service_user_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_service_user_proto_msgTypes = make([]protoimpl.MessageInfo, 13) var file_service_user_proto_goTypes = []interface{}{ (*CreateUserRequest)(nil), // 0: pb.CreateUserRequest (*CreateUserResponse)(nil), // 1: pb.CreateUserResponse @@ -806,13 +939,15 @@ var file_service_user_proto_goTypes = []interface{}{ (*FindEnabledUserResponse)(nil), // 8: pb.FindEnabledUserResponse (*CheckUsernameRequest)(nil), // 9: pb.CheckUsernameRequest (*CheckUsernameResponse)(nil), // 10: pb.CheckUsernameResponse - (*User)(nil), // 11: pb.User - (*RPCSuccess)(nil), // 12: pb.RPCSuccess - (*RPCCountResponse)(nil), // 13: pb.RPCCountResponse + (*LoginUserRequest)(nil), // 11: pb.LoginUserRequest + (*LoginUserResponse)(nil), // 12: pb.LoginUserResponse + (*User)(nil), // 13: pb.User + (*RPCSuccess)(nil), // 14: pb.RPCSuccess + (*RPCCountResponse)(nil), // 15: pb.RPCCountResponse } var file_service_user_proto_depIdxs = []int32{ - 11, // 0: pb.ListEnabledUsersResponse.users:type_name -> pb.User - 11, // 1: pb.FindEnabledUserResponse.user:type_name -> pb.User + 13, // 0: pb.ListEnabledUsersResponse.users:type_name -> pb.User + 13, // 1: pb.FindEnabledUserResponse.user:type_name -> pb.User 0, // 2: pb.UserService.createUser:input_type -> pb.CreateUserRequest 2, // 3: pb.UserService.updateUser:input_type -> pb.UpdateUserRequest 3, // 4: pb.UserService.deleteUser:input_type -> pb.DeleteUserRequest @@ -820,15 +955,17 @@ var file_service_user_proto_depIdxs = []int32{ 5, // 6: pb.UserService.listEnabledUsers:input_type -> pb.ListEnabledUsersRequest 7, // 7: pb.UserService.findEnabledUser:input_type -> pb.FindEnabledUserRequest 9, // 8: pb.UserService.checkUsername:input_type -> pb.CheckUsernameRequest - 1, // 9: pb.UserService.createUser:output_type -> pb.CreateUserResponse - 12, // 10: pb.UserService.updateUser:output_type -> pb.RPCSuccess - 12, // 11: pb.UserService.deleteUser:output_type -> pb.RPCSuccess - 13, // 12: pb.UserService.countAllEnabledUsers:output_type -> pb.RPCCountResponse - 6, // 13: pb.UserService.listEnabledUsers:output_type -> pb.ListEnabledUsersResponse - 8, // 14: pb.UserService.findEnabledUser:output_type -> pb.FindEnabledUserResponse - 10, // 15: pb.UserService.checkUsername:output_type -> pb.CheckUsernameResponse - 9, // [9:16] is the sub-list for method output_type - 2, // [2:9] is the sub-list for method input_type + 11, // 9: pb.UserService.loginUser:input_type -> pb.LoginUserRequest + 1, // 10: pb.UserService.createUser:output_type -> pb.CreateUserResponse + 14, // 11: pb.UserService.updateUser:output_type -> pb.RPCSuccess + 14, // 12: pb.UserService.deleteUser:output_type -> pb.RPCSuccess + 15, // 13: pb.UserService.countAllEnabledUsers:output_type -> pb.RPCCountResponse + 6, // 14: pb.UserService.listEnabledUsers:output_type -> pb.ListEnabledUsersResponse + 8, // 15: pb.UserService.findEnabledUser:output_type -> pb.FindEnabledUserResponse + 10, // 16: pb.UserService.checkUsername:output_type -> pb.CheckUsernameResponse + 12, // 17: pb.UserService.loginUser:output_type -> pb.LoginUserResponse + 10, // [10:18] is the sub-list for method output_type + 2, // [2:10] 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 @@ -974,6 +1111,30 @@ func file_service_user_proto_init() { return nil } } + file_service_user_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoginUserRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_user_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LoginUserResponse); 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{ @@ -981,7 +1142,7 @@ func file_service_user_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_service_user_proto_rawDesc, NumEnums: 0, - NumMessages: 11, + NumMessages: 13, NumExtensions: 0, NumServices: 1, }, @@ -1021,6 +1182,8 @@ type UserServiceClient interface { FindEnabledUser(ctx context.Context, in *FindEnabledUserRequest, opts ...grpc.CallOption) (*FindEnabledUserResponse, error) // 检查用户名是否存在 CheckUsername(ctx context.Context, in *CheckUsernameRequest, opts ...grpc.CallOption) (*CheckUsernameResponse, error) + // 登录 + LoginUser(ctx context.Context, in *LoginUserRequest, opts ...grpc.CallOption) (*LoginUserResponse, error) } type userServiceClient struct { @@ -1094,6 +1257,15 @@ func (c *userServiceClient) CheckUsername(ctx context.Context, in *CheckUsername return out, nil } +func (c *userServiceClient) LoginUser(ctx context.Context, in *LoginUserRequest, opts ...grpc.CallOption) (*LoginUserResponse, error) { + out := new(LoginUserResponse) + err := c.cc.Invoke(ctx, "/pb.UserService/loginUser", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // UserServiceServer is the server API for UserService service. type UserServiceServer interface { // 创建用户 @@ -1110,6 +1282,8 @@ type UserServiceServer interface { FindEnabledUser(context.Context, *FindEnabledUserRequest) (*FindEnabledUserResponse, error) // 检查用户名是否存在 CheckUsername(context.Context, *CheckUsernameRequest) (*CheckUsernameResponse, error) + // 登录 + LoginUser(context.Context, *LoginUserRequest) (*LoginUserResponse, error) } // UnimplementedUserServiceServer can be embedded to have forward compatible implementations. @@ -1137,6 +1311,9 @@ func (*UnimplementedUserServiceServer) FindEnabledUser(context.Context, *FindEna func (*UnimplementedUserServiceServer) CheckUsername(context.Context, *CheckUsernameRequest) (*CheckUsernameResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CheckUsername not implemented") } +func (*UnimplementedUserServiceServer) LoginUser(context.Context, *LoginUserRequest) (*LoginUserResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LoginUser not implemented") +} func RegisterUserServiceServer(s *grpc.Server, srv UserServiceServer) { s.RegisterService(&_UserService_serviceDesc, srv) @@ -1268,6 +1445,24 @@ func _UserService_CheckUsername_Handler(srv interface{}, ctx context.Context, de return interceptor(ctx, in, info, handler) } +func _UserService_LoginUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LoginUserRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).LoginUser(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.UserService/LoginUser", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).LoginUser(ctx, req.(*LoginUserRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _UserService_serviceDesc = grpc.ServiceDesc{ ServiceName: "pb.UserService", HandlerType: (*UserServiceServer)(nil), @@ -1300,6 +1495,10 @@ var _UserService_serviceDesc = grpc.ServiceDesc{ MethodName: "checkUsername", Handler: _UserService_CheckUsername_Handler, }, + { + MethodName: "loginUser", + Handler: _UserService_LoginUser_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "service_user.proto", diff --git a/pkg/rpc/pb/service_user_node.pb.go b/pkg/rpc/pb/service_user_node.pb.go new file mode 100644 index 0000000..c990ae7 --- /dev/null +++ b/pkg/rpc/pb/service_user_node.pb.go @@ -0,0 +1,1427 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.25.0 +// protoc v3.12.3 +// source: service_user_node.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 CreateUserNodeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + HttpJSON []byte `protobuf:"bytes,3,opt,name=httpJSON,proto3" json:"httpJSON,omitempty"` + HttpsJSON []byte `protobuf:"bytes,4,opt,name=httpsJSON,proto3" json:"httpsJSON,omitempty"` + AccessAddrsJSON []byte `protobuf:"bytes,5,opt,name=accessAddrsJSON,proto3" json:"accessAddrsJSON,omitempty"` + IsOn bool `protobuf:"varint,6,opt,name=isOn,proto3" json:"isOn,omitempty"` +} + +func (x *CreateUserNodeRequest) Reset() { + *x = CreateUserNodeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_user_node_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateUserNodeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateUserNodeRequest) ProtoMessage() {} + +func (x *CreateUserNodeRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_user_node_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 CreateUserNodeRequest.ProtoReflect.Descriptor instead. +func (*CreateUserNodeRequest) Descriptor() ([]byte, []int) { + return file_service_user_node_proto_rawDescGZIP(), []int{0} +} + +func (x *CreateUserNodeRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *CreateUserNodeRequest) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *CreateUserNodeRequest) GetHttpJSON() []byte { + if x != nil { + return x.HttpJSON + } + return nil +} + +func (x *CreateUserNodeRequest) GetHttpsJSON() []byte { + if x != nil { + return x.HttpsJSON + } + return nil +} + +func (x *CreateUserNodeRequest) GetAccessAddrsJSON() []byte { + if x != nil { + return x.AccessAddrsJSON + } + return nil +} + +func (x *CreateUserNodeRequest) GetIsOn() bool { + if x != nil { + return x.IsOn + } + return false +} + +type CreateUserNodeResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeId int64 `protobuf:"varint,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` +} + +func (x *CreateUserNodeResponse) Reset() { + *x = CreateUserNodeResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_user_node_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateUserNodeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateUserNodeResponse) ProtoMessage() {} + +func (x *CreateUserNodeResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_user_node_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 CreateUserNodeResponse.ProtoReflect.Descriptor instead. +func (*CreateUserNodeResponse) Descriptor() ([]byte, []int) { + return file_service_user_node_proto_rawDescGZIP(), []int{1} +} + +func (x *CreateUserNodeResponse) GetNodeId() int64 { + if x != nil { + return x.NodeId + } + return 0 +} + +// 修改用户节点 +type UpdateUserNodeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeId int64 `protobuf:"varint,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` + HttpJSON []byte `protobuf:"bytes,4,opt,name=httpJSON,proto3" json:"httpJSON,omitempty"` + HttpsJSON []byte `protobuf:"bytes,5,opt,name=httpsJSON,proto3" json:"httpsJSON,omitempty"` + AccessAddrsJSON []byte `protobuf:"bytes,6,opt,name=accessAddrsJSON,proto3" json:"accessAddrsJSON,omitempty"` + IsOn bool `protobuf:"varint,7,opt,name=isOn,proto3" json:"isOn,omitempty"` +} + +func (x *UpdateUserNodeRequest) Reset() { + *x = UpdateUserNodeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_user_node_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateUserNodeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateUserNodeRequest) ProtoMessage() {} + +func (x *UpdateUserNodeRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_user_node_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 UpdateUserNodeRequest.ProtoReflect.Descriptor instead. +func (*UpdateUserNodeRequest) Descriptor() ([]byte, []int) { + return file_service_user_node_proto_rawDescGZIP(), []int{2} +} + +func (x *UpdateUserNodeRequest) GetNodeId() int64 { + if x != nil { + return x.NodeId + } + return 0 +} + +func (x *UpdateUserNodeRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *UpdateUserNodeRequest) GetDescription() string { + if x != nil { + return x.Description + } + return "" +} + +func (x *UpdateUserNodeRequest) GetHttpJSON() []byte { + if x != nil { + return x.HttpJSON + } + return nil +} + +func (x *UpdateUserNodeRequest) GetHttpsJSON() []byte { + if x != nil { + return x.HttpsJSON + } + return nil +} + +func (x *UpdateUserNodeRequest) GetAccessAddrsJSON() []byte { + if x != nil { + return x.AccessAddrsJSON + } + return nil +} + +func (x *UpdateUserNodeRequest) GetIsOn() bool { + if x != nil { + return x.IsOn + } + return false +} + +// 删除用户节点 +type DeleteUserNodeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeId int64 `protobuf:"varint,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` +} + +func (x *DeleteUserNodeRequest) Reset() { + *x = DeleteUserNodeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_user_node_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteUserNodeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteUserNodeRequest) ProtoMessage() {} + +func (x *DeleteUserNodeRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_user_node_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 DeleteUserNodeRequest.ProtoReflect.Descriptor instead. +func (*DeleteUserNodeRequest) Descriptor() ([]byte, []int) { + return file_service_user_node_proto_rawDescGZIP(), []int{3} +} + +func (x *DeleteUserNodeRequest) GetNodeId() int64 { + if x != nil { + return x.NodeId + } + return 0 +} + +// 列出所有可用用户节点 +type FindAllEnabledUserNodesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *FindAllEnabledUserNodesRequest) Reset() { + *x = FindAllEnabledUserNodesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_user_node_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindAllEnabledUserNodesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindAllEnabledUserNodesRequest) ProtoMessage() {} + +func (x *FindAllEnabledUserNodesRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_user_node_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 FindAllEnabledUserNodesRequest.ProtoReflect.Descriptor instead. +func (*FindAllEnabledUserNodesRequest) Descriptor() ([]byte, []int) { + return file_service_user_node_proto_rawDescGZIP(), []int{4} +} + +type FindAllEnabledUserNodesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Nodes []*UserNode `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"` +} + +func (x *FindAllEnabledUserNodesResponse) Reset() { + *x = FindAllEnabledUserNodesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_user_node_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindAllEnabledUserNodesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindAllEnabledUserNodesResponse) ProtoMessage() {} + +func (x *FindAllEnabledUserNodesResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_user_node_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 FindAllEnabledUserNodesResponse.ProtoReflect.Descriptor instead. +func (*FindAllEnabledUserNodesResponse) Descriptor() ([]byte, []int) { + return file_service_user_node_proto_rawDescGZIP(), []int{5} +} + +func (x *FindAllEnabledUserNodesResponse) GetNodes() []*UserNode { + if x != nil { + return x.Nodes + } + return nil +} + +// 计算用户节点数量 +type CountAllEnabledUserNodesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *CountAllEnabledUserNodesRequest) Reset() { + *x = CountAllEnabledUserNodesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_user_node_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CountAllEnabledUserNodesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CountAllEnabledUserNodesRequest) ProtoMessage() {} + +func (x *CountAllEnabledUserNodesRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_user_node_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 CountAllEnabledUserNodesRequest.ProtoReflect.Descriptor instead. +func (*CountAllEnabledUserNodesRequest) Descriptor() ([]byte, []int) { + return file_service_user_node_proto_rawDescGZIP(), []int{6} +} + +// 列出单页的用户节点 +type ListEnabledUserNodesRequest 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 *ListEnabledUserNodesRequest) Reset() { + *x = ListEnabledUserNodesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_user_node_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListEnabledUserNodesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListEnabledUserNodesRequest) ProtoMessage() {} + +func (x *ListEnabledUserNodesRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_user_node_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 ListEnabledUserNodesRequest.ProtoReflect.Descriptor instead. +func (*ListEnabledUserNodesRequest) Descriptor() ([]byte, []int) { + return file_service_user_node_proto_rawDescGZIP(), []int{7} +} + +func (x *ListEnabledUserNodesRequest) GetOffset() int64 { + if x != nil { + return x.Offset + } + return 0 +} + +func (x *ListEnabledUserNodesRequest) GetSize() int64 { + if x != nil { + return x.Size + } + return 0 +} + +type ListEnabledUserNodesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Nodes []*UserNode `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"` +} + +func (x *ListEnabledUserNodesResponse) Reset() { + *x = ListEnabledUserNodesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_user_node_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListEnabledUserNodesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListEnabledUserNodesResponse) ProtoMessage() {} + +func (x *ListEnabledUserNodesResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_user_node_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 ListEnabledUserNodesResponse.ProtoReflect.Descriptor instead. +func (*ListEnabledUserNodesResponse) Descriptor() ([]byte, []int) { + return file_service_user_node_proto_rawDescGZIP(), []int{8} +} + +func (x *ListEnabledUserNodesResponse) GetNodes() []*UserNode { + if x != nil { + return x.Nodes + } + return nil +} + +// 根据ID查找节点 +type FindEnabledUserNodeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + NodeId int64 `protobuf:"varint,1,opt,name=nodeId,proto3" json:"nodeId,omitempty"` +} + +func (x *FindEnabledUserNodeRequest) Reset() { + *x = FindEnabledUserNodeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_user_node_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindEnabledUserNodeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindEnabledUserNodeRequest) ProtoMessage() {} + +func (x *FindEnabledUserNodeRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_user_node_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 FindEnabledUserNodeRequest.ProtoReflect.Descriptor instead. +func (*FindEnabledUserNodeRequest) Descriptor() ([]byte, []int) { + return file_service_user_node_proto_rawDescGZIP(), []int{9} +} + +func (x *FindEnabledUserNodeRequest) GetNodeId() int64 { + if x != nil { + return x.NodeId + } + return 0 +} + +type FindEnabledUserNodeResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Node *UserNode `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"` +} + +func (x *FindEnabledUserNodeResponse) Reset() { + *x = FindEnabledUserNodeResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_user_node_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindEnabledUserNodeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindEnabledUserNodeResponse) ProtoMessage() {} + +func (x *FindEnabledUserNodeResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_user_node_proto_msgTypes[10] + 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 FindEnabledUserNodeResponse.ProtoReflect.Descriptor instead. +func (*FindEnabledUserNodeResponse) Descriptor() ([]byte, []int) { + return file_service_user_node_proto_rawDescGZIP(), []int{10} +} + +func (x *FindEnabledUserNodeResponse) GetNode() *UserNode { + if x != nil { + return x.Node + } + return nil +} + +// 获取当前用户节点 +type FindCurrentUserNodeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *FindCurrentUserNodeRequest) Reset() { + *x = FindCurrentUserNodeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_service_user_node_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindCurrentUserNodeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindCurrentUserNodeRequest) ProtoMessage() {} + +func (x *FindCurrentUserNodeRequest) ProtoReflect() protoreflect.Message { + mi := &file_service_user_node_proto_msgTypes[11] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FindCurrentUserNodeRequest.ProtoReflect.Descriptor instead. +func (*FindCurrentUserNodeRequest) Descriptor() ([]byte, []int) { + return file_service_user_node_proto_rawDescGZIP(), []int{11} +} + +type FindCurrentUserNodeResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Node *UserNode `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"` +} + +func (x *FindCurrentUserNodeResponse) Reset() { + *x = FindCurrentUserNodeResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_service_user_node_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FindCurrentUserNodeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FindCurrentUserNodeResponse) ProtoMessage() {} + +func (x *FindCurrentUserNodeResponse) ProtoReflect() protoreflect.Message { + mi := &file_service_user_node_proto_msgTypes[12] + 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 FindCurrentUserNodeResponse.ProtoReflect.Descriptor instead. +func (*FindCurrentUserNodeResponse) Descriptor() ([]byte, []int) { + return file_service_user_node_proto_rawDescGZIP(), []int{12} +} + +func (x *FindCurrentUserNodeResponse) GetNode() *UserNode { + if x != nil { + return x.Node + } + return nil +} + +var File_service_user_node_proto protoreflect.FileDescriptor + +var file_service_user_node_proto_rawDesc = []byte{ + 0x0a, 0x17, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6e, + 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x15, 0x6d, + 0x6f, 0x64, 0x65, 0x6c, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x12, 0x72, 0x70, 0x63, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc5, 0x01, 0x0a, 0x15, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 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, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x74, 0x74, 0x70, + 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x68, 0x74, 0x74, 0x70, + 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x1c, 0x0a, 0x09, 0x68, 0x74, 0x74, 0x70, 0x73, 0x4a, 0x53, 0x4f, + 0x4e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x68, 0x74, 0x74, 0x70, 0x73, 0x4a, 0x53, + 0x4f, 0x4e, 0x12, 0x28, 0x0a, 0x0f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x41, 0x64, 0x64, 0x72, + 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x61, 0x63, 0x63, + 0x65, 0x73, 0x73, 0x41, 0x64, 0x64, 0x72, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x12, 0x0a, 0x04, + 0x69, 0x73, 0x4f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, 0x4f, 0x6e, + 0x22, 0x30, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x6f, + 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x6f, + 0x64, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, + 0x49, 0x64, 0x22, 0xdd, 0x01, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, + 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, + 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, + 0x64, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x74, + 0x74, 0x70, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x68, 0x74, + 0x74, 0x70, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x1c, 0x0a, 0x09, 0x68, 0x74, 0x74, 0x70, 0x73, 0x4a, + 0x53, 0x4f, 0x4e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x68, 0x74, 0x74, 0x70, 0x73, + 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x28, 0x0a, 0x0f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x41, 0x64, + 0x64, 0x72, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0f, 0x61, + 0x63, 0x63, 0x65, 0x73, 0x73, 0x41, 0x64, 0x64, 0x72, 0x73, 0x4a, 0x53, 0x4f, 0x4e, 0x12, 0x12, + 0x0a, 0x04, 0x69, 0x73, 0x4f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x69, 0x73, + 0x4f, 0x6e, 0x22, 0x2f, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, + 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x6e, + 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, 0x64, + 0x65, 0x49, 0x64, 0x22, 0x20, 0x0a, 0x1e, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, + 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x45, 0x0a, 0x1f, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, + 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x05, 0x6e, 0x6f, 0x64, 0x65, + 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, + 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x22, 0x21, 0x0a, 0x1f, + 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, + 0x73, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, + 0x49, 0x0a, 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, + 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 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, 0x42, 0x0a, 0x1c, 0x4c, 0x69, + 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x6f, 0x64, + 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x05, 0x6e, 0x6f, + 0x64, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x55, + 0x73, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x05, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x22, 0x34, + 0x0a, 0x1a, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, + 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, + 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x6e, 0x6f, + 0x64, 0x65, 0x49, 0x64, 0x22, 0x3f, 0x0a, 0x1b, 0x46, 0x69, 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, + 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x20, 0x0a, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x52, + 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x22, 0x1c, 0x0a, 0x1a, 0x46, 0x69, 0x6e, 0x64, 0x43, 0x75, 0x72, + 0x72, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x22, 0x3f, 0x0a, 0x1b, 0x46, 0x69, 0x6e, 0x64, 0x43, 0x75, 0x72, 0x72, 0x65, + 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x20, 0x0a, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x04, + 0x6e, 0x6f, 0x64, 0x65, 0x32, 0x9a, 0x05, 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x6f, 0x64, + 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x47, 0x0a, 0x0e, 0x63, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x2e, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x3b, 0x0a, 0x0e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4e, + 0x6f, 0x64, 0x65, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, + 0x73, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 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, 0x4e, 0x6f, 0x64, 0x65, + 0x12, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, + 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0e, 0x2e, 0x70, 0x62, + 0x2e, 0x52, 0x50, 0x43, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x62, 0x0a, 0x17, 0x66, + 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, + 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x22, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, + 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x6f, + 0x64, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x70, 0x62, 0x2e, + 0x46, 0x69, 0x6e, 0x64, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, + 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x55, 0x0a, 0x18, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x45, 0x6e, 0x61, 0x62, 0x6c, + 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 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, 0x4e, 0x6f, 0x64, 0x65, 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, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x1f, + 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, + 0x73, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 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, 0x4e, 0x6f, 0x64, 0x65, 0x73, 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, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, + 0x6e, 0x64, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x6f, 0x64, + 0x65, 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, 0x4e, 0x6f, 0x64, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x13, 0x66, 0x69, 0x6e, + 0x64, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, + 0x12, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, + 0x74, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x46, 0x69, 0x6e, 0x64, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, + 0x74, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 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_node_proto_rawDescOnce sync.Once + file_service_user_node_proto_rawDescData = file_service_user_node_proto_rawDesc +) + +func file_service_user_node_proto_rawDescGZIP() []byte { + file_service_user_node_proto_rawDescOnce.Do(func() { + file_service_user_node_proto_rawDescData = protoimpl.X.CompressGZIP(file_service_user_node_proto_rawDescData) + }) + return file_service_user_node_proto_rawDescData +} + +var file_service_user_node_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_service_user_node_proto_goTypes = []interface{}{ + (*CreateUserNodeRequest)(nil), // 0: pb.CreateUserNodeRequest + (*CreateUserNodeResponse)(nil), // 1: pb.CreateUserNodeResponse + (*UpdateUserNodeRequest)(nil), // 2: pb.UpdateUserNodeRequest + (*DeleteUserNodeRequest)(nil), // 3: pb.DeleteUserNodeRequest + (*FindAllEnabledUserNodesRequest)(nil), // 4: pb.FindAllEnabledUserNodesRequest + (*FindAllEnabledUserNodesResponse)(nil), // 5: pb.FindAllEnabledUserNodesResponse + (*CountAllEnabledUserNodesRequest)(nil), // 6: pb.CountAllEnabledUserNodesRequest + (*ListEnabledUserNodesRequest)(nil), // 7: pb.ListEnabledUserNodesRequest + (*ListEnabledUserNodesResponse)(nil), // 8: pb.ListEnabledUserNodesResponse + (*FindEnabledUserNodeRequest)(nil), // 9: pb.FindEnabledUserNodeRequest + (*FindEnabledUserNodeResponse)(nil), // 10: pb.FindEnabledUserNodeResponse + (*FindCurrentUserNodeRequest)(nil), // 11: pb.FindCurrentUserNodeRequest + (*FindCurrentUserNodeResponse)(nil), // 12: pb.FindCurrentUserNodeResponse + (*UserNode)(nil), // 13: pb.UserNode + (*RPCSuccess)(nil), // 14: pb.RPCSuccess + (*RPCCountResponse)(nil), // 15: pb.RPCCountResponse +} +var file_service_user_node_proto_depIdxs = []int32{ + 13, // 0: pb.FindAllEnabledUserNodesResponse.nodes:type_name -> pb.UserNode + 13, // 1: pb.ListEnabledUserNodesResponse.nodes:type_name -> pb.UserNode + 13, // 2: pb.FindEnabledUserNodeResponse.node:type_name -> pb.UserNode + 13, // 3: pb.FindCurrentUserNodeResponse.node:type_name -> pb.UserNode + 0, // 4: pb.UserNodeService.createUserNode:input_type -> pb.CreateUserNodeRequest + 2, // 5: pb.UserNodeService.updateUserNode:input_type -> pb.UpdateUserNodeRequest + 3, // 6: pb.UserNodeService.deleteUserNode:input_type -> pb.DeleteUserNodeRequest + 4, // 7: pb.UserNodeService.findAllEnabledUserNodes:input_type -> pb.FindAllEnabledUserNodesRequest + 6, // 8: pb.UserNodeService.countAllEnabledUserNodes:input_type -> pb.CountAllEnabledUserNodesRequest + 7, // 9: pb.UserNodeService.listEnabledUserNodes:input_type -> pb.ListEnabledUserNodesRequest + 9, // 10: pb.UserNodeService.findEnabledUserNode:input_type -> pb.FindEnabledUserNodeRequest + 11, // 11: pb.UserNodeService.findCurrentUserNode:input_type -> pb.FindCurrentUserNodeRequest + 1, // 12: pb.UserNodeService.createUserNode:output_type -> pb.CreateUserNodeResponse + 14, // 13: pb.UserNodeService.updateUserNode:output_type -> pb.RPCSuccess + 14, // 14: pb.UserNodeService.deleteUserNode:output_type -> pb.RPCSuccess + 5, // 15: pb.UserNodeService.findAllEnabledUserNodes:output_type -> pb.FindAllEnabledUserNodesResponse + 15, // 16: pb.UserNodeService.countAllEnabledUserNodes:output_type -> pb.RPCCountResponse + 8, // 17: pb.UserNodeService.listEnabledUserNodes:output_type -> pb.ListEnabledUserNodesResponse + 10, // 18: pb.UserNodeService.findEnabledUserNode:output_type -> pb.FindEnabledUserNodeResponse + 12, // 19: pb.UserNodeService.findCurrentUserNode:output_type -> pb.FindCurrentUserNodeResponse + 12, // [12:20] is the sub-list for method output_type + 4, // [4:12] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name +} + +func init() { file_service_user_node_proto_init() } +func file_service_user_node_proto_init() { + if File_service_user_node_proto != nil { + return + } + file_model_user_node_proto_init() + file_rpc_messages_proto_init() + if !protoimpl.UnsafeEnabled { + file_service_user_node_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateUserNodeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_user_node_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateUserNodeResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_user_node_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateUserNodeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_user_node_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteUserNodeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_user_node_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindAllEnabledUserNodesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_user_node_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindAllEnabledUserNodesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_user_node_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CountAllEnabledUserNodesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_user_node_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListEnabledUserNodesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_user_node_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListEnabledUserNodesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_user_node_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindEnabledUserNodeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_user_node_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindEnabledUserNodeResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_user_node_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindCurrentUserNodeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_service_user_node_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FindCurrentUserNodeResponse); 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_node_proto_rawDesc, + NumEnums: 0, + NumMessages: 13, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_service_user_node_proto_goTypes, + DependencyIndexes: file_service_user_node_proto_depIdxs, + MessageInfos: file_service_user_node_proto_msgTypes, + }.Build() + File_service_user_node_proto = out.File + file_service_user_node_proto_rawDesc = nil + file_service_user_node_proto_goTypes = nil + file_service_user_node_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 + +// UserNodeServiceClient is the client API for UserNodeService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type UserNodeServiceClient interface { + // 创建用户节点 + CreateUserNode(ctx context.Context, in *CreateUserNodeRequest, opts ...grpc.CallOption) (*CreateUserNodeResponse, error) + // 修改用户节点 + UpdateUserNode(ctx context.Context, in *UpdateUserNodeRequest, opts ...grpc.CallOption) (*RPCSuccess, error) + // 删除用户节点 + DeleteUserNode(ctx context.Context, in *DeleteUserNodeRequest, opts ...grpc.CallOption) (*RPCSuccess, error) + // 列出所有可用用户节点 + FindAllEnabledUserNodes(ctx context.Context, in *FindAllEnabledUserNodesRequest, opts ...grpc.CallOption) (*FindAllEnabledUserNodesResponse, error) + // 计算用户节点数量 + CountAllEnabledUserNodes(ctx context.Context, in *CountAllEnabledUserNodesRequest, opts ...grpc.CallOption) (*RPCCountResponse, error) + // 列出单页的用户节点 + ListEnabledUserNodes(ctx context.Context, in *ListEnabledUserNodesRequest, opts ...grpc.CallOption) (*ListEnabledUserNodesResponse, error) + // 根据ID查找节点 + FindEnabledUserNode(ctx context.Context, in *FindEnabledUserNodeRequest, opts ...grpc.CallOption) (*FindEnabledUserNodeResponse, error) + // 获取当前用户节点 + FindCurrentUserNode(ctx context.Context, in *FindCurrentUserNodeRequest, opts ...grpc.CallOption) (*FindCurrentUserNodeResponse, error) +} + +type userNodeServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewUserNodeServiceClient(cc grpc.ClientConnInterface) UserNodeServiceClient { + return &userNodeServiceClient{cc} +} + +func (c *userNodeServiceClient) CreateUserNode(ctx context.Context, in *CreateUserNodeRequest, opts ...grpc.CallOption) (*CreateUserNodeResponse, error) { + out := new(CreateUserNodeResponse) + err := c.cc.Invoke(ctx, "/pb.UserNodeService/createUserNode", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userNodeServiceClient) UpdateUserNode(ctx context.Context, in *UpdateUserNodeRequest, opts ...grpc.CallOption) (*RPCSuccess, error) { + out := new(RPCSuccess) + err := c.cc.Invoke(ctx, "/pb.UserNodeService/updateUserNode", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userNodeServiceClient) DeleteUserNode(ctx context.Context, in *DeleteUserNodeRequest, opts ...grpc.CallOption) (*RPCSuccess, error) { + out := new(RPCSuccess) + err := c.cc.Invoke(ctx, "/pb.UserNodeService/deleteUserNode", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userNodeServiceClient) FindAllEnabledUserNodes(ctx context.Context, in *FindAllEnabledUserNodesRequest, opts ...grpc.CallOption) (*FindAllEnabledUserNodesResponse, error) { + out := new(FindAllEnabledUserNodesResponse) + err := c.cc.Invoke(ctx, "/pb.UserNodeService/findAllEnabledUserNodes", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userNodeServiceClient) CountAllEnabledUserNodes(ctx context.Context, in *CountAllEnabledUserNodesRequest, opts ...grpc.CallOption) (*RPCCountResponse, error) { + out := new(RPCCountResponse) + err := c.cc.Invoke(ctx, "/pb.UserNodeService/countAllEnabledUserNodes", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userNodeServiceClient) ListEnabledUserNodes(ctx context.Context, in *ListEnabledUserNodesRequest, opts ...grpc.CallOption) (*ListEnabledUserNodesResponse, error) { + out := new(ListEnabledUserNodesResponse) + err := c.cc.Invoke(ctx, "/pb.UserNodeService/listEnabledUserNodes", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userNodeServiceClient) FindEnabledUserNode(ctx context.Context, in *FindEnabledUserNodeRequest, opts ...grpc.CallOption) (*FindEnabledUserNodeResponse, error) { + out := new(FindEnabledUserNodeResponse) + err := c.cc.Invoke(ctx, "/pb.UserNodeService/findEnabledUserNode", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userNodeServiceClient) FindCurrentUserNode(ctx context.Context, in *FindCurrentUserNodeRequest, opts ...grpc.CallOption) (*FindCurrentUserNodeResponse, error) { + out := new(FindCurrentUserNodeResponse) + err := c.cc.Invoke(ctx, "/pb.UserNodeService/findCurrentUserNode", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// UserNodeServiceServer is the server API for UserNodeService service. +type UserNodeServiceServer interface { + // 创建用户节点 + CreateUserNode(context.Context, *CreateUserNodeRequest) (*CreateUserNodeResponse, error) + // 修改用户节点 + UpdateUserNode(context.Context, *UpdateUserNodeRequest) (*RPCSuccess, error) + // 删除用户节点 + DeleteUserNode(context.Context, *DeleteUserNodeRequest) (*RPCSuccess, error) + // 列出所有可用用户节点 + FindAllEnabledUserNodes(context.Context, *FindAllEnabledUserNodesRequest) (*FindAllEnabledUserNodesResponse, error) + // 计算用户节点数量 + CountAllEnabledUserNodes(context.Context, *CountAllEnabledUserNodesRequest) (*RPCCountResponse, error) + // 列出单页的用户节点 + ListEnabledUserNodes(context.Context, *ListEnabledUserNodesRequest) (*ListEnabledUserNodesResponse, error) + // 根据ID查找节点 + FindEnabledUserNode(context.Context, *FindEnabledUserNodeRequest) (*FindEnabledUserNodeResponse, error) + // 获取当前用户节点 + FindCurrentUserNode(context.Context, *FindCurrentUserNodeRequest) (*FindCurrentUserNodeResponse, error) +} + +// UnimplementedUserNodeServiceServer can be embedded to have forward compatible implementations. +type UnimplementedUserNodeServiceServer struct { +} + +func (*UnimplementedUserNodeServiceServer) CreateUserNode(context.Context, *CreateUserNodeRequest) (*CreateUserNodeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateUserNode not implemented") +} +func (*UnimplementedUserNodeServiceServer) UpdateUserNode(context.Context, *UpdateUserNodeRequest) (*RPCSuccess, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateUserNode not implemented") +} +func (*UnimplementedUserNodeServiceServer) DeleteUserNode(context.Context, *DeleteUserNodeRequest) (*RPCSuccess, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteUserNode not implemented") +} +func (*UnimplementedUserNodeServiceServer) FindAllEnabledUserNodes(context.Context, *FindAllEnabledUserNodesRequest) (*FindAllEnabledUserNodesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FindAllEnabledUserNodes not implemented") +} +func (*UnimplementedUserNodeServiceServer) CountAllEnabledUserNodes(context.Context, *CountAllEnabledUserNodesRequest) (*RPCCountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CountAllEnabledUserNodes not implemented") +} +func (*UnimplementedUserNodeServiceServer) ListEnabledUserNodes(context.Context, *ListEnabledUserNodesRequest) (*ListEnabledUserNodesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListEnabledUserNodes not implemented") +} +func (*UnimplementedUserNodeServiceServer) FindEnabledUserNode(context.Context, *FindEnabledUserNodeRequest) (*FindEnabledUserNodeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FindEnabledUserNode not implemented") +} +func (*UnimplementedUserNodeServiceServer) FindCurrentUserNode(context.Context, *FindCurrentUserNodeRequest) (*FindCurrentUserNodeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method FindCurrentUserNode not implemented") +} + +func RegisterUserNodeServiceServer(s *grpc.Server, srv UserNodeServiceServer) { + s.RegisterService(&_UserNodeService_serviceDesc, srv) +} + +func _UserNodeService_CreateUserNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateUserNodeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserNodeServiceServer).CreateUserNode(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.UserNodeService/CreateUserNode", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserNodeServiceServer).CreateUserNode(ctx, req.(*CreateUserNodeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserNodeService_UpdateUserNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateUserNodeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserNodeServiceServer).UpdateUserNode(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.UserNodeService/UpdateUserNode", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserNodeServiceServer).UpdateUserNode(ctx, req.(*UpdateUserNodeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserNodeService_DeleteUserNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteUserNodeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserNodeServiceServer).DeleteUserNode(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.UserNodeService/DeleteUserNode", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserNodeServiceServer).DeleteUserNode(ctx, req.(*DeleteUserNodeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserNodeService_FindAllEnabledUserNodes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FindAllEnabledUserNodesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserNodeServiceServer).FindAllEnabledUserNodes(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.UserNodeService/FindAllEnabledUserNodes", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserNodeServiceServer).FindAllEnabledUserNodes(ctx, req.(*FindAllEnabledUserNodesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserNodeService_CountAllEnabledUserNodes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CountAllEnabledUserNodesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserNodeServiceServer).CountAllEnabledUserNodes(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.UserNodeService/CountAllEnabledUserNodes", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserNodeServiceServer).CountAllEnabledUserNodes(ctx, req.(*CountAllEnabledUserNodesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserNodeService_ListEnabledUserNodes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListEnabledUserNodesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserNodeServiceServer).ListEnabledUserNodes(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.UserNodeService/ListEnabledUserNodes", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserNodeServiceServer).ListEnabledUserNodes(ctx, req.(*ListEnabledUserNodesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserNodeService_FindEnabledUserNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FindEnabledUserNodeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserNodeServiceServer).FindEnabledUserNode(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.UserNodeService/FindEnabledUserNode", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserNodeServiceServer).FindEnabledUserNode(ctx, req.(*FindEnabledUserNodeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserNodeService_FindCurrentUserNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(FindCurrentUserNodeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserNodeServiceServer).FindCurrentUserNode(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.UserNodeService/FindCurrentUserNode", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserNodeServiceServer).FindCurrentUserNode(ctx, req.(*FindCurrentUserNodeRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _UserNodeService_serviceDesc = grpc.ServiceDesc{ + ServiceName: "pb.UserNodeService", + HandlerType: (*UserNodeServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "createUserNode", + Handler: _UserNodeService_CreateUserNode_Handler, + }, + { + MethodName: "updateUserNode", + Handler: _UserNodeService_UpdateUserNode_Handler, + }, + { + MethodName: "deleteUserNode", + Handler: _UserNodeService_DeleteUserNode_Handler, + }, + { + MethodName: "findAllEnabledUserNodes", + Handler: _UserNodeService_FindAllEnabledUserNodes_Handler, + }, + { + MethodName: "countAllEnabledUserNodes", + Handler: _UserNodeService_CountAllEnabledUserNodes_Handler, + }, + { + MethodName: "listEnabledUserNodes", + Handler: _UserNodeService_ListEnabledUserNodes_Handler, + }, + { + MethodName: "findEnabledUserNode", + Handler: _UserNodeService_FindEnabledUserNode_Handler, + }, + { + MethodName: "findCurrentUserNode", + Handler: _UserNodeService_FindCurrentUserNode_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "service_user_node.proto", +} diff --git a/pkg/rpc/protos/model_user_node.proto b/pkg/rpc/protos/model_user_node.proto new file mode 100644 index 0000000..6a002c1 --- /dev/null +++ b/pkg/rpc/protos/model_user_node.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; +option go_package = "./pb"; + +package pb; + +message UserNode { + int64 id = 1; + bool isOn = 2; + string uniqueId = 3; + string secret = 4; + string name = 5; + string description = 6; + bytes httpJSON = 7; + bytes httpsJSON = 8; + bytes accessAddrsJSON = 9; + repeated string accessAddrs = 10; +} \ No newline at end of file diff --git a/pkg/rpc/protos/service_user.proto b/pkg/rpc/protos/service_user.proto index 2ed0aa5..4eccae6 100644 --- a/pkg/rpc/protos/service_user.proto +++ b/pkg/rpc/protos/service_user.proto @@ -28,6 +28,9 @@ service UserService { // 检查用户名是否存在 rpc checkUsername (CheckUsernameRequest) returns (CheckUsernameResponse); + + // 登录 + rpc loginUser (LoginUserRequest) returns (LoginUserResponse); } // 创建用户 @@ -95,4 +98,16 @@ message CheckUsernameRequest { message CheckUsernameResponse { bool exists = 1; +} + +// 登录 +message LoginUserRequest { + string username = 1; + string password = 2; +} + +message LoginUserResponse { + int64 userId = 1; + bool isOk = 2; + string message = 3; } \ No newline at end of file diff --git a/pkg/rpc/protos/service_user_node.proto b/pkg/rpc/protos/service_user_node.proto new file mode 100644 index 0000000..5eb6982 --- /dev/null +++ b/pkg/rpc/protos/service_user_node.proto @@ -0,0 +1,104 @@ +syntax = "proto3"; +option go_package = "./pb"; + +package pb; +import "model_user_node.proto"; +import "rpc_messages.proto"; + +service UserNodeService { + // 创建用户节点 + rpc createUserNode (CreateUserNodeRequest) returns (CreateUserNodeResponse); + + // 修改用户节点 + rpc updateUserNode (UpdateUserNodeRequest) returns (RPCSuccess); + + // 删除用户节点 + rpc deleteUserNode (DeleteUserNodeRequest) returns (RPCSuccess); + + // 列出所有可用用户节点 + rpc findAllEnabledUserNodes (FindAllEnabledUserNodesRequest) returns (FindAllEnabledUserNodesResponse); + + // 计算用户节点数量 + rpc countAllEnabledUserNodes (CountAllEnabledUserNodesRequest) returns (RPCCountResponse); + + // 列出单页的用户节点 + rpc listEnabledUserNodes (ListEnabledUserNodesRequest) returns (ListEnabledUserNodesResponse); + + // 根据ID查找节点 + rpc findEnabledUserNode (FindEnabledUserNodeRequest) returns (FindEnabledUserNodeResponse); + + // 获取当前用户节点 + rpc findCurrentUserNode (FindCurrentUserNodeRequest) returns (FindCurrentUserNodeResponse); +} + +// 创建用户节点 +message CreateUserNodeRequest { + string name = 1; + string description = 2; + bytes httpJSON = 3; + bytes httpsJSON = 4; + bytes accessAddrsJSON = 5; + bool isOn = 6; +} + +message CreateUserNodeResponse { + int64 nodeId = 1; +} + +// 修改用户节点 +message UpdateUserNodeRequest { + int64 nodeId = 1; + string name = 2; + string description = 3; + bytes httpJSON = 4; + bytes httpsJSON = 5; + bytes accessAddrsJSON = 6; + bool isOn = 7; +} + +// 删除用户节点 +message DeleteUserNodeRequest { + int64 nodeId = 1; +} + +// 列出所有可用用户节点 +message FindAllEnabledUserNodesRequest { + +} + +message FindAllEnabledUserNodesResponse { + repeated UserNode nodes = 1; +} + +// 计算用户节点数量 +message CountAllEnabledUserNodesRequest { + +} + +// 列出单页的用户节点 +message ListEnabledUserNodesRequest { + int64 offset = 1; + int64 size = 2; +} + +message ListEnabledUserNodesResponse { + repeated UserNode nodes = 1; +} + +// 根据ID查找节点 +message FindEnabledUserNodeRequest { + int64 nodeId = 1; +} + +message FindEnabledUserNodeResponse { + UserNode node = 1; +} + +// 获取当前用户节点 +message FindCurrentUserNodeRequest { + +} + +message FindCurrentUserNodeResponse { + UserNode node = 1; +} \ No newline at end of file diff --git a/pkg/systemconfigs/ui_config.go b/pkg/systemconfigs/admin_ui_config.go similarity index 87% rename from pkg/systemconfigs/ui_config.go rename to pkg/systemconfigs/admin_ui_config.go index 97158eb..d440a40 100644 --- a/pkg/systemconfigs/ui_config.go +++ b/pkg/systemconfigs/admin_ui_config.go @@ -1,7 +1,7 @@ package systemconfigs -// 界面相关配置 -type UIConfig struct { +// 管理员界面相关配置 +type AdminUIConfig struct { ProductName string `json:"productName"` // 产品名 AdminSystemName string `json:"adminSystemName"` // 管理员系统名称 ShowOpenSourceInfo bool `json:"showOpenSourceInfo"` // 是否显示开源信息 diff --git a/pkg/systemconfigs/user_ui_config.go b/pkg/systemconfigs/user_ui_config.go new file mode 100644 index 0000000..2b32fd5 --- /dev/null +++ b/pkg/systemconfigs/user_ui_config.go @@ -0,0 +1,10 @@ +package systemconfigs + +// 用户界面相关配置 +type UserUIConfig struct { + ProductName string `json:"productName"` // 产品名 + UserSystemName string `json:"userSystemName"` // 管理员系统名称 + ShowOpenSourceInfo bool `json:"showOpenSourceInfo"` // 是否显示开源信息 + ShowVersion bool `json:"showVersion"` // 是否显示版本号 + Version string `json:"version"` // 显示的版本号 +}