mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-11-10 17:30:27 +08:00
[用户节点]可以管理用户节点
This commit is contained in:
234
pkg/rpc/pb/model_user_node.pb.go
Normal file
234
pkg/rpc/pb/model_user_node.pb.go
Normal file
@@ -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
|
||||
}
|
||||
@@ -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",
|
||||
|
||||
1427
pkg/rpc/pb/service_user_node.pb.go
Normal file
1427
pkg/rpc/pb/service_user_node.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
17
pkg/rpc/protos/model_user_node.proto
Normal file
17
pkg/rpc/protos/model_user_node.proto
Normal file
@@ -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;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
104
pkg/rpc/protos/service_user_node.proto
Normal file
104
pkg/rpc/protos/service_user_node.proto
Normal file
@@ -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;
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package systemconfigs
|
||||
|
||||
// 界面相关配置
|
||||
type UIConfig struct {
|
||||
// 管理员界面相关配置
|
||||
type AdminUIConfig struct {
|
||||
ProductName string `json:"productName"` // 产品名
|
||||
AdminSystemName string `json:"adminSystemName"` // 管理员系统名称
|
||||
ShowOpenSourceInfo bool `json:"showOpenSourceInfo"` // 是否显示开源信息
|
||||
10
pkg/systemconfigs/user_ui_config.go
Normal file
10
pkg/systemconfigs/user_ui_config.go
Normal file
@@ -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"` // 显示的版本号
|
||||
}
|
||||
Reference in New Issue
Block a user