From 49152cf883f1684a2fc46031227c5b7a08a6438f Mon Sep 17 00:00:00 2001 From: FynnTang Date: Tue, 26 Sep 2023 11:19:10 +0800 Subject: [PATCH] feat: remove --- .../api/v1/authorization/authorization.pb.go | 173 -- .../api/v1/authorization/authorization.proto | 25 - .../api/v1/authorization/role.pb.go | 759 -------- .../api/v1/authorization/role.proto | 119 -- .../api/v1/components/dictionary.pb.go | 169 -- .../api/v1/components/dictionary.proto | 16 - .../api/v1/components/enum.pb.go | 265 --- .../api/v1/components/enum.proto | 39 - .../api/v1/components/schemas.pb.go | 938 --------- .../api/v1/components/schemas.proto | 119 -- protoc-gen-go-crud/api/v1/users/users.pb.go | 1359 -------------- .../api/v1/users/users.pb.validate.go | 1669 ----------------- protoc-gen-go-crud/api/v1/users/users.proto | 200 -- .../api/v1/users/users.swagger.json | 804 -------- .../api/v1/users/users_http.pb.go | 597 ------ .../authorization/deliveries/authorization.go | 23 - .../internal/authorization/deliveries/role.go | 40 - .../authorization/entities/authorization.go | 7 - .../internal/authorization/entities/role.go | 7 - .../repositories/authorization.go | 45 - .../authorization/repositories/role.go | 45 - .../authorization/usecase/authorization.go | 41 - .../internal/authorization/usecase/role.go | 41 - .../internal/users/deliveries/users.go | 72 - .../internal/users/entities/users.go | 7 - .../internal/users/repositories/users.go | 45 - .../internal/users/usecase/users.go | 41 - protoc-gen-go-crud/pkg/database/database.go | 74 - .../pkg/database/entity/base.go | 106 -- protoc-gen-go-crud/pkg/database/entity/id.go | 35 - protoc-gen-go-crud/pkg/database/filters.go | 88 - protoc-gen-go-crud/pkg/third_party/README.md | 1 - .../third_party/protos/errors/errors.proto | 18 - .../protos/google/api/annotations.proto | 31 - .../protos/google/api/client.proto | 101 - .../protos/google/api/field_behavior.proto | 80 - .../third_party/protos/google/api/http.proto | 375 ---- .../protos/google/api/httpbody.proto | 77 - .../protos/google/protobuf/descriptor.proto | 911 --------- .../protos/google/protobuf/duration.proto | 116 -- .../protos/google/protobuf/empty.proto | 52 - .../options/annotations.proto | 44 - .../options/openapiv2.proto | 720 ------- .../pkg/third_party/protos/validate/README.md | 3 - .../protos/validate/validate.proto | 863 --------- 45 files changed, 11360 deletions(-) delete mode 100644 protoc-gen-go-crud/api/v1/authorization/authorization.pb.go delete mode 100644 protoc-gen-go-crud/api/v1/authorization/authorization.proto delete mode 100644 protoc-gen-go-crud/api/v1/authorization/role.pb.go delete mode 100644 protoc-gen-go-crud/api/v1/authorization/role.proto delete mode 100644 protoc-gen-go-crud/api/v1/components/dictionary.pb.go delete mode 100644 protoc-gen-go-crud/api/v1/components/dictionary.proto delete mode 100644 protoc-gen-go-crud/api/v1/components/enum.pb.go delete mode 100644 protoc-gen-go-crud/api/v1/components/enum.proto delete mode 100644 protoc-gen-go-crud/api/v1/components/schemas.pb.go delete mode 100644 protoc-gen-go-crud/api/v1/components/schemas.proto delete mode 100644 protoc-gen-go-crud/api/v1/users/users.pb.go delete mode 100644 protoc-gen-go-crud/api/v1/users/users.pb.validate.go delete mode 100644 protoc-gen-go-crud/api/v1/users/users.proto delete mode 100644 protoc-gen-go-crud/api/v1/users/users.swagger.json delete mode 100644 protoc-gen-go-crud/api/v1/users/users_http.pb.go delete mode 100644 protoc-gen-go-crud/internal/authorization/deliveries/authorization.go delete mode 100644 protoc-gen-go-crud/internal/authorization/deliveries/role.go delete mode 100644 protoc-gen-go-crud/internal/authorization/entities/authorization.go delete mode 100644 protoc-gen-go-crud/internal/authorization/entities/role.go delete mode 100644 protoc-gen-go-crud/internal/authorization/repositories/authorization.go delete mode 100644 protoc-gen-go-crud/internal/authorization/repositories/role.go delete mode 100644 protoc-gen-go-crud/internal/authorization/usecase/authorization.go delete mode 100644 protoc-gen-go-crud/internal/authorization/usecase/role.go delete mode 100644 protoc-gen-go-crud/internal/users/deliveries/users.go delete mode 100644 protoc-gen-go-crud/internal/users/entities/users.go delete mode 100644 protoc-gen-go-crud/internal/users/repositories/users.go delete mode 100644 protoc-gen-go-crud/internal/users/usecase/users.go delete mode 100644 protoc-gen-go-crud/pkg/database/database.go delete mode 100644 protoc-gen-go-crud/pkg/database/entity/base.go delete mode 100644 protoc-gen-go-crud/pkg/database/entity/id.go delete mode 100644 protoc-gen-go-crud/pkg/database/filters.go delete mode 100644 protoc-gen-go-crud/pkg/third_party/README.md delete mode 100644 protoc-gen-go-crud/pkg/third_party/protos/errors/errors.proto delete mode 100644 protoc-gen-go-crud/pkg/third_party/protos/google/api/annotations.proto delete mode 100644 protoc-gen-go-crud/pkg/third_party/protos/google/api/client.proto delete mode 100644 protoc-gen-go-crud/pkg/third_party/protos/google/api/field_behavior.proto delete mode 100644 protoc-gen-go-crud/pkg/third_party/protos/google/api/http.proto delete mode 100644 protoc-gen-go-crud/pkg/third_party/protos/google/api/httpbody.proto delete mode 100644 protoc-gen-go-crud/pkg/third_party/protos/google/protobuf/descriptor.proto delete mode 100644 protoc-gen-go-crud/pkg/third_party/protos/google/protobuf/duration.proto delete mode 100644 protoc-gen-go-crud/pkg/third_party/protos/google/protobuf/empty.proto delete mode 100644 protoc-gen-go-crud/pkg/third_party/protos/protoc-gen-openapiv2/options/annotations.proto delete mode 100644 protoc-gen-go-crud/pkg/third_party/protos/protoc-gen-openapiv2/options/openapiv2.proto delete mode 100644 protoc-gen-go-crud/pkg/third_party/protos/validate/README.md delete mode 100644 protoc-gen-go-crud/pkg/third_party/protos/validate/validate.proto diff --git a/protoc-gen-go-crud/api/v1/authorization/authorization.pb.go b/protoc-gen-go-crud/api/v1/authorization/authorization.pb.go deleted file mode 100644 index 68fe3eb..0000000 --- a/protoc-gen-go-crud/api/v1/authorization/authorization.pb.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.30.0 -// protoc v4.23.3 -// source: v1/authorization/authorization.proto - -package authorizationV1 - -import ( - _ "github.com/envoyproxy/protoc-gen-validate/validate" - components "github.com/fynntang/protobuf-gen-go/protoc-gen-go-crud/api/v1/components" - empty "github.com/golang/protobuf/ptypes/empty" - _ "google.golang.org/genproto/googleapis/api/annotations" - 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) -) - -type Menus struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - List []*components.Menu `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` -} - -func (x *Menus) Reset() { - *x = Menus{} - if protoimpl.UnsafeEnabled { - mi := &file_v1_authorization_authorization_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Menus) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Menus) ProtoMessage() {} - -func (x *Menus) ProtoReflect() protoreflect.Message { - mi := &file_v1_authorization_authorization_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 Menus.ProtoReflect.Descriptor instead. -func (*Menus) Descriptor() ([]byte, []int) { - return file_v1_authorization_authorization_proto_rawDescGZIP(), []int{0} -} - -func (x *Menus) GetList() []*components.Menu { - if x != nil { - return x.List - } - return nil -} - -var File_v1_authorization_authorization_proto protoreflect.FileDescriptor - -var file_v1_authorization_authorization_proto_rawDesc = []byte{ - 0x0a, 0x24, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, - 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, - 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x73, 0x63, - 0x68, 0x65, 0x6d, 0x61, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x76, 0x31, 0x2f, - 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x65, 0x6e, 0x75, 0x6d, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0x2f, 0x0a, 0x05, 0x4d, 0x65, 0x6e, 0x75, 0x73, 0x12, 0x26, 0x0a, 0x04, 0x6c, - 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x6f, 0x6d, 0x70, - 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x56, 0x31, 0x2e, 0x4d, 0x65, 0x6e, 0x75, 0x52, 0x04, 0x6c, - 0x69, 0x73, 0x74, 0x32, 0x56, 0x0a, 0x04, 0x41, 0x75, 0x74, 0x68, 0x12, 0x4e, 0x0a, 0x09, 0x4c, - 0x69, 0x73, 0x74, 0x4d, 0x65, 0x6e, 0x75, 0x73, 0x12, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x1a, 0x16, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x56, 0x31, 0x2e, 0x4d, 0x65, 0x6e, 0x75, 0x73, 0x22, 0x11, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0b, - 0x12, 0x09, 0x2f, 0x76, 0x31, 0x2f, 0x6d, 0x65, 0x6e, 0x75, 0x73, 0x42, 0x5d, 0x5a, 0x5b, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x79, 0x6e, 0x6e, 0x74, 0x61, - 0x6e, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2d, 0x67, 0x65, 0x6e, 0x2d, - 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, - 0x2d, 0x63, 0x72, 0x75, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, - 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3b, 0x61, 0x75, 0x74, 0x68, 0x6f, - 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, -} - -var ( - file_v1_authorization_authorization_proto_rawDescOnce sync.Once - file_v1_authorization_authorization_proto_rawDescData = file_v1_authorization_authorization_proto_rawDesc -) - -func file_v1_authorization_authorization_proto_rawDescGZIP() []byte { - file_v1_authorization_authorization_proto_rawDescOnce.Do(func() { - file_v1_authorization_authorization_proto_rawDescData = protoimpl.X.CompressGZIP(file_v1_authorization_authorization_proto_rawDescData) - }) - return file_v1_authorization_authorization_proto_rawDescData -} - -var file_v1_authorization_authorization_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_v1_authorization_authorization_proto_goTypes = []interface{}{ - (*Menus)(nil), // 0: authorizationV1.Menus - (*components.Menu)(nil), // 1: componentsV1.Menu - (*empty.Empty)(nil), // 2: google.protobuf.Empty -} -var file_v1_authorization_authorization_proto_depIdxs = []int32{ - 1, // 0: authorizationV1.Menus.list:type_name -> componentsV1.Menu - 2, // 1: authorizationV1.Auth.ListMenus:input_type -> google.protobuf.Empty - 0, // 2: authorizationV1.Auth.ListMenus:output_type -> authorizationV1.Menus - 2, // [2:3] is the sub-list for method output_type - 1, // [1:2] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_v1_authorization_authorization_proto_init() } -func file_v1_authorization_authorization_proto_init() { - if File_v1_authorization_authorization_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_v1_authorization_authorization_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Menus); 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_v1_authorization_authorization_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_v1_authorization_authorization_proto_goTypes, - DependencyIndexes: file_v1_authorization_authorization_proto_depIdxs, - MessageInfos: file_v1_authorization_authorization_proto_msgTypes, - }.Build() - File_v1_authorization_authorization_proto = out.File - file_v1_authorization_authorization_proto_rawDesc = nil - file_v1_authorization_authorization_proto_goTypes = nil - file_v1_authorization_authorization_proto_depIdxs = nil -} diff --git a/protoc-gen-go-crud/api/v1/authorization/authorization.proto b/protoc-gen-go-crud/api/v1/authorization/authorization.proto deleted file mode 100644 index 2c35b39..0000000 --- a/protoc-gen-go-crud/api/v1/authorization/authorization.proto +++ /dev/null @@ -1,25 +0,0 @@ -syntax = "proto3"; - -package authorizationV1; - -import "google/api/annotations.proto"; -import "validate/validate.proto"; -import "v1/components/schemas.proto"; -import "v1/components/enum.proto"; -import "google/protobuf/empty.proto"; - - - -option go_package = "github.com/fynntang/protobuf-gen-go/protoc-gen-go-crud/api/v1/authorization;authorizationV1"; - - -service Auth { - // 菜单列表 - rpc ListMenus(google.protobuf.Empty) returns (Menus) { - option (google.api.http) = {get: "/v1/menus"}; - } -} - -message Menus { - repeated componentsV1.Menu list = 1; -} diff --git a/protoc-gen-go-crud/api/v1/authorization/role.pb.go b/protoc-gen-go-crud/api/v1/authorization/role.pb.go deleted file mode 100644 index ccd7862..0000000 --- a/protoc-gen-go-crud/api/v1/authorization/role.pb.go +++ /dev/null @@ -1,759 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.30.0 -// protoc v4.23.3 -// source: v1/authorization/role.proto - -package authorizationV1 - -import ( - _ "github.com/envoyproxy/protoc-gen-validate/validate" - components "github.com/fynntang/protobuf-gen-go/protoc-gen-go-crud/api/v1/components" - empty "github.com/golang/protobuf/ptypes/empty" - _ "google.golang.org/genproto/googleapis/api/annotations" - 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) -) - -type ListRolesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // 角色名称 - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // 状态 - Status components.EnableStatus `protobuf:"varint,2,opt,name=status,proto3,enum=componentsV1.EnableStatus" json:"status,omitempty"` - // 页码 - Page int64 `protobuf:"varint,5,opt,name=page,proto3" json:"page,omitempty"` - // 每页数量 - PageSize int64 `protobuf:"varint,6,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` -} - -func (x *ListRolesRequest) Reset() { - *x = ListRolesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_v1_authorization_role_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListRolesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListRolesRequest) ProtoMessage() {} - -func (x *ListRolesRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_authorization_role_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 ListRolesRequest.ProtoReflect.Descriptor instead. -func (*ListRolesRequest) Descriptor() ([]byte, []int) { - return file_v1_authorization_role_proto_rawDescGZIP(), []int{0} -} - -func (x *ListRolesRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *ListRolesRequest) GetStatus() components.EnableStatus { - if x != nil { - return x.Status - } - return components.EnableStatus(0) -} - -func (x *ListRolesRequest) GetPage() int64 { - if x != nil { - return x.Page - } - return 0 -} - -func (x *ListRolesRequest) GetPageSize() int64 { - if x != nil { - return x.PageSize - } - return 0 -} - -type Roles struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // 角色列表 - List []*components.Role `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` - // 分页信息 - PageInfo *components.PageInfo `protobuf:"bytes,2,opt,name=page_info,json=pageInfo,proto3" json:"page_info,omitempty"` -} - -func (x *Roles) Reset() { - *x = Roles{} - if protoimpl.UnsafeEnabled { - mi := &file_v1_authorization_role_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Roles) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Roles) ProtoMessage() {} - -func (x *Roles) ProtoReflect() protoreflect.Message { - mi := &file_v1_authorization_role_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 Roles.ProtoReflect.Descriptor instead. -func (*Roles) Descriptor() ([]byte, []int) { - return file_v1_authorization_role_proto_rawDescGZIP(), []int{1} -} - -func (x *Roles) GetList() []*components.Role { - if x != nil { - return x.List - } - return nil -} - -func (x *Roles) GetPageInfo() *components.PageInfo { - if x != nil { - return x.PageInfo - } - return nil -} - -type CreateRoleRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // 角色名称 - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // 状态 - Status components.EnableStatus `protobuf:"varint,2,opt,name=status,proto3,enum=componentsV1.EnableStatus" json:"status,omitempty"` - // 功能权限 - Permissions []string `protobuf:"bytes,3,rep,name=permissions,proto3" json:"permissions,omitempty"` - // 备注 - Remark string `protobuf:"bytes,4,opt,name=remark,proto3" json:"remark,omitempty"` -} - -func (x *CreateRoleRequest) Reset() { - *x = CreateRoleRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_v1_authorization_role_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateRoleRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateRoleRequest) ProtoMessage() {} - -func (x *CreateRoleRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_authorization_role_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 CreateRoleRequest.ProtoReflect.Descriptor instead. -func (*CreateRoleRequest) Descriptor() ([]byte, []int) { - return file_v1_authorization_role_proto_rawDescGZIP(), []int{2} -} - -func (x *CreateRoleRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *CreateRoleRequest) GetStatus() components.EnableStatus { - if x != nil { - return x.Status - } - return components.EnableStatus(0) -} - -func (x *CreateRoleRequest) GetPermissions() []string { - if x != nil { - return x.Permissions - } - return nil -} - -func (x *CreateRoleRequest) GetRemark() string { - if x != nil { - return x.Remark - } - return "" -} - -type UpdateRoleRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // 角色Id - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // 角色名称 - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // 功能权限 - Permissions []string `protobuf:"bytes,3,rep,name=permissions,proto3" json:"permissions,omitempty"` - // 备注 - Remark string `protobuf:"bytes,4,opt,name=remark,proto3" json:"remark,omitempty"` -} - -func (x *UpdateRoleRequest) Reset() { - *x = UpdateRoleRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_v1_authorization_role_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateRoleRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateRoleRequest) ProtoMessage() {} - -func (x *UpdateRoleRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_authorization_role_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 UpdateRoleRequest.ProtoReflect.Descriptor instead. -func (*UpdateRoleRequest) Descriptor() ([]byte, []int) { - return file_v1_authorization_role_proto_rawDescGZIP(), []int{3} -} - -func (x *UpdateRoleRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *UpdateRoleRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *UpdateRoleRequest) GetPermissions() []string { - if x != nil { - return x.Permissions - } - return nil -} - -func (x *UpdateRoleRequest) GetRemark() string { - if x != nil { - return x.Remark - } - return "" -} - -type GetRoleRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // 角色ID - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *GetRoleRequest) Reset() { - *x = GetRoleRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_v1_authorization_role_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRoleRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRoleRequest) ProtoMessage() {} - -func (x *GetRoleRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_authorization_role_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 GetRoleRequest.ProtoReflect.Descriptor instead. -func (*GetRoleRequest) Descriptor() ([]byte, []int) { - return file_v1_authorization_role_proto_rawDescGZIP(), []int{4} -} - -func (x *GetRoleRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -type GetRoleReply struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // 角色名称 - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - // 功能权限 - Permissions []string `protobuf:"bytes,2,rep,name=permissions,proto3" json:"permissions,omitempty"` - // 备注 - Remark string `protobuf:"bytes,3,opt,name=remark,proto3" json:"remark,omitempty"` - // 状态 - Status components.EnableStatus `protobuf:"varint,4,opt,name=status,proto3,enum=componentsV1.EnableStatus" json:"status,omitempty"` -} - -func (x *GetRoleReply) Reset() { - *x = GetRoleReply{} - if protoimpl.UnsafeEnabled { - mi := &file_v1_authorization_role_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRoleReply) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRoleReply) ProtoMessage() {} - -func (x *GetRoleReply) ProtoReflect() protoreflect.Message { - mi := &file_v1_authorization_role_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 GetRoleReply.ProtoReflect.Descriptor instead. -func (*GetRoleReply) Descriptor() ([]byte, []int) { - return file_v1_authorization_role_proto_rawDescGZIP(), []int{5} -} - -func (x *GetRoleReply) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *GetRoleReply) GetPermissions() []string { - if x != nil { - return x.Permissions - } - return nil -} - -func (x *GetRoleReply) GetRemark() string { - if x != nil { - return x.Remark - } - return "" -} - -func (x *GetRoleReply) GetStatus() components.EnableStatus { - if x != nil { - return x.Status - } - return components.EnableStatus(0) -} - -type EnableRoleRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // 角色ID - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // 状态 - Status components.EnableStatus `protobuf:"varint,2,opt,name=status,proto3,enum=componentsV1.EnableStatus" json:"status,omitempty"` -} - -func (x *EnableRoleRequest) Reset() { - *x = EnableRoleRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_v1_authorization_role_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EnableRoleRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EnableRoleRequest) ProtoMessage() {} - -func (x *EnableRoleRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_authorization_role_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 EnableRoleRequest.ProtoReflect.Descriptor instead. -func (*EnableRoleRequest) Descriptor() ([]byte, []int) { - return file_v1_authorization_role_proto_rawDescGZIP(), []int{6} -} - -func (x *EnableRoleRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *EnableRoleRequest) GetStatus() components.EnableStatus { - if x != nil { - return x.Status - } - return components.EnableStatus(0) -} - -var File_v1_authorization_role_proto protoreflect.FileDescriptor - -var file_v1_authorization_role_proto_rawDesc = []byte{ - 0x0a, 0x1b, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x61, - 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x1a, 0x1c, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, - 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, - 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x18, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, - 0x73, 0x2f, 0x65, 0x6e, 0x75, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, - 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x95, 0x01, 0x0a, 0x10, 0x4c, 0x69, - 0x73, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1c, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, - 0x05, 0x72, 0x03, 0xd0, 0x01, 0x01, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x32, 0x0a, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x63, - 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x56, 0x31, 0x2e, 0x45, 0x6e, 0x61, 0x62, - 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, - 0x70, 0x61, 0x67, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, - 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, - 0x65, 0x22, 0x64, 0x0a, 0x05, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x12, 0x26, 0x0a, 0x04, 0x6c, 0x69, - 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x6f, - 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x56, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x6c, 0x69, - 0x73, 0x74, 0x12, 0x33, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, - 0x74, 0x73, 0x56, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x70, - 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0xd0, 0x01, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2e, 0x0a, - 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1a, 0xfa, 0x42, 0x17, - 0x72, 0x15, 0x32, 0x13, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0xe4, 0xb8, - 0x80, 0x2d, 0xe9, 0xbe, 0xa5, 0x5d, 0x2b, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x32, 0x0a, - 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, - 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x56, 0x31, 0x2e, 0x45, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, - 0x6f, 0x6e, 0x73, 0x12, 0x35, 0x0a, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x1d, 0xfa, 0x42, 0x1a, 0x72, 0x18, 0x32, 0x13, 0x5b, 0x61, 0x2d, 0x7a, - 0x41, 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0xe4, 0xb8, 0x80, 0x2d, 0xe9, 0xbe, 0xa5, 0x5d, 0x2b, 0xd0, - 0x01, 0x01, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x22, 0xac, 0x01, 0x0a, 0x11, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, - 0x12, 0x2e, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1a, - 0xfa, 0x42, 0x17, 0x72, 0x15, 0x32, 0x13, 0x5b, 0x61, 0x2d, 0x7a, 0x41, 0x2d, 0x5a, 0x30, 0x2d, - 0x39, 0xe4, 0xb8, 0x80, 0x2d, 0xe9, 0xbe, 0xa5, 0x5d, 0x2b, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, - 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x73, 0x12, 0x35, 0x0a, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x1d, 0xfa, 0x42, 0x1a, 0x72, 0x18, 0x32, 0x13, 0x5b, 0x61, 0x2d, 0x7a, 0x41, - 0x2d, 0x5a, 0x30, 0x2d, 0x39, 0xe4, 0xb8, 0x80, 0x2d, 0xe9, 0xbe, 0xa5, 0x5d, 0x2b, 0xd0, 0x01, - 0x01, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x22, 0x20, 0x0a, 0x0e, 0x47, 0x65, 0x74, - 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, - 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x90, 0x01, 0x0a, 0x0c, - 0x47, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, - 0x6e, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x32, 0x0a, 0x06, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x6d, - 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x56, 0x31, 0x2e, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x57, - 0x0a, 0x11, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x02, 0x69, 0x64, 0x12, 0x32, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, - 0x56, 0x31, 0x2e, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, - 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x32, 0xea, 0x03, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, - 0x12, 0x59, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x12, 0x21, 0x2e, - 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x16, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x56, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x22, 0x11, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0b, - 0x12, 0x09, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x12, 0x5e, 0x0a, 0x0a, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x22, 0x2e, 0x61, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x3a, 0x01, 0x2a, - 0x22, 0x09, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x12, 0x63, 0x0a, 0x0a, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x22, 0x2e, 0x61, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x3a, 0x01, 0x2a, - 0x1a, 0x0e, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, - 0x12, 0x56, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x1f, 0x2e, 0x61, 0x75, - 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x2e, 0x47, 0x65, - 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x63, - 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x56, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, - 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x12, 0x0e, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x6f, - 0x6c, 0x65, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x6a, 0x0a, 0x0a, 0x45, 0x6e, 0x61, 0x62, - 0x6c, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x22, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, - 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x56, 0x31, 0x2e, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x52, - 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x3a, 0x01, 0x2a, 0x22, 0x15, 0x2f, - 0x76, 0x31, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x65, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x42, 0x5d, 0x5a, 0x5b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x66, 0x79, 0x6e, 0x6e, 0x74, 0x61, 0x6e, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x63, 0x72, 0x75, 0x64, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x3b, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_v1_authorization_role_proto_rawDescOnce sync.Once - file_v1_authorization_role_proto_rawDescData = file_v1_authorization_role_proto_rawDesc -) - -func file_v1_authorization_role_proto_rawDescGZIP() []byte { - file_v1_authorization_role_proto_rawDescOnce.Do(func() { - file_v1_authorization_role_proto_rawDescData = protoimpl.X.CompressGZIP(file_v1_authorization_role_proto_rawDescData) - }) - return file_v1_authorization_role_proto_rawDescData -} - -var file_v1_authorization_role_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_v1_authorization_role_proto_goTypes = []interface{}{ - (*ListRolesRequest)(nil), // 0: authorizationV1.ListRolesRequest - (*Roles)(nil), // 1: authorizationV1.Roles - (*CreateRoleRequest)(nil), // 2: authorizationV1.CreateRoleRequest - (*UpdateRoleRequest)(nil), // 3: authorizationV1.UpdateRoleRequest - (*GetRoleRequest)(nil), // 4: authorizationV1.GetRoleRequest - (*GetRoleReply)(nil), // 5: authorizationV1.GetRoleReply - (*EnableRoleRequest)(nil), // 6: authorizationV1.EnableRoleRequest - (components.EnableStatus)(0), // 7: componentsV1.EnableStatus - (*components.Role)(nil), // 8: componentsV1.Role - (*components.PageInfo)(nil), // 9: componentsV1.PageInfo - (*empty.Empty)(nil), // 10: google.protobuf.Empty -} -var file_v1_authorization_role_proto_depIdxs = []int32{ - 7, // 0: authorizationV1.ListRolesRequest.status:type_name -> componentsV1.EnableStatus - 8, // 1: authorizationV1.Roles.list:type_name -> componentsV1.Role - 9, // 2: authorizationV1.Roles.page_info:type_name -> componentsV1.PageInfo - 7, // 3: authorizationV1.CreateRoleRequest.status:type_name -> componentsV1.EnableStatus - 7, // 4: authorizationV1.GetRoleReply.status:type_name -> componentsV1.EnableStatus - 7, // 5: authorizationV1.EnableRoleRequest.status:type_name -> componentsV1.EnableStatus - 0, // 6: authorizationV1.Role.ListRoles:input_type -> authorizationV1.ListRolesRequest - 2, // 7: authorizationV1.Role.CreateRole:input_type -> authorizationV1.CreateRoleRequest - 3, // 8: authorizationV1.Role.UpdateRole:input_type -> authorizationV1.UpdateRoleRequest - 4, // 9: authorizationV1.Role.GetRole:input_type -> authorizationV1.GetRoleRequest - 6, // 10: authorizationV1.Role.EnableRole:input_type -> authorizationV1.EnableRoleRequest - 1, // 11: authorizationV1.Role.ListRoles:output_type -> authorizationV1.Roles - 10, // 12: authorizationV1.Role.CreateRole:output_type -> google.protobuf.Empty - 10, // 13: authorizationV1.Role.UpdateRole:output_type -> google.protobuf.Empty - 8, // 14: authorizationV1.Role.GetRole:output_type -> componentsV1.Role - 10, // 15: authorizationV1.Role.EnableRole:output_type -> google.protobuf.Empty - 11, // [11:16] is the sub-list for method output_type - 6, // [6:11] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name -} - -func init() { file_v1_authorization_role_proto_init() } -func file_v1_authorization_role_proto_init() { - if File_v1_authorization_role_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_v1_authorization_role_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListRolesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_v1_authorization_role_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Roles); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_v1_authorization_role_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateRoleRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_v1_authorization_role_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateRoleRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_v1_authorization_role_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRoleRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_v1_authorization_role_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRoleReply); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_v1_authorization_role_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EnableRoleRequest); 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_v1_authorization_role_proto_rawDesc, - NumEnums: 0, - NumMessages: 7, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_v1_authorization_role_proto_goTypes, - DependencyIndexes: file_v1_authorization_role_proto_depIdxs, - MessageInfos: file_v1_authorization_role_proto_msgTypes, - }.Build() - File_v1_authorization_role_proto = out.File - file_v1_authorization_role_proto_rawDesc = nil - file_v1_authorization_role_proto_goTypes = nil - file_v1_authorization_role_proto_depIdxs = nil -} diff --git a/protoc-gen-go-crud/api/v1/authorization/role.proto b/protoc-gen-go-crud/api/v1/authorization/role.proto deleted file mode 100644 index c4b02ad..0000000 --- a/protoc-gen-go-crud/api/v1/authorization/role.proto +++ /dev/null @@ -1,119 +0,0 @@ -syntax = "proto3"; - -package authorizationV1; - -import "google/api/annotations.proto"; -import "validate/validate.proto"; -import "v1/components/schemas.proto"; -import "v1/components/enum.proto"; -import "google/protobuf/empty.proto"; - - - -option go_package = "github.com/fynntang/protobuf-gen-go/protoc-gen-go-crud/api/v1/authorization;authorizationV1"; - - -service Role { - // 角色列表 - rpc ListRoles(ListRolesRequest) returns (Roles) { - option (google.api.http) = {get: "/v1/roles"}; - } - // 新增角色 - rpc CreateRole(CreateRoleRequest) returns (google.protobuf.Empty) { - option (google.api.http) = {post: "/v1/roles" body: "*"}; - } - // 更新角色 - rpc UpdateRole(UpdateRoleRequest) returns (google.protobuf.Empty) { - option (google.api.http) = {put: "/v1/roles/{id}" body: "*"}; - } - // 查看角色详情 - rpc GetRole(GetRoleRequest) returns (componentsV1.Role) { - option (google.api.http) = {get: "/v1/roles/{id}"}; - } - // 角色启用/禁用 - rpc EnableRole(EnableRoleRequest) returns (google.protobuf.Empty) { - option (google.api.http) = {post: "/v1/roles/{id}/enable" body: "*"}; - } -} - -message ListRolesRequest { - // 角色名称 - string name = 1 [(validate.rules).string = { - ignore_empty:true, -// pattern: "[a-zA-Z0-9\u4e00-\u9fa5]+", - }]; - // 状态 - componentsV1.EnableStatus status = 2; - // 页码 - int64 page = 5; - // 每页数量 - int64 page_size = 6; -} - -message Roles { - // 角色列表 - repeated componentsV1.Role list = 1; - // 分页信息 - componentsV1.PageInfo page_info = 2; -} - - - -message CreateRoleRequest { - // 角色名称 - string name = 1 [(validate.rules).string = { - // 禁止html标签输入 - pattern: "[a-zA-Z0-9\u4e00-\u9fa5]+", - }]; - // 状态 - componentsV1.EnableStatus status = 2; - // 功能权限 - repeated string permissions = 3; - // 备注 - string remark = 4 [(validate.rules).string = { - ignore_empty:true, - // 禁止html标签输入 - pattern: "[a-zA-Z0-9\u4e00-\u9fa5]+", - }]; -} - -message UpdateRoleRequest { - // 角色Id - string id = 1; - // 角色名称 - string name = 2 [(validate.rules).string = { - // 禁止html标签输入 - pattern: "[a-zA-Z0-9\u4e00-\u9fa5]+", - }]; - // 功能权限 - repeated string permissions = 3; - // 备注 - string remark = 4 [(validate.rules).string = { - ignore_empty:true, - // 禁止html标签输入 - pattern: "[a-zA-Z0-9\u4e00-\u9fa5]+", - }]; -} - -message GetRoleRequest { - // 角色ID - string id = 1; -} - -message GetRoleReply { - // 角色名称 - string name = 1; - // 功能权限 - repeated string permissions = 2; - // 备注 - string remark = 3; - // 状态 - componentsV1.EnableStatus status = 4; -} - -message EnableRoleRequest { - // 角色ID - string id = 1; - // 状态 - componentsV1.EnableStatus status = 2; -} diff --git a/protoc-gen-go-crud/api/v1/components/dictionary.pb.go b/protoc-gen-go-crud/api/v1/components/dictionary.pb.go deleted file mode 100644 index 9b54649..0000000 --- a/protoc-gen-go-crud/api/v1/components/dictionary.pb.go +++ /dev/null @@ -1,169 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.30.0 -// protoc v4.23.3 -// source: v1/components/dictionary.proto - -package componentsV1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - _ "google.golang.org/protobuf/types/descriptorpb" - 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) -) - -type Dictionary struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` - Label string `protobuf:"bytes,3,opt,name=label,proto3" json:"label,omitempty"` -} - -func (x *Dictionary) Reset() { - *x = Dictionary{} - if protoimpl.UnsafeEnabled { - mi := &file_v1_components_dictionary_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Dictionary) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Dictionary) ProtoMessage() {} - -func (x *Dictionary) ProtoReflect() protoreflect.Message { - mi := &file_v1_components_dictionary_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 Dictionary.ProtoReflect.Descriptor instead. -func (*Dictionary) Descriptor() ([]byte, []int) { - return file_v1_components_dictionary_proto_rawDescGZIP(), []int{0} -} - -func (x *Dictionary) GetKey() string { - if x != nil { - return x.Key - } - return "" -} - -func (x *Dictionary) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -func (x *Dictionary) GetLabel() string { - if x != nil { - return x.Label - } - return "" -} - -var File_v1_components_dictionary_proto protoreflect.FileDescriptor - -var file_v1_components_dictionary_proto_rawDesc = []byte{ - 0x0a, 0x1e, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x2f, - 0x64, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x0c, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x56, 0x31, 0x1a, 0x20, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, - 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x22, 0x4a, 0x0a, 0x0a, 0x44, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x72, 0x79, 0x12, 0x10, - 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, - 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x42, 0x57, 0x5a, 0x55, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x66, 0x79, 0x6e, 0x6e, 0x74, - 0x61, 0x6e, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2d, 0x67, 0x65, 0x6e, - 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, - 0x6f, 0x2d, 0x63, 0x72, 0x75, 0x64, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, - 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x3b, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, - 0x6e, 0x74, 0x73, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_v1_components_dictionary_proto_rawDescOnce sync.Once - file_v1_components_dictionary_proto_rawDescData = file_v1_components_dictionary_proto_rawDesc -) - -func file_v1_components_dictionary_proto_rawDescGZIP() []byte { - file_v1_components_dictionary_proto_rawDescOnce.Do(func() { - file_v1_components_dictionary_proto_rawDescData = protoimpl.X.CompressGZIP(file_v1_components_dictionary_proto_rawDescData) - }) - return file_v1_components_dictionary_proto_rawDescData -} - -var file_v1_components_dictionary_proto_msgTypes = make([]protoimpl.MessageInfo, 1) -var file_v1_components_dictionary_proto_goTypes = []interface{}{ - (*Dictionary)(nil), // 0: componentsV1.Dictionary -} -var file_v1_components_dictionary_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_v1_components_dictionary_proto_init() } -func file_v1_components_dictionary_proto_init() { - if File_v1_components_dictionary_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_v1_components_dictionary_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Dictionary); 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_v1_components_dictionary_proto_rawDesc, - NumEnums: 0, - NumMessages: 1, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_v1_components_dictionary_proto_goTypes, - DependencyIndexes: file_v1_components_dictionary_proto_depIdxs, - MessageInfos: file_v1_components_dictionary_proto_msgTypes, - }.Build() - File_v1_components_dictionary_proto = out.File - file_v1_components_dictionary_proto_rawDesc = nil - file_v1_components_dictionary_proto_goTypes = nil - file_v1_components_dictionary_proto_depIdxs = nil -} diff --git a/protoc-gen-go-crud/api/v1/components/dictionary.proto b/protoc-gen-go-crud/api/v1/components/dictionary.proto deleted file mode 100644 index 92814b8..0000000 --- a/protoc-gen-go-crud/api/v1/components/dictionary.proto +++ /dev/null @@ -1,16 +0,0 @@ -syntax = "proto3"; - - -package componentsV1; - -import "google/protobuf/descriptor.proto"; - -option go_package = "github.com/fynntang/protobuf-gen-go/protoc-gen-go-crud/api/v1/components;componentsV1"; - -message Dictionary { - string key = 1; - string value = 2; - string label = 3; -} - - diff --git a/protoc-gen-go-crud/api/v1/components/enum.pb.go b/protoc-gen-go-crud/api/v1/components/enum.pb.go deleted file mode 100644 index 387f6ff..0000000 --- a/protoc-gen-go-crud/api/v1/components/enum.pb.go +++ /dev/null @@ -1,265 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.30.0 -// protoc v4.23.3 -// source: v1/components/enum.proto - -package componentsV1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - _ "google.golang.org/protobuf/types/descriptorpb" - 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) -) - -type EnableStatus int32 - -const ( - // 默认值 - EnableStatus_ENABLE_STATUS_DEFAULT EnableStatus = 0 - // 启用 - EnableStatus_ENABLE EnableStatus = 1 - // 禁用 - EnableStatus_DISABLE EnableStatus = 2 -) - -// Enum value maps for EnableStatus. -var ( - EnableStatus_name = map[int32]string{ - 0: "ENABLE_STATUS_DEFAULT", - 1: "ENABLE", - 2: "DISABLE", - } - EnableStatus_value = map[string]int32{ - "ENABLE_STATUS_DEFAULT": 0, - "ENABLE": 1, - "DISABLE": 2, - } -) - -func (x EnableStatus) Enum() *EnableStatus { - p := new(EnableStatus) - *p = x - return p -} - -func (x EnableStatus) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (EnableStatus) Descriptor() protoreflect.EnumDescriptor { - return file_v1_components_enum_proto_enumTypes[0].Descriptor() -} - -func (EnableStatus) Type() protoreflect.EnumType { - return &file_v1_components_enum_proto_enumTypes[0] -} - -func (x EnableStatus) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use EnableStatus.Descriptor instead. -func (EnableStatus) EnumDescriptor() ([]byte, []int) { - return file_v1_components_enum_proto_rawDescGZIP(), []int{0} -} - -type MenuType int32 - -const ( - // 默认值 - MenuType_MENU_TYPE_DEFAULT MenuType = 0 - // 目录 - MenuType_DIRECTORY MenuType = 1 - // 菜单 - MenuType_MENU MenuType = 2 - // 按钮 - MenuType_BUTTON MenuType = 3 -) - -// Enum value maps for MenuType. -var ( - MenuType_name = map[int32]string{ - 0: "MENU_TYPE_DEFAULT", - 1: "DIRECTORY", - 2: "MENU", - 3: "BUTTON", - } - MenuType_value = map[string]int32{ - "MENU_TYPE_DEFAULT": 0, - "DIRECTORY": 1, - "MENU": 2, - "BUTTON": 3, - } -) - -func (x MenuType) Enum() *MenuType { - p := new(MenuType) - *p = x - return p -} - -func (x MenuType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (MenuType) Descriptor() protoreflect.EnumDescriptor { - return file_v1_components_enum_proto_enumTypes[1].Descriptor() -} - -func (MenuType) Type() protoreflect.EnumType { - return &file_v1_components_enum_proto_enumTypes[1] -} - -func (x MenuType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use MenuType.Descriptor instead. -func (MenuType) EnumDescriptor() ([]byte, []int) { - return file_v1_components_enum_proto_rawDescGZIP(), []int{1} -} - -type MenuHidden int32 - -const ( - // 默认值 - MenuHidden_MENU_HIDDEN_DEFAULT MenuHidden = 0 - // 隐藏 - MenuHidden_TRUE MenuHidden = 1 - // 显示 - MenuHidden_FALSE MenuHidden = 2 -) - -// Enum value maps for MenuHidden. -var ( - MenuHidden_name = map[int32]string{ - 0: "MENU_HIDDEN_DEFAULT", - 1: "TRUE", - 2: "FALSE", - } - MenuHidden_value = map[string]int32{ - "MENU_HIDDEN_DEFAULT": 0, - "TRUE": 1, - "FALSE": 2, - } -) - -func (x MenuHidden) Enum() *MenuHidden { - p := new(MenuHidden) - *p = x - return p -} - -func (x MenuHidden) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (MenuHidden) Descriptor() protoreflect.EnumDescriptor { - return file_v1_components_enum_proto_enumTypes[2].Descriptor() -} - -func (MenuHidden) Type() protoreflect.EnumType { - return &file_v1_components_enum_proto_enumTypes[2] -} - -func (x MenuHidden) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use MenuHidden.Descriptor instead. -func (MenuHidden) EnumDescriptor() ([]byte, []int) { - return file_v1_components_enum_proto_rawDescGZIP(), []int{2} -} - -var File_v1_components_enum_proto protoreflect.FileDescriptor - -var file_v1_components_enum_proto_rawDesc = []byte{ - 0x0a, 0x18, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x2f, - 0x65, 0x6e, 0x75, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x63, 0x6f, 0x6d, 0x70, - 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x56, 0x31, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x76, 0x31, 0x2f, 0x63, - 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x64, 0x69, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x61, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2a, 0x42, 0x0a, 0x0c, 0x45, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x19, 0x0a, 0x15, 0x45, 0x4e, - 0x41, 0x42, 0x4c, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x44, 0x45, 0x46, 0x41, - 0x55, 0x4c, 0x54, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x45, 0x4e, 0x41, 0x42, 0x4c, 0x45, 0x10, - 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x49, 0x53, 0x41, 0x42, 0x4c, 0x45, 0x10, 0x02, 0x2a, 0x46, - 0x0a, 0x08, 0x4d, 0x65, 0x6e, 0x75, 0x54, 0x79, 0x70, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x4d, 0x45, - 0x4e, 0x55, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, - 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x44, 0x49, 0x52, 0x45, 0x43, 0x54, 0x4f, 0x52, 0x59, 0x10, 0x01, - 0x12, 0x08, 0x0a, 0x04, 0x4d, 0x45, 0x4e, 0x55, 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x42, 0x55, - 0x54, 0x54, 0x4f, 0x4e, 0x10, 0x03, 0x2a, 0x3a, 0x0a, 0x0a, 0x4d, 0x65, 0x6e, 0x75, 0x48, 0x69, - 0x64, 0x64, 0x65, 0x6e, 0x12, 0x17, 0x0a, 0x13, 0x4d, 0x45, 0x4e, 0x55, 0x5f, 0x48, 0x49, 0x44, - 0x44, 0x45, 0x4e, 0x5f, 0x44, 0x45, 0x46, 0x41, 0x55, 0x4c, 0x54, 0x10, 0x00, 0x12, 0x08, 0x0a, - 0x04, 0x54, 0x52, 0x55, 0x45, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x46, 0x41, 0x4c, 0x53, 0x45, - 0x10, 0x02, 0x42, 0x57, 0x5a, 0x55, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x66, 0x79, 0x6e, 0x6e, 0x74, 0x61, 0x6e, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, - 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x63, 0x72, 0x75, 0x64, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x3b, 0x63, - 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} - -var ( - file_v1_components_enum_proto_rawDescOnce sync.Once - file_v1_components_enum_proto_rawDescData = file_v1_components_enum_proto_rawDesc -) - -func file_v1_components_enum_proto_rawDescGZIP() []byte { - file_v1_components_enum_proto_rawDescOnce.Do(func() { - file_v1_components_enum_proto_rawDescData = protoimpl.X.CompressGZIP(file_v1_components_enum_proto_rawDescData) - }) - return file_v1_components_enum_proto_rawDescData -} - -var file_v1_components_enum_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_v1_components_enum_proto_goTypes = []interface{}{ - (EnableStatus)(0), // 0: componentsV1.EnableStatus - (MenuType)(0), // 1: componentsV1.MenuType - (MenuHidden)(0), // 2: componentsV1.MenuHidden -} -var file_v1_components_enum_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_v1_components_enum_proto_init() } -func file_v1_components_enum_proto_init() { - if File_v1_components_enum_proto != nil { - return - } - file_v1_components_dictionary_proto_init() - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_v1_components_enum_proto_rawDesc, - NumEnums: 3, - NumMessages: 0, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_v1_components_enum_proto_goTypes, - DependencyIndexes: file_v1_components_enum_proto_depIdxs, - EnumInfos: file_v1_components_enum_proto_enumTypes, - }.Build() - File_v1_components_enum_proto = out.File - file_v1_components_enum_proto_rawDesc = nil - file_v1_components_enum_proto_goTypes = nil - file_v1_components_enum_proto_depIdxs = nil -} diff --git a/protoc-gen-go-crud/api/v1/components/enum.proto b/protoc-gen-go-crud/api/v1/components/enum.proto deleted file mode 100644 index ec6c3ef..0000000 --- a/protoc-gen-go-crud/api/v1/components/enum.proto +++ /dev/null @@ -1,39 +0,0 @@ -syntax = "proto3"; - -package componentsV1; - -import "google/protobuf/descriptor.proto"; -import "v1/components/dictionary.proto"; - -option go_package = "github.com/fynntang/protobuf-gen-go/protoc-gen-go-crud/api/v1/components;componentsV1"; - - - -enum EnableStatus { - // 默认值 - ENABLE_STATUS_DEFAULT = 0; - // 启用 - ENABLE = 1; - // 禁用 - DISABLE = 2; -} - -enum MenuType { - // 默认值 - MENU_TYPE_DEFAULT = 0; - // 目录 - DIRECTORY = 1; - // 菜单 - MENU = 2; - // 按钮 - BUTTON = 3; -} - -enum MenuHidden { - // 默认值 - MENU_HIDDEN_DEFAULT = 0; - // 隐藏 - TRUE = 1; - // 显示 - FALSE = 2; -} diff --git a/protoc-gen-go-crud/api/v1/components/schemas.pb.go b/protoc-gen-go-crud/api/v1/components/schemas.pb.go deleted file mode 100644 index c0292c7..0000000 --- a/protoc-gen-go-crud/api/v1/components/schemas.pb.go +++ /dev/null @@ -1,938 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.30.0 -// protoc v4.23.3 -// source: v1/components/schemas.proto - -package componentsV1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - _ "google.golang.org/protobuf/types/descriptorpb" - 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) -) - -type PageInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // 当前页码 - Page int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"` - // 每页数量 - PageSize int64 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` - // 总数量 - Total int64 `protobuf:"varint,3,opt,name=total,proto3" json:"total,omitempty"` -} - -func (x *PageInfo) Reset() { - *x = PageInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_v1_components_schemas_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *PageInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*PageInfo) ProtoMessage() {} - -func (x *PageInfo) ProtoReflect() protoreflect.Message { - mi := &file_v1_components_schemas_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 PageInfo.ProtoReflect.Descriptor instead. -func (*PageInfo) Descriptor() ([]byte, []int) { - return file_v1_components_schemas_proto_rawDescGZIP(), []int{0} -} - -func (x *PageInfo) GetPage() int64 { - if x != nil { - return x.Page - } - return 0 -} - -func (x *PageInfo) GetPageSize() int64 { - if x != nil { - return x.PageSize - } - return 0 -} - -func (x *PageInfo) GetTotal() int64 { - if x != nil { - return x.Total - } - return 0 -} - -type User struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // 用户ID - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // 邮箱 - Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"` - // 邮箱验证时间 - EmailVerifiedAt string `protobuf:"bytes,3,opt,name=email_verified_at,json=emailVerifiedAt,proto3" json:"email_verified_at,omitempty"` - // 姓名 - Nickname string `protobuf:"bytes,4,opt,name=nickname,proto3" json:"nickname,omitempty"` - // 手机区号 - PhoneCode string `protobuf:"bytes,5,opt,name=phone_code,json=phoneCode,proto3" json:"phone_code,omitempty"` - // 手机号 - Phone string `protobuf:"bytes,6,opt,name=phone,proto3" json:"phone,omitempty"` - // 头像 - Avatar string `protobuf:"bytes,7,opt,name=avatar,proto3" json:"avatar,omitempty"` - // 角色 - Roles []*Dictionary `protobuf:"bytes,8,rep,name=roles,proto3" json:"roles,omitempty"` - // 状态 - Status EnableStatus `protobuf:"varint,9,opt,name=status,proto3,enum=componentsV1.EnableStatus" json:"status,omitempty"` - // 权限 - Permissions []string `protobuf:"bytes,10,rep,name=permissions,proto3" json:"permissions,omitempty"` - // 时区 - Timezone string `protobuf:"bytes,11,opt,name=timezone,proto3" json:"timezone,omitempty"` - // 创建时间 - CreatedAt string `protobuf:"bytes,12,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - // 创建人 - CreatedBy string `protobuf:"bytes,13,opt,name=created_by,json=createdBy,proto3" json:"created_by,omitempty"` - // 更新时间 - UpdatedAt string `protobuf:"bytes,14,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` - // 更新人 - UpdatedBy string `protobuf:"bytes,15,opt,name=updated_by,json=updatedBy,proto3" json:"updated_by,omitempty"` -} - -func (x *User) Reset() { - *x = User{} - if protoimpl.UnsafeEnabled { - mi := &file_v1_components_schemas_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *User) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*User) ProtoMessage() {} - -func (x *User) ProtoReflect() protoreflect.Message { - mi := &file_v1_components_schemas_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 User.ProtoReflect.Descriptor instead. -func (*User) Descriptor() ([]byte, []int) { - return file_v1_components_schemas_proto_rawDescGZIP(), []int{1} -} - -func (x *User) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *User) GetEmail() string { - if x != nil { - return x.Email - } - return "" -} - -func (x *User) GetEmailVerifiedAt() string { - if x != nil { - return x.EmailVerifiedAt - } - return "" -} - -func (x *User) GetNickname() string { - if x != nil { - return x.Nickname - } - return "" -} - -func (x *User) GetPhoneCode() string { - if x != nil { - return x.PhoneCode - } - return "" -} - -func (x *User) GetPhone() string { - if x != nil { - return x.Phone - } - return "" -} - -func (x *User) GetAvatar() string { - if x != nil { - return x.Avatar - } - return "" -} - -func (x *User) GetRoles() []*Dictionary { - if x != nil { - return x.Roles - } - return nil -} - -func (x *User) GetStatus() EnableStatus { - if x != nil { - return x.Status - } - return EnableStatus_ENABLE_STATUS_DEFAULT -} - -func (x *User) GetPermissions() []string { - if x != nil { - return x.Permissions - } - return nil -} - -func (x *User) GetTimezone() string { - if x != nil { - return x.Timezone - } - return "" -} - -func (x *User) GetCreatedAt() string { - if x != nil { - return x.CreatedAt - } - return "" -} - -func (x *User) GetCreatedBy() string { - if x != nil { - return x.CreatedBy - } - return "" -} - -func (x *User) GetUpdatedAt() string { - if x != nil { - return x.UpdatedAt - } - return "" -} - -func (x *User) GetUpdatedBy() string { - if x != nil { - return x.UpdatedBy - } - return "" -} - -type Role struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // 角色ID - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // 角色名称 - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // 状态 - Status EnableStatus `protobuf:"varint,3,opt,name=status,proto3,enum=componentsV1.EnableStatus" json:"status,omitempty"` - // 备注 - Remark string `protobuf:"bytes,4,opt,name=remark,proto3" json:"remark,omitempty"` - // 权限 - Permissions []string `protobuf:"bytes,5,rep,name=permissions,proto3" json:"permissions,omitempty"` - // 创建人 - CreatedBy string `protobuf:"bytes,6,opt,name=created_by,json=createdBy,proto3" json:"created_by,omitempty"` - // 创建时间 - CreatedAt string `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - // 创建人 - UpdatedBy string `protobuf:"bytes,8,opt,name=updated_by,json=updatedBy,proto3" json:"updated_by,omitempty"` - // 创建时间 - UpdatedAt string `protobuf:"bytes,9,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` -} - -func (x *Role) Reset() { - *x = Role{} - if protoimpl.UnsafeEnabled { - mi := &file_v1_components_schemas_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Role) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Role) ProtoMessage() {} - -func (x *Role) ProtoReflect() protoreflect.Message { - mi := &file_v1_components_schemas_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 Role.ProtoReflect.Descriptor instead. -func (*Role) Descriptor() ([]byte, []int) { - return file_v1_components_schemas_proto_rawDescGZIP(), []int{2} -} - -func (x *Role) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *Role) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Role) GetStatus() EnableStatus { - if x != nil { - return x.Status - } - return EnableStatus_ENABLE_STATUS_DEFAULT -} - -func (x *Role) GetRemark() string { - if x != nil { - return x.Remark - } - return "" -} - -func (x *Role) GetPermissions() []string { - if x != nil { - return x.Permissions - } - return nil -} - -func (x *Role) GetCreatedBy() string { - if x != nil { - return x.CreatedBy - } - return "" -} - -func (x *Role) GetCreatedAt() string { - if x != nil { - return x.CreatedAt - } - return "" -} - -func (x *Role) GetUpdatedBy() string { - if x != nil { - return x.UpdatedBy - } - return "" -} - -func (x *Role) GetUpdatedAt() string { - if x != nil { - return x.UpdatedAt - } - return "" -} - -type Menu struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // 菜单ID - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // 菜单名称 - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // 菜单路径 - Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` - // 菜单排序 - Sort int64 `protobuf:"varint,4,opt,name=sort,proto3" json:"sort,omitempty"` - // 父级菜单ID - Pid string `protobuf:"bytes,6,opt,name=pid,proto3" json:"pid,omitempty"` - // 菜单类型 - Type MenuType `protobuf:"varint,7,opt,name=type,proto3,enum=componentsV1.MenuType" json:"type,omitempty"` - // 是否隐藏 - Hidden MenuHidden `protobuf:"varint,8,opt,name=hidden,proto3,enum=componentsV1.MenuHidden" json:"hidden,omitempty"` - // 权限码 - PermissionCode string `protobuf:"bytes,9,opt,name=permission_code,json=permissionCode,proto3" json:"permission_code,omitempty"` - // 子菜单 - Children []*Menu `protobuf:"bytes,10,rep,name=children,proto3" json:"children,omitempty"` -} - -func (x *Menu) Reset() { - *x = Menu{} - if protoimpl.UnsafeEnabled { - mi := &file_v1_components_schemas_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Menu) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Menu) ProtoMessage() {} - -func (x *Menu) ProtoReflect() protoreflect.Message { - mi := &file_v1_components_schemas_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 Menu.ProtoReflect.Descriptor instead. -func (*Menu) Descriptor() ([]byte, []int) { - return file_v1_components_schemas_proto_rawDescGZIP(), []int{3} -} - -func (x *Menu) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *Menu) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Menu) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -func (x *Menu) GetSort() int64 { - if x != nil { - return x.Sort - } - return 0 -} - -func (x *Menu) GetPid() string { - if x != nil { - return x.Pid - } - return "" -} - -func (x *Menu) GetType() MenuType { - if x != nil { - return x.Type - } - return MenuType_MENU_TYPE_DEFAULT -} - -func (x *Menu) GetHidden() MenuHidden { - if x != nil { - return x.Hidden - } - return MenuHidden_MENU_HIDDEN_DEFAULT -} - -func (x *Menu) GetPermissionCode() string { - if x != nil { - return x.PermissionCode - } - return "" -} - -func (x *Menu) GetChildren() []*Menu { - if x != nil { - return x.Children - } - return nil -} - -type Btn struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // 按钮id - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - // 按钮名称 - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - // 按钮路径 - Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"` -} - -func (x *Btn) Reset() { - *x = Btn{} - if protoimpl.UnsafeEnabled { - mi := &file_v1_components_schemas_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Btn) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Btn) ProtoMessage() {} - -func (x *Btn) ProtoReflect() protoreflect.Message { - mi := &file_v1_components_schemas_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 Btn.ProtoReflect.Descriptor instead. -func (*Btn) Descriptor() ([]byte, []int) { - return file_v1_components_schemas_proto_rawDescGZIP(), []int{4} -} - -func (x *Btn) GetId() int64 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *Btn) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *Btn) GetPath() string { - if x != nil { - return x.Path - } - return "" -} - -type AccessToken struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // 访问 Token - AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` - // 过期(秒) - ExpiresIn int64 `protobuf:"varint,2,opt,name=expires_in,json=expiresIn,proto3" json:"expires_in,omitempty"` - // Token 类型 - TokenType string `protobuf:"bytes,3,opt,name=token_type,json=tokenType,proto3" json:"token_type,omitempty"` -} - -func (x *AccessToken) Reset() { - *x = AccessToken{} - if protoimpl.UnsafeEnabled { - mi := &file_v1_components_schemas_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AccessToken) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AccessToken) ProtoMessage() {} - -func (x *AccessToken) ProtoReflect() protoreflect.Message { - mi := &file_v1_components_schemas_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 AccessToken.ProtoReflect.Descriptor instead. -func (*AccessToken) Descriptor() ([]byte, []int) { - return file_v1_components_schemas_proto_rawDescGZIP(), []int{5} -} - -func (x *AccessToken) GetAccessToken() string { - if x != nil { - return x.AccessToken - } - return "" -} - -func (x *AccessToken) GetExpiresIn() int64 { - if x != nil { - return x.ExpiresIn - } - return 0 -} - -func (x *AccessToken) GetTokenType() string { - if x != nil { - return x.TokenType - } - return "" -} - -type QrCode struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Secret string `protobuf:"bytes,1,opt,name=secret,proto3" json:"secret,omitempty"` -} - -func (x *QrCode) Reset() { - *x = QrCode{} - if protoimpl.UnsafeEnabled { - mi := &file_v1_components_schemas_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *QrCode) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*QrCode) ProtoMessage() {} - -func (x *QrCode) ProtoReflect() protoreflect.Message { - mi := &file_v1_components_schemas_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 QrCode.ProtoReflect.Descriptor instead. -func (*QrCode) Descriptor() ([]byte, []int) { - return file_v1_components_schemas_proto_rawDescGZIP(), []int{6} -} - -func (x *QrCode) GetSecret() string { - if x != nil { - return x.Secret - } - return "" -} - -var File_v1_components_schemas_proto protoreflect.FileDescriptor - -var file_v1_components_schemas_proto_rawDesc = []byte{ - 0x0a, 0x1b, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x2f, - 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0c, 0x63, - 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x56, 0x31, 0x1a, 0x20, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x76, - 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x64, 0x69, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x72, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x18, 0x76, - 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x65, 0x6e, 0x75, - 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x51, 0x0a, 0x08, 0x50, 0x61, 0x67, 0x65, 0x49, - 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, - 0x73, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, - 0x53, 0x69, 0x7a, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x22, 0xdf, 0x03, 0x0a, 0x04, 0x55, - 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x2a, 0x0a, 0x11, 0x65, 0x6d, 0x61, - 0x69, 0x6c, 0x5f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x56, 0x65, 0x72, 0x69, 0x66, - 0x69, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x43, 0x6f, 0x64, 0x65, - 0x12, 0x14, 0x0a, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x2e, - 0x0a, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, - 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x56, 0x31, 0x2e, 0x44, 0x69, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x72, 0x79, 0x52, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x12, 0x32, - 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, - 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x56, 0x31, 0x2e, 0x45, 0x6e, - 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x69, 0x6d, 0x65, 0x7a, 0x6f, 0x6e, 0x65, - 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x69, 0x6d, 0x65, 0x7a, 0x6f, 0x6e, 0x65, - 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0c, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, - 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x18, 0x0d, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, 0x12, 0x1d, - 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x0e, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, - 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x62, 0x79, 0x18, 0x0f, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, 0x22, 0x94, 0x02, 0x0a, - 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x32, 0x0a, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x6d, 0x70, - 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x56, 0x31, 0x2e, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x16, 0x0a, - 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, - 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, - 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x6d, - 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x64, 0x5f, 0x62, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x72, 0x65, - 0x61, 0x74, 0x65, 0x64, 0x42, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, - 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, - 0x5f, 0x62, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x64, 0x42, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, - 0x61, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x64, 0x41, 0x74, 0x22, 0x9b, 0x02, 0x0a, 0x04, 0x4d, 0x65, 0x6e, 0x75, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x70, 0x61, 0x74, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x04, 0x73, 0x6f, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x70, 0x69, 0x64, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x70, 0x69, 0x64, 0x12, 0x2a, 0x0a, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x6f, - 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x56, 0x31, 0x2e, 0x4d, 0x65, 0x6e, 0x75, 0x54, 0x79, 0x70, 0x65, - 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x30, 0x0a, 0x06, 0x68, 0x69, 0x64, 0x64, 0x65, 0x6e, - 0x18, 0x08, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, - 0x6e, 0x74, 0x73, 0x56, 0x31, 0x2e, 0x4d, 0x65, 0x6e, 0x75, 0x48, 0x69, 0x64, 0x64, 0x65, 0x6e, - 0x52, 0x06, 0x68, 0x69, 0x64, 0x64, 0x65, 0x6e, 0x12, 0x27, 0x0a, 0x0f, 0x70, 0x65, 0x72, 0x6d, - 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0e, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, - 0x65, 0x12, 0x2e, 0x0a, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, 0x6e, 0x18, 0x0a, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, - 0x56, 0x31, 0x2e, 0x4d, 0x65, 0x6e, 0x75, 0x52, 0x08, 0x63, 0x68, 0x69, 0x6c, 0x64, 0x72, 0x65, - 0x6e, 0x22, 0x3d, 0x0a, 0x03, 0x42, 0x74, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, - 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, - 0x22, 0x6e, 0x0a, 0x0b, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, - 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x69, 0x6e, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x49, - 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, - 0x22, 0x20, 0x0a, 0x06, 0x51, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, - 0x63, 0x72, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x63, 0x72, - 0x65, 0x74, 0x42, 0x57, 0x5a, 0x55, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x66, 0x79, 0x6e, 0x6e, 0x74, 0x61, 0x6e, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, - 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x63, 0x72, 0x75, 0x64, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x3b, 0x63, - 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x33, -} - -var ( - file_v1_components_schemas_proto_rawDescOnce sync.Once - file_v1_components_schemas_proto_rawDescData = file_v1_components_schemas_proto_rawDesc -) - -func file_v1_components_schemas_proto_rawDescGZIP() []byte { - file_v1_components_schemas_proto_rawDescOnce.Do(func() { - file_v1_components_schemas_proto_rawDescData = protoimpl.X.CompressGZIP(file_v1_components_schemas_proto_rawDescData) - }) - return file_v1_components_schemas_proto_rawDescData -} - -var file_v1_components_schemas_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_v1_components_schemas_proto_goTypes = []interface{}{ - (*PageInfo)(nil), // 0: componentsV1.PageInfo - (*User)(nil), // 1: componentsV1.User - (*Role)(nil), // 2: componentsV1.Role - (*Menu)(nil), // 3: componentsV1.Menu - (*Btn)(nil), // 4: componentsV1.Btn - (*AccessToken)(nil), // 5: componentsV1.AccessToken - (*QrCode)(nil), // 6: componentsV1.QrCode - (*Dictionary)(nil), // 7: componentsV1.Dictionary - (EnableStatus)(0), // 8: componentsV1.EnableStatus - (MenuType)(0), // 9: componentsV1.MenuType - (MenuHidden)(0), // 10: componentsV1.MenuHidden -} -var file_v1_components_schemas_proto_depIdxs = []int32{ - 7, // 0: componentsV1.User.roles:type_name -> componentsV1.Dictionary - 8, // 1: componentsV1.User.status:type_name -> componentsV1.EnableStatus - 8, // 2: componentsV1.Role.status:type_name -> componentsV1.EnableStatus - 9, // 3: componentsV1.Menu.type:type_name -> componentsV1.MenuType - 10, // 4: componentsV1.Menu.hidden:type_name -> componentsV1.MenuHidden - 3, // 5: componentsV1.Menu.children:type_name -> componentsV1.Menu - 6, // [6:6] is the sub-list for method output_type - 6, // [6:6] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name -} - -func init() { file_v1_components_schemas_proto_init() } -func file_v1_components_schemas_proto_init() { - if File_v1_components_schemas_proto != nil { - return - } - file_v1_components_dictionary_proto_init() - file_v1_components_enum_proto_init() - if !protoimpl.UnsafeEnabled { - file_v1_components_schemas_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PageInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_v1_components_schemas_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*User); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_v1_components_schemas_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Role); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_v1_components_schemas_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Menu); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_v1_components_schemas_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Btn); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_v1_components_schemas_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AccessToken); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_v1_components_schemas_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QrCode); 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_v1_components_schemas_proto_rawDesc, - NumEnums: 0, - NumMessages: 7, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_v1_components_schemas_proto_goTypes, - DependencyIndexes: file_v1_components_schemas_proto_depIdxs, - MessageInfos: file_v1_components_schemas_proto_msgTypes, - }.Build() - File_v1_components_schemas_proto = out.File - file_v1_components_schemas_proto_rawDesc = nil - file_v1_components_schemas_proto_goTypes = nil - file_v1_components_schemas_proto_depIdxs = nil -} diff --git a/protoc-gen-go-crud/api/v1/components/schemas.proto b/protoc-gen-go-crud/api/v1/components/schemas.proto deleted file mode 100644 index 06450c6..0000000 --- a/protoc-gen-go-crud/api/v1/components/schemas.proto +++ /dev/null @@ -1,119 +0,0 @@ -syntax = "proto3"; - -package componentsV1; - -import "google/protobuf/descriptor.proto"; -import "v1/components/dictionary.proto"; -import "v1/components/enum.proto"; - -option go_package = "github.com/fynntang/protobuf-gen-go/protoc-gen-go-crud/api/v1/components;componentsV1"; - -message PageInfo { - // 当前页码 - int64 page = 1; - // 每页数量 - int64 page_size = 2; - // 总数量 - int64 total = 3; -} - - -message User { - // 用户ID - string id = 1; - // 邮箱 - string email = 2; - // 邮箱验证时间 - string email_verified_at = 3; - // 姓名 - string nickname = 4; - // 手机区号 - string phone_code = 5; - // 手机号 - string phone = 6; - // 头像 - string avatar = 7; - // 角色 - repeated Dictionary roles = 8; - // 状态 - EnableStatus status = 9; - // 权限 - repeated string permissions = 10; - // 时区 - string timezone = 11; - // 创建时间 - string created_at = 12; - // 创建人 - string created_by = 13; - // 更新时间 - string updated_at = 14; - // 更新人 - string updated_by = 15; -} - - - -message Role { - // 角色ID - string id = 1; - // 角色名称 - string name = 2; - // 状态 - EnableStatus status = 3; - // 备注 - string remark = 4; - // 权限 - repeated string permissions = 5; - // 创建人 - string created_by = 6; - // 创建时间 - string created_at = 7; - // 创建人 - string updated_by = 8; - // 创建时间 - string updated_at = 9; -} - -message Menu { - // 菜单ID - string id = 1; - // 菜单名称 - string name = 2; - // 菜单路径 - string path = 3; - // 菜单排序 - int64 sort = 4; - // 父级菜单ID - string pid = 6; - // 菜单类型 - MenuType type = 7; - // 是否隐藏 - MenuHidden hidden = 8; - // 权限码 - string permission_code = 9; - // 子菜单 - repeated Menu children = 10; -} - -message Btn { - // 按钮id - int64 id = 1; - // 按钮名称 - string name = 2; - // 按钮路径 - string path = 3; -} - - -message AccessToken { - // 访问 Token - string access_token = 1; - // 过期(秒) - int64 expires_in = 2; - // Token 类型 - string token_type = 3; -} - -message QrCode { - string secret = 1; -} \ No newline at end of file diff --git a/protoc-gen-go-crud/api/v1/users/users.pb.go b/protoc-gen-go-crud/api/v1/users/users.pb.go deleted file mode 100644 index 47231e9..0000000 --- a/protoc-gen-go-crud/api/v1/users/users.pb.go +++ /dev/null @@ -1,1359 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.30.0 -// protoc v4.23.3 -// source: v1/users/users.proto - -package usersV1 - -import ( - _ "github.com/envoyproxy/protoc-gen-validate/validate" - components "github.com/fynntang/protobuf-gen-go/protoc-gen-go-crud/api/v1/components" - empty "github.com/golang/protobuf/ptypes/empty" - _ "google.golang.org/genproto/googleapis/api/annotations" - 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) -) - -type ListUsersRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // 姓名 - Nickname string `protobuf:"bytes,1,opt,name=nickname,proto3" json:"nickname,omitempty"` - // 邮箱 - Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"` - // 手机号 - Phone string `protobuf:"bytes,3,opt,name=phone,proto3" json:"phone,omitempty"` - // 状态 - Status components.EnableStatus `protobuf:"varint,4,opt,name=status,proto3,enum=componentsV1.EnableStatus" json:"status,omitempty"` - // 角色ID - RoleId string `protobuf:"bytes,5,opt,name=role_id,json=roleId,proto3" json:"role_id,omitempty"` - // 页码 - Page int64 `protobuf:"varint,6,opt,name=page,proto3" json:"page,omitempty"` - // 每页数量 - PageSize int64 `protobuf:"varint,7,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` -} - -func (x *ListUsersRequest) Reset() { - *x = ListUsersRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_v1_users_users_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListUsersRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListUsersRequest) ProtoMessage() {} - -func (x *ListUsersRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_users_users_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 ListUsersRequest.ProtoReflect.Descriptor instead. -func (*ListUsersRequest) Descriptor() ([]byte, []int) { - return file_v1_users_users_proto_rawDescGZIP(), []int{0} -} - -func (x *ListUsersRequest) GetNickname() string { - if x != nil { - return x.Nickname - } - return "" -} - -func (x *ListUsersRequest) GetEmail() string { - if x != nil { - return x.Email - } - return "" -} - -func (x *ListUsersRequest) GetPhone() string { - if x != nil { - return x.Phone - } - return "" -} - -func (x *ListUsersRequest) GetStatus() components.EnableStatus { - if x != nil { - return x.Status - } - return components.EnableStatus(0) -} - -func (x *ListUsersRequest) GetRoleId() string { - if x != nil { - return x.RoleId - } - return "" -} - -func (x *ListUsersRequest) GetPage() int64 { - if x != nil { - return x.Page - } - return 0 -} - -func (x *ListUsersRequest) GetPageSize() int64 { - if x != nil { - return x.PageSize - } - return 0 -} - -type ListUsersReply struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // 用户列表 - List []*components.User `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` - // 分页信息 - PageInfo *components.PageInfo `protobuf:"bytes,2,opt,name=page_info,json=pageInfo,proto3" json:"page_info,omitempty"` -} - -func (x *ListUsersReply) Reset() { - *x = ListUsersReply{} - if protoimpl.UnsafeEnabled { - mi := &file_v1_users_users_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListUsersReply) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListUsersReply) ProtoMessage() {} - -func (x *ListUsersReply) ProtoReflect() protoreflect.Message { - mi := &file_v1_users_users_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 ListUsersReply.ProtoReflect.Descriptor instead. -func (*ListUsersReply) Descriptor() ([]byte, []int) { - return file_v1_users_users_proto_rawDescGZIP(), []int{1} -} - -func (x *ListUsersReply) GetList() []*components.User { - if x != nil { - return x.List - } - return nil -} - -func (x *ListUsersReply) GetPageInfo() *components.PageInfo { - if x != nil { - return x.PageInfo - } - return nil -} - -type CreateUserRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // 姓名 - Nickname string `protobuf:"bytes,1,opt,name=nickname,proto3" json:"nickname,omitempty"` - // 邮箱 - Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"` - // 手机区号 - PhoneCode string `protobuf:"bytes,3,opt,name=phone_code,json=phoneCode,proto3" json:"phone_code,omitempty"` - // 手机号 - Phone string `protobuf:"bytes,4,opt,name=phone,proto3" json:"phone,omitempty"` - // 启用状态 - Enabled components.EnableStatus `protobuf:"varint,5,opt,name=enabled,proto3,enum=componentsV1.EnableStatus" json:"enabled,omitempty"` - // 角色IDs - RoleIds []string `protobuf:"bytes,6,rep,name=role_ids,json=roleIds,proto3" json:"role_ids,omitempty"` -} - -func (x *CreateUserRequest) Reset() { - *x = CreateUserRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_v1_users_users_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateUserRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateUserRequest) ProtoMessage() {} - -func (x *CreateUserRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_users_users_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 CreateUserRequest.ProtoReflect.Descriptor instead. -func (*CreateUserRequest) Descriptor() ([]byte, []int) { - return file_v1_users_users_proto_rawDescGZIP(), []int{2} -} - -func (x *CreateUserRequest) GetNickname() string { - if x != nil { - return x.Nickname - } - return "" -} - -func (x *CreateUserRequest) GetEmail() string { - if x != nil { - return x.Email - } - return "" -} - -func (x *CreateUserRequest) GetPhoneCode() string { - if x != nil { - return x.PhoneCode - } - return "" -} - -func (x *CreateUserRequest) GetPhone() string { - if x != nil { - return x.Phone - } - return "" -} - -func (x *CreateUserRequest) GetEnabled() components.EnableStatus { - if x != nil { - return x.Enabled - } - return components.EnableStatus(0) -} - -func (x *CreateUserRequest) GetRoleIds() []string { - if x != nil { - return x.RoleIds - } - return nil -} - -type UpdateUserRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // 用户ID - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // [] 姓名 - Nickname string `protobuf:"bytes,2,opt,name=nickname,proto3" json:"nickname,omitempty"` - // [] 手机区号 - PhoneCode string `protobuf:"bytes,3,opt,name=phone_code,json=phoneCode,proto3" json:"phone_code,omitempty"` - // [] 手机号 - Phone string `protobuf:"bytes,4,opt,name=phone,proto3" json:"phone,omitempty"` - // [] 头像 - Avatar string `protobuf:"bytes,5,opt,name=avatar,proto3" json:"avatar,omitempty"` - // [] 角色IDs - RoleIds []string `protobuf:"bytes,6,rep,name=role_ids,json=roleIds,proto3" json:"role_ids,omitempty"` - // [] 时区 - Timezone string `protobuf:"bytes,7,opt,name=timezone,proto3" json:"timezone,omitempty"` -} - -func (x *UpdateUserRequest) Reset() { - *x = UpdateUserRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_v1_users_users_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateUserRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateUserRequest) ProtoMessage() {} - -func (x *UpdateUserRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_users_users_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 UpdateUserRequest.ProtoReflect.Descriptor instead. -func (*UpdateUserRequest) Descriptor() ([]byte, []int) { - return file_v1_users_users_proto_rawDescGZIP(), []int{3} -} - -func (x *UpdateUserRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *UpdateUserRequest) GetNickname() string { - if x != nil { - return x.Nickname - } - return "" -} - -func (x *UpdateUserRequest) GetPhoneCode() string { - if x != nil { - return x.PhoneCode - } - return "" -} - -func (x *UpdateUserRequest) GetPhone() string { - if x != nil { - return x.Phone - } - return "" -} - -func (x *UpdateUserRequest) GetAvatar() string { - if x != nil { - return x.Avatar - } - return "" -} - -func (x *UpdateUserRequest) GetRoleIds() []string { - if x != nil { - return x.RoleIds - } - return nil -} - -func (x *UpdateUserRequest) GetTimezone() string { - if x != nil { - return x.Timezone - } - return "" -} - -type GetUserRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // 用户ID - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *GetUserRequest) Reset() { - *x = GetUserRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_v1_users_users_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetUserRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetUserRequest) ProtoMessage() {} - -func (x *GetUserRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_users_users_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 GetUserRequest.ProtoReflect.Descriptor instead. -func (*GetUserRequest) Descriptor() ([]byte, []int) { - return file_v1_users_users_proto_rawDescGZIP(), []int{4} -} - -func (x *GetUserRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -type DeleteUserRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // 用户ID - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *DeleteUserRequest) Reset() { - *x = DeleteUserRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_v1_users_users_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteUserRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteUserRequest) ProtoMessage() {} - -func (x *DeleteUserRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_users_users_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 DeleteUserRequest.ProtoReflect.Descriptor instead. -func (*DeleteUserRequest) Descriptor() ([]byte, []int) { - return file_v1_users_users_proto_rawDescGZIP(), []int{5} -} - -func (x *DeleteUserRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -type UploadProfileRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // 图片信息 - Avatar string `protobuf:"bytes,1,opt,name=avatar,proto3" json:"avatar,omitempty"` -} - -func (x *UploadProfileRequest) Reset() { - *x = UploadProfileRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_v1_users_users_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UploadProfileRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UploadProfileRequest) ProtoMessage() {} - -func (x *UploadProfileRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_users_users_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 UploadProfileRequest.ProtoReflect.Descriptor instead. -func (*UploadProfileRequest) Descriptor() ([]byte, []int) { - return file_v1_users_users_proto_rawDescGZIP(), []int{6} -} - -func (x *UploadProfileRequest) GetAvatar() string { - if x != nil { - return x.Avatar - } - return "" -} - -type UploadProfileResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // 头像路径 - AvatarUrl string `protobuf:"bytes,1,opt,name=avatar_url,json=avatarUrl,proto3" json:"avatar_url,omitempty"` -} - -func (x *UploadProfileResponse) Reset() { - *x = UploadProfileResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_v1_users_users_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UploadProfileResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UploadProfileResponse) ProtoMessage() {} - -func (x *UploadProfileResponse) ProtoReflect() protoreflect.Message { - mi := &file_v1_users_users_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 UploadProfileResponse.ProtoReflect.Descriptor instead. -func (*UploadProfileResponse) Descriptor() ([]byte, []int) { - return file_v1_users_users_proto_rawDescGZIP(), []int{7} -} - -func (x *UploadProfileResponse) GetAvatarUrl() string { - if x != nil { - return x.AvatarUrl - } - return "" -} - -type ResetActivateRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // 用户ID - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *ResetActivateRequest) Reset() { - *x = ResetActivateRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_v1_users_users_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ResetActivateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ResetActivateRequest) ProtoMessage() {} - -func (x *ResetActivateRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_users_users_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 ResetActivateRequest.ProtoReflect.Descriptor instead. -func (*ResetActivateRequest) Descriptor() ([]byte, []int) { - return file_v1_users_users_proto_rawDescGZIP(), []int{8} -} - -func (x *ResetActivateRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -type ResetPasswordRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // 用户ID - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *ResetPasswordRequest) Reset() { - *x = ResetPasswordRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_v1_users_users_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ResetPasswordRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ResetPasswordRequest) ProtoMessage() {} - -func (x *ResetPasswordRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_users_users_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 ResetPasswordRequest.ProtoReflect.Descriptor instead. -func (*ResetPasswordRequest) Descriptor() ([]byte, []int) { - return file_v1_users_users_proto_rawDescGZIP(), []int{9} -} - -func (x *ResetPasswordRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -type ChangePasswordRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // 密码 - Password string `protobuf:"bytes,1,opt,name=password,proto3" json:"password,omitempty"` -} - -func (x *ChangePasswordRequest) Reset() { - *x = ChangePasswordRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_v1_users_users_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ChangePasswordRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ChangePasswordRequest) ProtoMessage() {} - -func (x *ChangePasswordRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_users_users_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 ChangePasswordRequest.ProtoReflect.Descriptor instead. -func (*ChangePasswordRequest) Descriptor() ([]byte, []int) { - return file_v1_users_users_proto_rawDescGZIP(), []int{10} -} - -func (x *ChangePasswordRequest) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -type Reset2FARequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // 用户ID - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *Reset2FARequest) Reset() { - *x = Reset2FARequest{} - if protoimpl.UnsafeEnabled { - mi := &file_v1_users_users_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Reset2FARequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Reset2FARequest) ProtoMessage() {} - -func (x *Reset2FARequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_users_users_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 Reset2FARequest.ProtoReflect.Descriptor instead. -func (*Reset2FARequest) Descriptor() ([]byte, []int) { - return file_v1_users_users_proto_rawDescGZIP(), []int{11} -} - -func (x *Reset2FARequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -type EnableUserRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // 用户ID - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // 状态 - Status components.EnableStatus `protobuf:"varint,2,opt,name=status,proto3,enum=componentsV1.EnableStatus" json:"status,omitempty"` -} - -func (x *EnableUserRequest) Reset() { - *x = EnableUserRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_v1_users_users_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EnableUserRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EnableUserRequest) ProtoMessage() {} - -func (x *EnableUserRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_users_users_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 EnableUserRequest.ProtoReflect.Descriptor instead. -func (*EnableUserRequest) Descriptor() ([]byte, []int) { - return file_v1_users_users_proto_rawDescGZIP(), []int{12} -} - -func (x *EnableUserRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *EnableUserRequest) GetStatus() components.EnableStatus { - if x != nil { - return x.Status - } - return components.EnableStatus(0) -} - -type UpdateCurrentUserRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // [] 姓名 - Nickname string `protobuf:"bytes,2,opt,name=nickname,proto3" json:"nickname,omitempty"` - // [] 手机区号 - PhoneCode string `protobuf:"bytes,3,opt,name=phone_code,json=phoneCode,proto3" json:"phone_code,omitempty"` - // [] 手机号 - Phone string `protobuf:"bytes,4,opt,name=phone,proto3" json:"phone,omitempty"` - // [] 头像 - Avatar string `protobuf:"bytes,5,opt,name=avatar,proto3" json:"avatar,omitempty"` - // [] 时区 - Timezone string `protobuf:"bytes,6,opt,name=timezone,proto3" json:"timezone,omitempty"` -} - -func (x *UpdateCurrentUserRequest) Reset() { - *x = UpdateCurrentUserRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_v1_users_users_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateCurrentUserRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateCurrentUserRequest) ProtoMessage() {} - -func (x *UpdateCurrentUserRequest) ProtoReflect() protoreflect.Message { - mi := &file_v1_users_users_proto_msgTypes[13] - 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 UpdateCurrentUserRequest.ProtoReflect.Descriptor instead. -func (*UpdateCurrentUserRequest) Descriptor() ([]byte, []int) { - return file_v1_users_users_proto_rawDescGZIP(), []int{13} -} - -func (x *UpdateCurrentUserRequest) GetNickname() string { - if x != nil { - return x.Nickname - } - return "" -} - -func (x *UpdateCurrentUserRequest) GetPhoneCode() string { - if x != nil { - return x.PhoneCode - } - return "" -} - -func (x *UpdateCurrentUserRequest) GetPhone() string { - if x != nil { - return x.Phone - } - return "" -} - -func (x *UpdateCurrentUserRequest) GetAvatar() string { - if x != nil { - return x.Avatar - } - return "" -} - -func (x *UpdateCurrentUserRequest) GetTimezone() string { - if x != nil { - return x.Timezone - } - return "" -} - -var File_v1_users_users_proto protoreflect.FileDescriptor - -var file_v1_users_users_proto_rawDesc = []byte{ - 0x0a, 0x14, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x1a, - 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, - 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, - 0x74, 0x73, 0x2f, 0x73, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x18, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x2f, - 0x65, 0x6e, 0x75, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf8, 0x01, 0x0a, 0x10, 0x4c, - 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x24, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x72, 0x03, 0xd0, 0x01, 0x01, 0x52, 0x08, 0x6e, 0x69, 0x63, - 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x72, 0x03, 0xd0, 0x01, 0x01, 0x52, 0x05, - 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x20, 0x0a, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x18, 0x0b, 0xd0, 0x01, 0x01, - 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x32, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, - 0x65, 0x6e, 0x74, 0x73, 0x56, 0x31, 0x2e, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x17, 0x0a, 0x07, 0x72, - 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x6f, - 0x6c, 0x65, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, - 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x70, 0x61, 0x67, - 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x6d, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, - 0x72, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x26, 0x0a, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, - 0x74, 0x73, 0x56, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x12, - 0x33, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x56, - 0x31, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, - 0x49, 0x6e, 0x66, 0x6f, 0x22, 0xf8, 0x01, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, - 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x08, 0x6e, 0x69, - 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x09, 0xfa, 0x42, - 0x06, 0x72, 0x04, 0x10, 0x01, 0x18, 0x1e, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, - 0x65, 0x12, 0x20, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x0a, 0xfa, 0x42, 0x07, 0x72, 0x05, 0x10, 0x01, 0x18, 0x80, 0x01, 0x52, 0x05, 0x65, 0x6d, - 0x61, 0x69, 0x6c, 0x12, 0x28, 0x0a, 0x0a, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x5f, 0x63, 0x6f, 0x64, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x09, 0xfa, 0x42, 0x06, 0x72, 0x04, 0x10, 0x01, - 0x18, 0x0a, 0x52, 0x09, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1f, 0x0a, - 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x09, 0xfa, 0x42, - 0x06, 0x72, 0x04, 0x10, 0x01, 0x18, 0x14, 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x34, - 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, - 0x1a, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x56, 0x31, 0x2e, 0x45, - 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x07, 0x65, 0x6e, 0x61, - 0x62, 0x6c, 0x65, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x73, - 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x72, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x73, 0x22, - 0xde, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x23, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, - 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x18, 0x1e, - 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x0a, 0x70, 0x68, - 0x6f, 0x6e, 0x65, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, - 0xfa, 0x42, 0x04, 0x72, 0x02, 0x18, 0x0a, 0x52, 0x09, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x43, 0x6f, - 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x18, 0x14, 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, - 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x72, 0x6f, 0x6c, - 0x65, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x72, 0x6f, 0x6c, - 0x65, 0x49, 0x64, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x69, 0x6d, 0x65, 0x7a, 0x6f, 0x6e, 0x65, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x69, 0x6d, 0x65, 0x7a, 0x6f, 0x6e, 0x65, - 0x22, 0x20, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, - 0x69, 0x64, 0x22, 0x23, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x2e, 0x0a, 0x14, 0x55, 0x70, 0x6c, 0x6f, 0x61, - 0x64, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x22, 0x36, 0x0a, 0x15, 0x55, 0x70, 0x6c, 0x6f, 0x61, - 0x64, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x55, 0x72, 0x6c, 0x22, - 0x26, 0x0a, 0x14, 0x52, 0x65, 0x73, 0x65, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x26, 0x0a, 0x14, 0x52, 0x65, 0x73, 0x65, 0x74, - 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, - 0x33, 0x0a, 0x15, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, - 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, - 0x77, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, - 0x77, 0x6f, 0x72, 0x64, 0x22, 0x21, 0x0a, 0x0f, 0x52, 0x65, 0x73, 0x65, 0x74, 0x32, 0x46, 0x41, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x57, 0x0a, 0x11, 0x45, 0x6e, 0x61, 0x62, 0x6c, - 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x32, 0x0a, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x63, - 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x56, 0x31, 0x2e, 0x45, 0x6e, 0x61, 0x62, - 0x6c, 0x65, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x22, 0x9f, 0x01, 0x0a, 0x18, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x75, 0x72, 0x72, 0x65, - 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, - 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x68, 0x6f, - 0x6e, 0x65, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, - 0x68, 0x6f, 0x6e, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x68, 0x6f, 0x6e, - 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x12, 0x16, - 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x69, 0x6d, 0x65, 0x7a, 0x6f, - 0x6e, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x69, 0x6d, 0x65, 0x7a, 0x6f, - 0x6e, 0x65, 0x32, 0xec, 0x09, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x52, 0x0a, 0x09, 0x4c, - 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x19, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, - 0x56, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x2e, 0x4c, 0x69, - 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x11, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x0b, 0x12, 0x09, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, - 0x56, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1a, 0x2e, - 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, - 0x79, 0x22, 0x14, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x3a, 0x01, 0x2a, 0x22, 0x09, 0x2f, 0x76, - 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x5b, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1a, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x2e, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, - 0x13, 0x3a, 0x01, 0x2a, 0x1a, 0x0e, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, - 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x4e, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, - 0x17, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, - 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x6f, - 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x56, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x16, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x10, 0x12, 0x0e, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, - 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x58, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, - 0x65, 0x72, 0x12, 0x1a, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x2e, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x2a, 0x0e, - 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x72, - 0x0a, 0x0d, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, - 0x1d, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, - 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, - 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x2e, 0x55, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x50, - 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x3a, 0x01, 0x2a, 0x22, 0x17, 0x2f, 0x76, 0x31, 0x2f, 0x75, - 0x73, 0x65, 0x72, 0x2f, 0x75, 0x70, 0x6c, 0x6f, 0x61, 0x64, 0x2d, 0x70, 0x72, 0x6f, 0x66, 0x69, - 0x6c, 0x65, 0x12, 0x6a, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x65, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, - 0x61, 0x74, 0x65, 0x12, 0x1d, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x2e, 0x52, 0x65, - 0x73, 0x65, 0x74, 0x41, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x22, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x1c, 0x3a, 0x01, 0x2a, 0x22, 0x17, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, - 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x61, 0x74, 0x65, 0x12, 0x70, - 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x65, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, - 0x1d, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x50, - 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x28, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x3a, 0x01, - 0x2a, 0x22, 0x1d, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, - 0x7d, 0x2f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x2f, 0x72, 0x65, 0x73, 0x65, 0x74, - 0x12, 0x61, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x65, 0x74, 0x32, 0x46, 0x41, 0x12, 0x18, 0x2e, 0x75, - 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x74, 0x32, 0x46, 0x41, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x23, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x3a, 0x01, 0x2a, 0x22, 0x18, 0x2f, 0x76, 0x31, 0x2f, 0x75, - 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x2f, 0x32, 0x66, 0x61, 0x2f, 0x72, 0x65, - 0x73, 0x65, 0x74, 0x12, 0x62, 0x0a, 0x0a, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x55, 0x73, 0x65, - 0x72, 0x12, 0x1a, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x2e, 0x45, 0x6e, 0x61, 0x62, - 0x6c, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x3a, 0x01, 0x2a, - 0x22, 0x15, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x7b, 0x69, 0x64, 0x7d, - 0x2f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x44, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, - 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x12, 0x2e, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, - 0x65, 0x6e, 0x74, 0x73, 0x56, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x10, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x0a, 0x12, 0x08, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x12, 0x6d, 0x0a, - 0x0e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, - 0x1e, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, - 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x3a, - 0x01, 0x2a, 0x1a, 0x18, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x70, 0x61, 0x73, - 0x73, 0x77, 0x6f, 0x72, 0x64, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x63, 0x0a, 0x11, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, - 0x72, 0x12, 0x21, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x13, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x0d, 0x3a, 0x01, 0x2a, 0x1a, 0x08, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, - 0x72, 0x42, 0x35, 0x5a, 0x33, 0x62, 0x69, 0x74, 0x62, 0x75, 0x63, 0x6b, 0x65, 0x74, 0x2e, 0x6f, - 0x72, 0x67, 0x2f, 0x61, 0x6e, 0x74, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x64, 0x65, 0x76, 0x2f, 0x65, - 0x61, 0x72, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, - 0x3b, 0x75, 0x73, 0x65, 0x72, 0x73, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_v1_users_users_proto_rawDescOnce sync.Once - file_v1_users_users_proto_rawDescData = file_v1_users_users_proto_rawDesc -) - -func file_v1_users_users_proto_rawDescGZIP() []byte { - file_v1_users_users_proto_rawDescOnce.Do(func() { - file_v1_users_users_proto_rawDescData = protoimpl.X.CompressGZIP(file_v1_users_users_proto_rawDescData) - }) - return file_v1_users_users_proto_rawDescData -} - -var file_v1_users_users_proto_msgTypes = make([]protoimpl.MessageInfo, 14) -var file_v1_users_users_proto_goTypes = []interface{}{ - (*ListUsersRequest)(nil), // 0: usersV1.ListUsersRequest - (*ListUsersReply)(nil), // 1: usersV1.ListUsersReply - (*CreateUserRequest)(nil), // 2: usersV1.CreateUserRequest - (*UpdateUserRequest)(nil), // 3: usersV1.UpdateUserRequest - (*GetUserRequest)(nil), // 4: usersV1.GetUserRequest - (*DeleteUserRequest)(nil), // 5: usersV1.DeleteUserRequest - (*UploadProfileRequest)(nil), // 6: usersV1.UploadProfileRequest - (*UploadProfileResponse)(nil), // 7: usersV1.UploadProfileResponse - (*ResetActivateRequest)(nil), // 8: usersV1.ResetActivateRequest - (*ResetPasswordRequest)(nil), // 9: usersV1.ResetPasswordRequest - (*ChangePasswordRequest)(nil), // 10: usersV1.ChangePasswordRequest - (*Reset2FARequest)(nil), // 11: usersV1.Reset2FARequest - (*EnableUserRequest)(nil), // 12: usersV1.EnableUserRequest - (*UpdateCurrentUserRequest)(nil), // 13: usersV1.UpdateCurrentUserRequest - (components.EnableStatus)(0), // 14: componentsV1.EnableStatus - (*components.User)(nil), // 15: componentsV1.User - (*components.PageInfo)(nil), // 16: componentsV1.PageInfo - (*empty.Empty)(nil), // 17: google.protobuf.Empty -} -var file_v1_users_users_proto_depIdxs = []int32{ - 14, // 0: usersV1.ListUsersRequest.status:type_name -> componentsV1.EnableStatus - 15, // 1: usersV1.ListUsersReply.list:type_name -> componentsV1.User - 16, // 2: usersV1.ListUsersReply.page_info:type_name -> componentsV1.PageInfo - 14, // 3: usersV1.CreateUserRequest.enabled:type_name -> componentsV1.EnableStatus - 14, // 4: usersV1.EnableUserRequest.status:type_name -> componentsV1.EnableStatus - 0, // 5: usersV1.User.ListUsers:input_type -> usersV1.ListUsersRequest - 2, // 6: usersV1.User.CreateUser:input_type -> usersV1.CreateUserRequest - 3, // 7: usersV1.User.UpdateUser:input_type -> usersV1.UpdateUserRequest - 4, // 8: usersV1.User.GetUser:input_type -> usersV1.GetUserRequest - 5, // 9: usersV1.User.DeleteUser:input_type -> usersV1.DeleteUserRequest - 6, // 10: usersV1.User.UploadProfile:input_type -> usersV1.UploadProfileRequest - 8, // 11: usersV1.User.ResetActivate:input_type -> usersV1.ResetActivateRequest - 9, // 12: usersV1.User.ResetPassword:input_type -> usersV1.ResetPasswordRequest - 11, // 13: usersV1.User.Reset2FA:input_type -> usersV1.Reset2FARequest - 12, // 14: usersV1.User.EnableUser:input_type -> usersV1.EnableUserRequest - 17, // 15: usersV1.User.User:input_type -> google.protobuf.Empty - 10, // 16: usersV1.User.ChangePassword:input_type -> usersV1.ChangePasswordRequest - 13, // 17: usersV1.User.UpdateCurrentUser:input_type -> usersV1.UpdateCurrentUserRequest - 1, // 18: usersV1.User.ListUsers:output_type -> usersV1.ListUsersReply - 17, // 19: usersV1.User.CreateUser:output_type -> google.protobuf.Empty - 17, // 20: usersV1.User.UpdateUser:output_type -> google.protobuf.Empty - 15, // 21: usersV1.User.GetUser:output_type -> componentsV1.User - 17, // 22: usersV1.User.DeleteUser:output_type -> google.protobuf.Empty - 7, // 23: usersV1.User.UploadProfile:output_type -> usersV1.UploadProfileResponse - 17, // 24: usersV1.User.ResetActivate:output_type -> google.protobuf.Empty - 17, // 25: usersV1.User.ResetPassword:output_type -> google.protobuf.Empty - 17, // 26: usersV1.User.Reset2FA:output_type -> google.protobuf.Empty - 17, // 27: usersV1.User.EnableUser:output_type -> google.protobuf.Empty - 15, // 28: usersV1.User.User:output_type -> componentsV1.User - 17, // 29: usersV1.User.ChangePassword:output_type -> google.protobuf.Empty - 17, // 30: usersV1.User.UpdateCurrentUser:output_type -> google.protobuf.Empty - 18, // [18:31] is the sub-list for method output_type - 5, // [5:18] is the sub-list for method input_type - 5, // [5:5] is the sub-list for extension type_name - 5, // [5:5] is the sub-list for extension extendee - 0, // [0:5] is the sub-list for field type_name -} - -func init() { file_v1_users_users_proto_init() } -func file_v1_users_users_proto_init() { - if File_v1_users_users_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_v1_users_users_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListUsersRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_v1_users_users_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListUsersReply); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_v1_users_users_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateUserRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_v1_users_users_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateUserRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_v1_users_users_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetUserRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_v1_users_users_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteUserRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_v1_users_users_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UploadProfileRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_v1_users_users_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UploadProfileResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_v1_users_users_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResetActivateRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_v1_users_users_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ResetPasswordRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_v1_users_users_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChangePasswordRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_v1_users_users_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Reset2FARequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_v1_users_users_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EnableUserRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_v1_users_users_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateCurrentUserRequest); 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_v1_users_users_proto_rawDesc, - NumEnums: 0, - NumMessages: 14, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_v1_users_users_proto_goTypes, - DependencyIndexes: file_v1_users_users_proto_depIdxs, - MessageInfos: file_v1_users_users_proto_msgTypes, - }.Build() - File_v1_users_users_proto = out.File - file_v1_users_users_proto_rawDesc = nil - file_v1_users_users_proto_goTypes = nil - file_v1_users_users_proto_depIdxs = nil -} diff --git a/protoc-gen-go-crud/api/v1/users/users.pb.validate.go b/protoc-gen-go-crud/api/v1/users/users.pb.validate.go deleted file mode 100644 index a439dae..0000000 --- a/protoc-gen-go-crud/api/v1/users/users.pb.validate.go +++ /dev/null @@ -1,1669 +0,0 @@ -// Code generated by protoc-gen-validate. DO NOT EDIT. -// source: v1/users/users.proto - -package usersV1 - -import ( - "bytes" - "errors" - "fmt" - "net" - "net/mail" - "net/url" - "regexp" - "sort" - "strings" - "time" - "unicode/utf8" - - "google.golang.org/protobuf/types/known/anypb" - - componentsV1 "bitbucket.org/antalphadev/earn/api/v1/components" -) - -// ensure the imports are used -var ( - _ = bytes.MinRead - _ = errors.New("") - _ = fmt.Print - _ = utf8.UTFMax - _ = (*regexp.Regexp)(nil) - _ = (*strings.Reader)(nil) - _ = net.IPv4len - _ = time.Duration(0) - _ = (*url.URL)(nil) - _ = (*mail.Address)(nil) - _ = anypb.Any{} - _ = sort.Sort - - _ = componentsV1.EnableStatus(0) -) - -// Validate checks the field values on ListUsersRequest with the rules defined -// in the proto definition for this message. If any rules are violated, the -// first error encountered is returned, or nil if there are no violations. -func (m *ListUsersRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListUsersRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// ListUsersRequestMultiError, or nil if none found. -func (m *ListUsersRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ListUsersRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if m.GetNickname() != "" { - - } - - if m.GetEmail() != "" { - - } - - if m.GetPhone() != "" { - - if utf8.RuneCountInString(m.GetPhone()) > 11 { - err := ListUsersRequestValidationError{ - field: "Phone", - reason: "value length must be at most 11 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - } - - // no validation rules for Status - - // no validation rules for RoleId - - // no validation rules for Page - - // no validation rules for PageSize - - if len(errors) > 0 { - return ListUsersRequestMultiError(errors) - } - - return nil -} - -// ListUsersRequestMultiError is an error wrapping multiple validation errors -// returned by ListUsersRequest.ValidateAll() if the designated constraints -// aren't met. -type ListUsersRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListUsersRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ListUsersRequestMultiError) AllErrors() []error { return m } - -// ListUsersRequestValidationError is the validation error returned by -// ListUsersRequest.Validate if the designated constraints aren't met. -type ListUsersRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListUsersRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListUsersRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListUsersRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListUsersRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListUsersRequestValidationError) ErrorName() string { return "ListUsersRequestValidationError" } - -// Error satisfies the builtin error interface -func (e ListUsersRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sListUsersRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListUsersRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListUsersRequestValidationError{} - -// Validate checks the field values on ListUsersReply with the rules defined in -// the proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *ListUsersReply) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ListUsersReply with the rules defined -// in the proto definition for this message. If any rules are violated, the -// result is a list of violation errors wrapped in ListUsersReplyMultiError, -// or nil if none found. -func (m *ListUsersReply) ValidateAll() error { - return m.validate(true) -} - -func (m *ListUsersReply) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - for idx, item := range m.GetList() { - _, _ = idx, item - - if all { - switch v := interface{}(item).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListUsersReplyValidationError{ - field: fmt.Sprintf("List[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListUsersReplyValidationError{ - field: fmt.Sprintf("List[%v]", idx), - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListUsersReplyValidationError{ - field: fmt.Sprintf("List[%v]", idx), - reason: "embedded message failed validation", - cause: err, - } - } - } - - } - - if all { - switch v := interface{}(m.GetPageInfo()).(type) { - case interface{ ValidateAll() error }: - if err := v.ValidateAll(); err != nil { - errors = append(errors, ListUsersReplyValidationError{ - field: "PageInfo", - reason: "embedded message failed validation", - cause: err, - }) - } - case interface{ Validate() error }: - if err := v.Validate(); err != nil { - errors = append(errors, ListUsersReplyValidationError{ - field: "PageInfo", - reason: "embedded message failed validation", - cause: err, - }) - } - } - } else if v, ok := interface{}(m.GetPageInfo()).(interface{ Validate() error }); ok { - if err := v.Validate(); err != nil { - return ListUsersReplyValidationError{ - field: "PageInfo", - reason: "embedded message failed validation", - cause: err, - } - } - } - - if len(errors) > 0 { - return ListUsersReplyMultiError(errors) - } - - return nil -} - -// ListUsersReplyMultiError is an error wrapping multiple validation errors -// returned by ListUsersReply.ValidateAll() if the designated constraints -// aren't met. -type ListUsersReplyMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ListUsersReplyMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ListUsersReplyMultiError) AllErrors() []error { return m } - -// ListUsersReplyValidationError is the validation error returned by -// ListUsersReply.Validate if the designated constraints aren't met. -type ListUsersReplyValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ListUsersReplyValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ListUsersReplyValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ListUsersReplyValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ListUsersReplyValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ListUsersReplyValidationError) ErrorName() string { return "ListUsersReplyValidationError" } - -// Error satisfies the builtin error interface -func (e ListUsersReplyValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sListUsersReply.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ListUsersReplyValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ListUsersReplyValidationError{} - -// Validate checks the field values on CreateUserRequest with the rules defined -// in the proto definition for this message. If any rules are violated, the -// first error encountered is returned, or nil if there are no violations. -func (m *CreateUserRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on CreateUserRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// CreateUserRequestMultiError, or nil if none found. -func (m *CreateUserRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *CreateUserRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - if l := utf8.RuneCountInString(m.GetNickname()); l < 1 || l > 30 { - err := CreateUserRequestValidationError{ - field: "Nickname", - reason: "value length must be between 1 and 30 runes, inclusive", - } - if !all { - return err - } - errors = append(errors, err) - } - - if l := utf8.RuneCountInString(m.GetEmail()); l < 1 || l > 128 { - err := CreateUserRequestValidationError{ - field: "Email", - reason: "value length must be between 1 and 128 runes, inclusive", - } - if !all { - return err - } - errors = append(errors, err) - } - - if l := utf8.RuneCountInString(m.GetPhoneCode()); l < 1 || l > 10 { - err := CreateUserRequestValidationError{ - field: "PhoneCode", - reason: "value length must be between 1 and 10 runes, inclusive", - } - if !all { - return err - } - errors = append(errors, err) - } - - if l := utf8.RuneCountInString(m.GetPhone()); l < 1 || l > 20 { - err := CreateUserRequestValidationError{ - field: "Phone", - reason: "value length must be between 1 and 20 runes, inclusive", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Enabled - - if len(errors) > 0 { - return CreateUserRequestMultiError(errors) - } - - return nil -} - -// CreateUserRequestMultiError is an error wrapping multiple validation errors -// returned by CreateUserRequest.ValidateAll() if the designated constraints -// aren't met. -type CreateUserRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m CreateUserRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m CreateUserRequestMultiError) AllErrors() []error { return m } - -// CreateUserRequestValidationError is the validation error returned by -// CreateUserRequest.Validate if the designated constraints aren't met. -type CreateUserRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e CreateUserRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e CreateUserRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e CreateUserRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e CreateUserRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e CreateUserRequestValidationError) ErrorName() string { - return "CreateUserRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e CreateUserRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sCreateUserRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = CreateUserRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = CreateUserRequestValidationError{} - -// Validate checks the field values on UpdateUserRequest with the rules defined -// in the proto definition for this message. If any rules are violated, the -// first error encountered is returned, or nil if there are no violations. -func (m *UpdateUserRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UpdateUserRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// UpdateUserRequestMultiError, or nil if none found. -func (m *UpdateUserRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *UpdateUserRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Id - - if utf8.RuneCountInString(m.GetNickname()) > 30 { - err := UpdateUserRequestValidationError{ - field: "Nickname", - reason: "value length must be at most 30 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetPhoneCode()) > 10 { - err := UpdateUserRequestValidationError{ - field: "PhoneCode", - reason: "value length must be at most 10 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - if utf8.RuneCountInString(m.GetPhone()) > 20 { - err := UpdateUserRequestValidationError{ - field: "Phone", - reason: "value length must be at most 20 runes", - } - if !all { - return err - } - errors = append(errors, err) - } - - // no validation rules for Avatar - - // no validation rules for Timezone - - if len(errors) > 0 { - return UpdateUserRequestMultiError(errors) - } - - return nil -} - -// UpdateUserRequestMultiError is an error wrapping multiple validation errors -// returned by UpdateUserRequest.ValidateAll() if the designated constraints -// aren't met. -type UpdateUserRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UpdateUserRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m UpdateUserRequestMultiError) AllErrors() []error { return m } - -// UpdateUserRequestValidationError is the validation error returned by -// UpdateUserRequest.Validate if the designated constraints aren't met. -type UpdateUserRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UpdateUserRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UpdateUserRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UpdateUserRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UpdateUserRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UpdateUserRequestValidationError) ErrorName() string { - return "UpdateUserRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e UpdateUserRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sUpdateUserRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UpdateUserRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UpdateUserRequestValidationError{} - -// Validate checks the field values on GetUserRequest with the rules defined in -// the proto definition for this message. If any rules are violated, the first -// error encountered is returned, or nil if there are no violations. -func (m *GetUserRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on GetUserRequest with the rules defined -// in the proto definition for this message. If any rules are violated, the -// result is a list of violation errors wrapped in GetUserRequestMultiError, -// or nil if none found. -func (m *GetUserRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *GetUserRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Id - - if len(errors) > 0 { - return GetUserRequestMultiError(errors) - } - - return nil -} - -// GetUserRequestMultiError is an error wrapping multiple validation errors -// returned by GetUserRequest.ValidateAll() if the designated constraints -// aren't met. -type GetUserRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m GetUserRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m GetUserRequestMultiError) AllErrors() []error { return m } - -// GetUserRequestValidationError is the validation error returned by -// GetUserRequest.Validate if the designated constraints aren't met. -type GetUserRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e GetUserRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e GetUserRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e GetUserRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e GetUserRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e GetUserRequestValidationError) ErrorName() string { return "GetUserRequestValidationError" } - -// Error satisfies the builtin error interface -func (e GetUserRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sGetUserRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = GetUserRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = GetUserRequestValidationError{} - -// Validate checks the field values on DeleteUserRequest with the rules defined -// in the proto definition for this message. If any rules are violated, the -// first error encountered is returned, or nil if there are no violations. -func (m *DeleteUserRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on DeleteUserRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// DeleteUserRequestMultiError, or nil if none found. -func (m *DeleteUserRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *DeleteUserRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Id - - if len(errors) > 0 { - return DeleteUserRequestMultiError(errors) - } - - return nil -} - -// DeleteUserRequestMultiError is an error wrapping multiple validation errors -// returned by DeleteUserRequest.ValidateAll() if the designated constraints -// aren't met. -type DeleteUserRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m DeleteUserRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m DeleteUserRequestMultiError) AllErrors() []error { return m } - -// DeleteUserRequestValidationError is the validation error returned by -// DeleteUserRequest.Validate if the designated constraints aren't met. -type DeleteUserRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e DeleteUserRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e DeleteUserRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e DeleteUserRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e DeleteUserRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e DeleteUserRequestValidationError) ErrorName() string { - return "DeleteUserRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e DeleteUserRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sDeleteUserRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = DeleteUserRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = DeleteUserRequestValidationError{} - -// Validate checks the field values on UploadProfileRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *UploadProfileRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UploadProfileRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// UploadProfileRequestMultiError, or nil if none found. -func (m *UploadProfileRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *UploadProfileRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Avatar - - if len(errors) > 0 { - return UploadProfileRequestMultiError(errors) - } - - return nil -} - -// UploadProfileRequestMultiError is an error wrapping multiple validation -// errors returned by UploadProfileRequest.ValidateAll() if the designated -// constraints aren't met. -type UploadProfileRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UploadProfileRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m UploadProfileRequestMultiError) AllErrors() []error { return m } - -// UploadProfileRequestValidationError is the validation error returned by -// UploadProfileRequest.Validate if the designated constraints aren't met. -type UploadProfileRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UploadProfileRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UploadProfileRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UploadProfileRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UploadProfileRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UploadProfileRequestValidationError) ErrorName() string { - return "UploadProfileRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e UploadProfileRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sUploadProfileRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UploadProfileRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UploadProfileRequestValidationError{} - -// Validate checks the field values on UploadProfileResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *UploadProfileResponse) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UploadProfileResponse with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// UploadProfileResponseMultiError, or nil if none found. -func (m *UploadProfileResponse) ValidateAll() error { - return m.validate(true) -} - -func (m *UploadProfileResponse) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for AvatarUrl - - if len(errors) > 0 { - return UploadProfileResponseMultiError(errors) - } - - return nil -} - -// UploadProfileResponseMultiError is an error wrapping multiple validation -// errors returned by UploadProfileResponse.ValidateAll() if the designated -// constraints aren't met. -type UploadProfileResponseMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UploadProfileResponseMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m UploadProfileResponseMultiError) AllErrors() []error { return m } - -// UploadProfileResponseValidationError is the validation error returned by -// UploadProfileResponse.Validate if the designated constraints aren't met. -type UploadProfileResponseValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UploadProfileResponseValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UploadProfileResponseValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UploadProfileResponseValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UploadProfileResponseValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UploadProfileResponseValidationError) ErrorName() string { - return "UploadProfileResponseValidationError" -} - -// Error satisfies the builtin error interface -func (e UploadProfileResponseValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sUploadProfileResponse.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UploadProfileResponseValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UploadProfileResponseValidationError{} - -// Validate checks the field values on ResetActivateRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *ResetActivateRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ResetActivateRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// ResetActivateRequestMultiError, or nil if none found. -func (m *ResetActivateRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ResetActivateRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Id - - if len(errors) > 0 { - return ResetActivateRequestMultiError(errors) - } - - return nil -} - -// ResetActivateRequestMultiError is an error wrapping multiple validation -// errors returned by ResetActivateRequest.ValidateAll() if the designated -// constraints aren't met. -type ResetActivateRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ResetActivateRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ResetActivateRequestMultiError) AllErrors() []error { return m } - -// ResetActivateRequestValidationError is the validation error returned by -// ResetActivateRequest.Validate if the designated constraints aren't met. -type ResetActivateRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ResetActivateRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ResetActivateRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ResetActivateRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ResetActivateRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ResetActivateRequestValidationError) ErrorName() string { - return "ResetActivateRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ResetActivateRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sResetActivateRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ResetActivateRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ResetActivateRequestValidationError{} - -// Validate checks the field values on ResetPasswordRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *ResetPasswordRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ResetPasswordRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// ResetPasswordRequestMultiError, or nil if none found. -func (m *ResetPasswordRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ResetPasswordRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Id - - if len(errors) > 0 { - return ResetPasswordRequestMultiError(errors) - } - - return nil -} - -// ResetPasswordRequestMultiError is an error wrapping multiple validation -// errors returned by ResetPasswordRequest.ValidateAll() if the designated -// constraints aren't met. -type ResetPasswordRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ResetPasswordRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ResetPasswordRequestMultiError) AllErrors() []error { return m } - -// ResetPasswordRequestValidationError is the validation error returned by -// ResetPasswordRequest.Validate if the designated constraints aren't met. -type ResetPasswordRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ResetPasswordRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ResetPasswordRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ResetPasswordRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ResetPasswordRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ResetPasswordRequestValidationError) ErrorName() string { - return "ResetPasswordRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ResetPasswordRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sResetPasswordRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ResetPasswordRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ResetPasswordRequestValidationError{} - -// Validate checks the field values on ChangePasswordRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *ChangePasswordRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on ChangePasswordRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// ChangePasswordRequestMultiError, or nil if none found. -func (m *ChangePasswordRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *ChangePasswordRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Password - - if len(errors) > 0 { - return ChangePasswordRequestMultiError(errors) - } - - return nil -} - -// ChangePasswordRequestMultiError is an error wrapping multiple validation -// errors returned by ChangePasswordRequest.ValidateAll() if the designated -// constraints aren't met. -type ChangePasswordRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m ChangePasswordRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m ChangePasswordRequestMultiError) AllErrors() []error { return m } - -// ChangePasswordRequestValidationError is the validation error returned by -// ChangePasswordRequest.Validate if the designated constraints aren't met. -type ChangePasswordRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e ChangePasswordRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e ChangePasswordRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e ChangePasswordRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e ChangePasswordRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e ChangePasswordRequestValidationError) ErrorName() string { - return "ChangePasswordRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e ChangePasswordRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sChangePasswordRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = ChangePasswordRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = ChangePasswordRequestValidationError{} - -// Validate checks the field values on Reset2FARequest with the rules defined -// in the proto definition for this message. If any rules are violated, the -// first error encountered is returned, or nil if there are no violations. -func (m *Reset2FARequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on Reset2FARequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// Reset2FARequestMultiError, or nil if none found. -func (m *Reset2FARequest) ValidateAll() error { - return m.validate(true) -} - -func (m *Reset2FARequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Id - - if len(errors) > 0 { - return Reset2FARequestMultiError(errors) - } - - return nil -} - -// Reset2FARequestMultiError is an error wrapping multiple validation errors -// returned by Reset2FARequest.ValidateAll() if the designated constraints -// aren't met. -type Reset2FARequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m Reset2FARequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m Reset2FARequestMultiError) AllErrors() []error { return m } - -// Reset2FARequestValidationError is the validation error returned by -// Reset2FARequest.Validate if the designated constraints aren't met. -type Reset2FARequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e Reset2FARequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e Reset2FARequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e Reset2FARequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e Reset2FARequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e Reset2FARequestValidationError) ErrorName() string { return "Reset2FARequestValidationError" } - -// Error satisfies the builtin error interface -func (e Reset2FARequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sReset2FARequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = Reset2FARequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = Reset2FARequestValidationError{} - -// Validate checks the field values on EnableUserRequest with the rules defined -// in the proto definition for this message. If any rules are violated, the -// first error encountered is returned, or nil if there are no violations. -func (m *EnableUserRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on EnableUserRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// EnableUserRequestMultiError, or nil if none found. -func (m *EnableUserRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *EnableUserRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Id - - // no validation rules for Status - - if len(errors) > 0 { - return EnableUserRequestMultiError(errors) - } - - return nil -} - -// EnableUserRequestMultiError is an error wrapping multiple validation errors -// returned by EnableUserRequest.ValidateAll() if the designated constraints -// aren't met. -type EnableUserRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m EnableUserRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m EnableUserRequestMultiError) AllErrors() []error { return m } - -// EnableUserRequestValidationError is the validation error returned by -// EnableUserRequest.Validate if the designated constraints aren't met. -type EnableUserRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e EnableUserRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e EnableUserRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e EnableUserRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e EnableUserRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e EnableUserRequestValidationError) ErrorName() string { - return "EnableUserRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e EnableUserRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sEnableUserRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = EnableUserRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = EnableUserRequestValidationError{} - -// Validate checks the field values on UpdateCurrentUserRequest with the rules -// defined in the proto definition for this message. If any rules are -// violated, the first error encountered is returned, or nil if there are no violations. -func (m *UpdateCurrentUserRequest) Validate() error { - return m.validate(false) -} - -// ValidateAll checks the field values on UpdateCurrentUserRequest with the -// rules defined in the proto definition for this message. If any rules are -// violated, the result is a list of violation errors wrapped in -// UpdateCurrentUserRequestMultiError, or nil if none found. -func (m *UpdateCurrentUserRequest) ValidateAll() error { - return m.validate(true) -} - -func (m *UpdateCurrentUserRequest) validate(all bool) error { - if m == nil { - return nil - } - - var errors []error - - // no validation rules for Nickname - - // no validation rules for PhoneCode - - // no validation rules for Phone - - // no validation rules for Avatar - - // no validation rules for Timezone - - if len(errors) > 0 { - return UpdateCurrentUserRequestMultiError(errors) - } - - return nil -} - -// UpdateCurrentUserRequestMultiError is an error wrapping multiple validation -// errors returned by UpdateCurrentUserRequest.ValidateAll() if the designated -// constraints aren't met. -type UpdateCurrentUserRequestMultiError []error - -// Error returns a concatenation of all the error messages it wraps. -func (m UpdateCurrentUserRequestMultiError) Error() string { - var msgs []string - for _, err := range m { - msgs = append(msgs, err.Error()) - } - return strings.Join(msgs, "; ") -} - -// AllErrors returns a list of validation violation errors. -func (m UpdateCurrentUserRequestMultiError) AllErrors() []error { return m } - -// UpdateCurrentUserRequestValidationError is the validation error returned by -// UpdateCurrentUserRequest.Validate if the designated constraints aren't met. -type UpdateCurrentUserRequestValidationError struct { - field string - reason string - cause error - key bool -} - -// Field function returns field value. -func (e UpdateCurrentUserRequestValidationError) Field() string { return e.field } - -// Reason function returns reason value. -func (e UpdateCurrentUserRequestValidationError) Reason() string { return e.reason } - -// Cause function returns cause value. -func (e UpdateCurrentUserRequestValidationError) Cause() error { return e.cause } - -// Key function returns key value. -func (e UpdateCurrentUserRequestValidationError) Key() bool { return e.key } - -// ErrorName returns error name. -func (e UpdateCurrentUserRequestValidationError) ErrorName() string { - return "UpdateCurrentUserRequestValidationError" -} - -// Error satisfies the builtin error interface -func (e UpdateCurrentUserRequestValidationError) Error() string { - cause := "" - if e.cause != nil { - cause = fmt.Sprintf(" | caused by: %v", e.cause) - } - - key := "" - if e.key { - key = "key for " - } - - return fmt.Sprintf( - "invalid %sUpdateCurrentUserRequest.%s: %s%s", - key, - e.field, - e.reason, - cause) -} - -var _ error = UpdateCurrentUserRequestValidationError{} - -var _ interface { - Field() string - Reason() string - Key() bool - Cause() error - ErrorName() string -} = UpdateCurrentUserRequestValidationError{} diff --git a/protoc-gen-go-crud/api/v1/users/users.proto b/protoc-gen-go-crud/api/v1/users/users.proto deleted file mode 100644 index ddff99b..0000000 --- a/protoc-gen-go-crud/api/v1/users/users.proto +++ /dev/null @@ -1,200 +0,0 @@ -syntax = "proto3"; - -package usersV1; - -import "google/api/annotations.proto"; -import "validate/validate.proto"; - -import "google/protobuf/empty.proto"; - -import "v1/components/schemas.proto"; -import "v1/components/enum.proto"; - -option go_package = "bitbucket.org/antalphadev/earn/api/v1/users;usersV1"; - - -// 用户管理 -service User { - // 用户列表 - rpc ListUsers(ListUsersRequest) returns (ListUsersReply) { - option (google.api.http) = {get: "/v1/users"}; - } - // 新增用户 - rpc CreateUser(CreateUserRequest) returns (google.protobuf.Empty) { - option (google.api.http) = {post: "/v1/users" body: "*"}; - } - // 更新用户 - rpc UpdateUser(UpdateUserRequest) returns (google.protobuf.Empty) { - option (google.api.http) = {put: "/v1/users/{id}" body: "*"}; - } - // 查看用户详情 - rpc GetUser(GetUserRequest) returns (componentsV1.User) { - option (google.api.http) = {get: "/v1/users/{id}"}; - } - // 删除用户 - rpc DeleteUser(DeleteUserRequest) returns (google.protobuf.Empty) { - option (google.api.http) = {delete: "/v1/users/{id}"}; - } - // 上传头像 - rpc UploadProfile(UploadProfileRequest) returns (UploadProfileResponse) { - option (google.api.http) = {post: "/v1/user/upload-profile" body: "*"}; - } - // 重新激活 - rpc ResetActivate(ResetActivateRequest) returns (google.protobuf.Empty) { - option (google.api.http) = {post: "/v1/users/{id}/activate" body: "*"}; - } - // 重置密码 - rpc ResetPassword(ResetPasswordRequest) returns (google.protobuf.Empty) { - option (google.api.http) = {post: "/v1/users/{id}/password/reset" body: "*"}; - } - // 重置2fa - rpc Reset2FA(Reset2FARequest) returns (google.protobuf.Empty) { - option (google.api.http) = {post: "/v1/users/{id}/2fa/reset" body: "*"}; - } - // 用户启用/禁用 - rpc EnableUser(EnableUserRequest) returns (google.protobuf.Empty) { - option (google.api.http) = {post: "/v1/users/{id}/enable" body: "*"}; - } - - // 当前用户 - rpc User(google.protobuf.Empty) returns (componentsV1.User) { - option (google.api.http) = {get: "/v1/user"}; - } - // 当前用户修改密码 - rpc ChangePassword(ChangePasswordRequest) returns (google.protobuf.Empty) { - option (google.api.http) = {put: "/v1/user/password/change" body: "*"}; - } - // 当前用户更新 - rpc UpdateCurrentUser(UpdateCurrentUserRequest) returns (google.protobuf.Empty) { - option (google.api.http) = {put: "/v1/user" body: "*"}; - } -} - -message ListUsersRequest { - // 姓名 - string nickname = 1 [(validate.rules).string = { - ignore_empty:true, - // pattern: "[a-zA-Z0-9\u4e00-\u9fa5]+", - }]; - // 邮箱 - string email = 2 [(validate.rules).string = { - ignore_empty:true, - // pattern: "[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\\.[a-zA-Z0-9_-]+)+", - }]; - - // 手机号 - string phone = 3 [(validate.rules).string = { - ignore_empty:true, - // pattern: "[0-9]+", - max_len:11, - }]; - // 状态 - componentsV1.EnableStatus status = 4; - // 角色ID - string role_id = 5; - // 页码 - int64 page = 6; - // 每页数量 - int64 page_size = 7; -} - -message ListUsersReply { - // 用户列表 - repeated componentsV1.User list = 1; - // 分页信息 - componentsV1.PageInfo page_info = 2; -} - -message CreateUserRequest { - // 姓名 - string nickname = 1 [(validate.rules).string.min_len = 1, (validate.rules).string.max_len = 30]; - // 邮箱 - string email = 2 [(validate.rules).string.min_len = 1, (validate.rules).string.max_len = 128]; - // 手机区号 - string phone_code = 3 [(validate.rules).string.min_len = 1, (validate.rules).string.max_len = 10]; - // 手机号 - string phone = 4 [(validate.rules).string.min_len = 1, (validate.rules).string.max_len = 20]; - // 启用状态 - componentsV1.EnableStatus enabled = 5; - // 角色IDs - repeated string role_ids = 6; -} - -message UpdateUserRequest { - // 用户ID - string id = 1; - // [] 姓名 - string nickname = 2 [(validate.rules).string.max_len = 30]; - // [] 手机区号 - string phone_code = 3 [(validate.rules).string.max_len = 10]; - // [] 手机号 - string phone = 4 [(validate.rules).string.max_len = 20]; - // [] 头像 - string avatar = 5; - // [] 角色IDs - repeated string role_ids = 6; - // [] 时区 - string timezone = 7; -} - -message GetUserRequest { - // 用户ID - string id = 1; -} - -message DeleteUserRequest { - // 用户ID - string id = 1; -} - -message UploadProfileRequest{ - // 图片信息 - string avatar = 1; -} - -message UploadProfileResponse{ - // 头像路径 - string avatar_url = 1; -} - -message ResetActivateRequest { - // 用户ID - string id = 1; -} - -message ResetPasswordRequest { - // 用户ID - string id = 1; -} - -message ChangePasswordRequest { - // 密码 - string password = 1; -} - - -message Reset2FARequest { - // 用户ID - string id = 1; -} - -message EnableUserRequest { - // 用户ID - string id = 1; - // 状态 - componentsV1.EnableStatus status = 2; -} - - -message UpdateCurrentUserRequest { - // [] 姓名 - string nickname = 2; - // [] 手机区号 - string phone_code = 3; - // [] 手机号 - string phone = 4; - // [] 头像 - string avatar = 5; - // [] 时区 - string timezone = 6; -} diff --git a/protoc-gen-go-crud/api/v1/users/users.swagger.json b/protoc-gen-go-crud/api/v1/users/users.swagger.json deleted file mode 100644 index bcd598b..0000000 --- a/protoc-gen-go-crud/api/v1/users/users.swagger.json +++ /dev/null @@ -1,804 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "title": "v1/users/users.proto", - "version": "version not set" - }, - "tags": [ - { - "name": "Users" - } - ], - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "paths": { - "/v1/user": { - "get": { - "summary": "当前用户", - "operationId": "Users_User", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/componentsV1User" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "tags": [ - "Users" - ] - }, - "put": { - "summary": "当前用户更新", - "operationId": "Users_UpdateCurrentUser", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": {} - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/usersV1UpdateCurrentUserRequest" - } - } - ], - "tags": [ - "Users" - ] - } - }, - "/v1/user/password/change": { - "put": { - "summary": "当前用户修改密码", - "operationId": "Users_ChangePassword", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": {} - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/usersV1ChangePasswordRequest" - } - } - ], - "tags": [ - "Users" - ] - } - }, - "/v1/user/upload-profile": { - "post": { - "summary": "上传头像", - "operationId": "Users_UploadProfile", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/usersV1UploadProfileResponse" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/usersV1UploadProfileRequest" - } - } - ], - "tags": [ - "Users" - ] - } - }, - "/v1/users": { - "get": { - "summary": "用户列表", - "operationId": "Users_ListUsers", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/usersV1ListUsersReply" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "nickname", - "description": "姓名", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "email", - "description": "邮箱", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "phone", - "description": "手机号", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "status", - "description": "状态\n\n - ENABLE_STATUS_DEFAULT: 默认值\n - ENABLE: 启用\n - DISABLE: 禁用", - "in": "query", - "required": false, - "type": "string", - "enum": [ - "ENABLE_STATUS_DEFAULT", - "ENABLE", - "DISABLE" - ], - "default": "ENABLE_STATUS_DEFAULT" - }, - { - "name": "role_id", - "description": "角色ID", - "in": "query", - "required": false, - "type": "string" - }, - { - "name": "page", - "description": "页码", - "in": "query", - "required": false, - "type": "string", - "format": "int64" - }, - { - "name": "page_size", - "description": "每页数量", - "in": "query", - "required": false, - "type": "string", - "format": "int64" - } - ], - "tags": [ - "Users" - ] - }, - "post": { - "summary": "新增用户", - "operationId": "Users_CreateUser", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": {} - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/usersV1CreateUserRequest" - } - } - ], - "tags": [ - "Users" - ] - } - }, - "/v1/users/{id}": { - "get": { - "summary": "查看用户详情", - "operationId": "Users_GetUser", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "$ref": "#/definitions/componentsV1User" - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "id", - "description": "用户ID", - "in": "path", - "required": true, - "type": "string" - } - ], - "tags": [ - "Users" - ] - }, - "delete": { - "summary": "删除用户", - "operationId": "Users_DeleteUser", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": {} - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "id", - "description": "用户ID", - "in": "path", - "required": true, - "type": "string" - } - ], - "tags": [ - "Users" - ] - }, - "put": { - "summary": "更新用户", - "operationId": "Users_UpdateUser", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": {} - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "id", - "description": "用户ID", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "nickname": { - "type": "string", - "title": "[] 姓名" - }, - "phone_code": { - "type": "string", - "title": "[] 手机区号" - }, - "phone": { - "type": "string", - "title": "[] 手机号" - }, - "avatar": { - "type": "string", - "title": "[] 头像" - }, - "role_ids": { - "type": "array", - "items": { - "type": "string" - }, - "title": "[] 角色IDs" - }, - "timezone": { - "type": "string", - "title": "[] 时区" - } - } - } - } - ], - "tags": [ - "Users" - ] - } - }, - "/v1/users/{id}/2fa/reset": { - "post": { - "summary": "重置2fa", - "operationId": "Users_Reset2FA", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": {} - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "id", - "description": "用户ID", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "tags": [ - "Users" - ] - } - }, - "/v1/users/{id}/activate": { - "post": { - "summary": "重新激活", - "operationId": "Users_ResetActivate", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": {} - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "id", - "description": "用户ID", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "tags": [ - "Users" - ] - } - }, - "/v1/users/{id}/enable": { - "post": { - "summary": "用户启用/禁用", - "operationId": "Users_EnableUser", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": {} - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "id", - "description": "用户ID", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object", - "properties": { - "status": { - "$ref": "#/definitions/componentsV1EnableStatus", - "title": "状态" - } - } - } - } - ], - "tags": [ - "Users" - ] - } - }, - "/v1/users/{id}/password/reset": { - "post": { - "summary": "重置密码", - "operationId": "Users_ResetPassword", - "responses": { - "200": { - "description": "A successful response.", - "schema": { - "type": "object", - "properties": {} - } - }, - "default": { - "description": "An unexpected error response.", - "schema": { - "$ref": "#/definitions/rpcStatus" - } - } - }, - "parameters": [ - { - "name": "id", - "description": "用户ID", - "in": "path", - "required": true, - "type": "string" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "type": "object" - } - } - ], - "tags": [ - "Users" - ] - } - } - }, - "definitions": { - "componentsV1Dictionary": { - "type": "object", - "properties": { - "key": { - "type": "string" - }, - "value": { - "type": "string" - }, - "label": { - "type": "string" - } - } - }, - "componentsV1EnableStatus": { - "type": "string", - "enum": [ - "ENABLE_STATUS_DEFAULT", - "ENABLE", - "DISABLE" - ], - "default": "ENABLE_STATUS_DEFAULT", - "title": "- ENABLE_STATUS_DEFAULT: 默认值\n - ENABLE: 启用\n - DISABLE: 禁用" - }, - "componentsV1PageInfo": { - "type": "object", - "properties": { - "page": { - "type": "string", - "format": "int64", - "title": "当前页码" - }, - "page_size": { - "type": "string", - "format": "int64", - "title": "每页数量" - }, - "total": { - "type": "string", - "format": "int64", - "title": "总数量" - } - } - }, - "componentsV1User": { - "type": "object", - "properties": { - "id": { - "type": "string", - "title": "用户ID" - }, - "email": { - "type": "string", - "title": "邮箱" - }, - "email_verified_at": { - "type": "string", - "title": "邮箱验证时间" - }, - "nickname": { - "type": "string", - "title": "姓名" - }, - "phone_code": { - "type": "string", - "title": "手机区号" - }, - "phone": { - "type": "string", - "title": "手机号" - }, - "avatar": { - "type": "string", - "title": "头像" - }, - "roles": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/componentsV1Dictionary" - }, - "title": "角色" - }, - "status": { - "$ref": "#/definitions/componentsV1EnableStatus", - "title": "状态" - }, - "permissions": { - "type": "array", - "items": { - "type": "string" - }, - "title": "权限" - }, - "timezone": { - "type": "string", - "title": "时区" - }, - "created_at": { - "type": "string", - "title": "创建时间" - }, - "created_by": { - "type": "string", - "title": "创建人" - }, - "updated_at": { - "type": "string", - "title": "更新时间" - }, - "updated_by": { - "type": "string", - "title": "更新人" - } - } - }, - "protobufAny": { - "type": "object", - "properties": { - "@type": { - "type": "string" - } - }, - "additionalProperties": {} - }, - "rpcStatus": { - "type": "object", - "properties": { - "code": { - "type": "integer", - "format": "int32" - }, - "message": { - "type": "string" - }, - "details": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/protobufAny" - } - } - } - }, - "usersV1ChangePasswordRequest": { - "type": "object", - "properties": { - "password": { - "type": "string", - "title": "密码" - } - } - }, - "usersV1CreateUserRequest": { - "type": "object", - "properties": { - "nickname": { - "type": "string", - "title": "姓名" - }, - "email": { - "type": "string", - "title": "邮箱" - }, - "phone_code": { - "type": "string", - "title": "手机区号" - }, - "phone": { - "type": "string", - "title": "手机号" - }, - "enabled": { - "$ref": "#/definitions/componentsV1EnableStatus", - "title": "启用状态" - }, - "role_ids": { - "type": "array", - "items": { - "type": "string" - }, - "title": "角色IDs" - } - } - }, - "usersV1ListUsersReply": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/componentsV1User" - }, - "title": "用户列表" - }, - "page_info": { - "$ref": "#/definitions/componentsV1PageInfo", - "title": "分页信息" - } - } - }, - "usersV1UpdateCurrentUserRequest": { - "type": "object", - "properties": { - "nickname": { - "type": "string", - "title": "[] 姓名" - }, - "phone_code": { - "type": "string", - "title": "[] 手机区号" - }, - "phone": { - "type": "string", - "title": "[] 手机号" - }, - "avatar": { - "type": "string", - "title": "[] 头像" - }, - "timezone": { - "type": "string", - "title": "[] 时区" - } - } - }, - "usersV1UploadProfileRequest": { - "type": "object", - "properties": { - "avatar": { - "type": "string", - "title": "图片信息" - } - } - }, - "usersV1UploadProfileResponse": { - "type": "object", - "properties": { - "avatar_url": { - "type": "string", - "title": "头像路径" - } - } - } - } -} diff --git a/protoc-gen-go-crud/api/v1/users/users_http.pb.go b/protoc-gen-go-crud/api/v1/users/users_http.pb.go deleted file mode 100644 index 2a9bb66..0000000 --- a/protoc-gen-go-crud/api/v1/users/users_http.pb.go +++ /dev/null @@ -1,597 +0,0 @@ -// Code generated by protoc-gen-go-http. DO NOT EDIT. -// versions: -// - protoc-gen-go-http v0.0.1 -// - protoc v3.21.12 -// source: v1/users/users.proto - -package usersV1 - -import ( - components "bitbucket.org/antalphadev/earn/api/v1/components" - bytes "bytes" - json "encoding/json" - gin "github.com/gin-gonic/gin" - jsonpb "github.com/golang/protobuf/jsonpb" - proto "github.com/golang/protobuf/proto" - empty "github.com/golang/protobuf/ptypes/empty" - http "net/http" -) - -// This is a compile-time assertion to ensure that this generated file -var _ = new(gin.Engine) -var _ = new(http.Request) -var _ = new(json.Encoder) -var _ = new(jsonpb.Marshaler) -var _ = new(proto.Message) -var _ = new(bytes.Buffer) - -const RouteUsersChangePassword = "/v1/user/password/change" -const RouteUsersCreateUser = "/v1/users" -const RouteUsersDeleteUser = "/v1/users/:id" -const RouteUsersEnableUser = "/v1/users/:id/enable" -const RouteUsersGetUser = "/v1/users/:id" -const RouteUsersListUsers = "/v1/users" -const RouteUsersReset2FA = "/v1/users/:id/2fa/reset" -const RouteUsersResetActivate = "/v1/users/:id/activate" -const RouteUsersResetPassword = "/v1/users/:id/password/reset" -const RouteUsersUpdateCurrentUser = "/v1/user" -const RouteUsersUpdateUser = "/v1/users/:id" -const RouteUsersUploadProfile = "/v1/user/upload-profile" -const RouteUsersUser = "/v1/user" - -type UsersHTTPServer interface { - // ChangePassword 当前用户修改密码 - ChangePassword(*gin.Context, *ChangePasswordRequest) (*empty.Empty, error) - // CreateUser 新增用户 - CreateUser(*gin.Context, *CreateUserRequest) (*empty.Empty, error) - // DeleteUser 删除用户 - DeleteUser(*gin.Context, *DeleteUserRequest) (*empty.Empty, error) - // EnableUser 用户启用/禁用 - EnableUser(*gin.Context, *EnableUserRequest) (*empty.Empty, error) - // GetUser 查看用户详情 - GetUser(*gin.Context, *GetUserRequest) (*components.User, error) - // ListUsers 用户列表 - ListUsers(*gin.Context, *ListUsersRequest) (*ListUsersReply, error) - // Reset2FA 重置2fa - Reset2FA(*gin.Context, *Reset2FARequest) (*empty.Empty, error) - // ResetActivate 重新激活 - ResetActivate(*gin.Context, *ResetActivateRequest) (*empty.Empty, error) - // ResetPassword 重置密码 - ResetPassword(*gin.Context, *ResetPasswordRequest) (*empty.Empty, error) - // UpdateCurrentUser 当前用户更新 - UpdateCurrentUser(*gin.Context, *UpdateCurrentUserRequest) (*empty.Empty, error) - // UpdateUser 更新用户 - UpdateUser(*gin.Context, *UpdateUserRequest) (*empty.Empty, error) - // UploadProfile 上传头像 - UploadProfile(*gin.Context, *UploadProfileRequest) (*UploadProfileResponse, error) - // User 当前用户 - User(*gin.Context, *empty.Empty) (*components.User, error) -} - -func RegisterUsersHTTPServer(r gin.IRouter, srv UsersHTTPServer) { - r.GET(RouteUsersListUsers, _Users_ListUsers0_HTTP_Handler(srv)) - r.POST(RouteUsersCreateUser, _Users_CreateUser0_HTTP_Handler(srv)) - r.PUT(RouteUsersUpdateUser, _Users_UpdateUser0_HTTP_Handler(srv)) - r.GET(RouteUsersGetUser, _Users_GetUser0_HTTP_Handler(srv)) - r.DELETE(RouteUsersDeleteUser, _Users_DeleteUser0_HTTP_Handler(srv)) - r.POST(RouteUsersUploadProfile, _Users_UploadProfile0_HTTP_Handler(srv)) - r.POST(RouteUsersResetActivate, _Users_ResetActivate0_HTTP_Handler(srv)) - r.POST(RouteUsersResetPassword, _Users_ResetPassword0_HTTP_Handler(srv)) - r.POST(RouteUsersReset2FA, _Users_Reset2FA0_HTTP_Handler(srv)) - r.POST(RouteUsersEnableUser, _Users_EnableUser0_HTTP_Handler(srv)) - r.GET(RouteUsersUser, _Users_User0_HTTP_Handler(srv)) - r.PUT(RouteUsersChangePassword, _Users_ChangePassword0_HTTP_Handler(srv)) - r.PUT(RouteUsersUpdateCurrentUser, _Users_UpdateCurrentUser0_HTTP_Handler(srv)) -} - -func _Users_ListUsers0_HTTP_Handler(srv UsersHTTPServer) gin.HandlerFunc { - return func(c *gin.Context) { - var in ListUsersRequest - if err := c.BindQuery(&in); err != nil { - c.Error(err) - c.Abort() - return - } - - out, err := srv.ListUsers(c, &in) - if err != nil { - c.Error(err) - c.Abort() - return - } - if c.IsAborted() { - return - } - - var buffer bytes.Buffer - var data interface{} - var newData interface{} - - data = out - if message, ok := data.(proto.Message); ok { - t := jsonpb.Marshaler{EmitDefaults: true, OrigName: true, EnumsAsInts: true} - t.Marshal(&buffer, message) - json.Unmarshal(buffer.Bytes(), &newData) - } else { - newData = data - } - - c.JSON(http.StatusOK, newData) - } -} - -func _Users_CreateUser0_HTTP_Handler(srv UsersHTTPServer) gin.HandlerFunc { - return func(c *gin.Context) { - var in CreateUserRequest - - if err := c.Bind(&in); err != nil { - c.Error(err) - c.Abort() - return - } - - out, err := srv.CreateUser(c, &in) - if err != nil { - c.Error(err) - c.Abort() - return - } - if c.IsAborted() { - return - } - - var buffer bytes.Buffer - var data interface{} - var newData interface{} - - data = out - if message, ok := data.(proto.Message); ok { - t := jsonpb.Marshaler{EmitDefaults: true, OrigName: true, EnumsAsInts: true} - t.Marshal(&buffer, message) - json.Unmarshal(buffer.Bytes(), &newData) - } else { - newData = data - } - - c.JSON(http.StatusOK, newData) - } -} - -func _Users_UpdateUser0_HTTP_Handler(srv UsersHTTPServer) gin.HandlerFunc { - return func(c *gin.Context) { - var in UpdateUserRequest - - if err := c.Bind(&in); err != nil { - c.Error(err) - c.Abort() - return - } - if err := c.BindUri(&in); err != nil { - c.Error(err) - c.Abort() - return - } - - out, err := srv.UpdateUser(c, &in) - if err != nil { - c.Error(err) - c.Abort() - return - } - if c.IsAborted() { - return - } - - var buffer bytes.Buffer - var data interface{} - var newData interface{} - - data = out - if message, ok := data.(proto.Message); ok { - t := jsonpb.Marshaler{EmitDefaults: true, OrigName: true, EnumsAsInts: true} - t.Marshal(&buffer, message) - json.Unmarshal(buffer.Bytes(), &newData) - } else { - newData = data - } - - c.JSON(http.StatusOK, newData) - } -} - -func _Users_GetUser0_HTTP_Handler(srv UsersHTTPServer) gin.HandlerFunc { - return func(c *gin.Context) { - var in GetUserRequest - if err := c.BindQuery(&in); err != nil { - c.Error(err) - c.Abort() - return - } - if err := c.BindUri(&in); err != nil { - c.Error(err) - c.Abort() - return - } - - out, err := srv.GetUser(c, &in) - if err != nil { - c.Error(err) - c.Abort() - return - } - if c.IsAborted() { - return - } - - var buffer bytes.Buffer - var data interface{} - var newData interface{} - - data = out - if message, ok := data.(proto.Message); ok { - t := jsonpb.Marshaler{EmitDefaults: true, OrigName: true, EnumsAsInts: true} - t.Marshal(&buffer, message) - json.Unmarshal(buffer.Bytes(), &newData) - } else { - newData = data - } - - c.JSON(http.StatusOK, newData) - } -} - -func _Users_DeleteUser0_HTTP_Handler(srv UsersHTTPServer) gin.HandlerFunc { - return func(c *gin.Context) { - var in DeleteUserRequest - if err := c.BindQuery(&in); err != nil { - c.Error(err) - c.Abort() - return - } - if err := c.BindUri(&in); err != nil { - c.Error(err) - c.Abort() - return - } - - out, err := srv.DeleteUser(c, &in) - if err != nil { - c.Error(err) - c.Abort() - return - } - if c.IsAborted() { - return - } - - var buffer bytes.Buffer - var data interface{} - var newData interface{} - - data = out - if message, ok := data.(proto.Message); ok { - t := jsonpb.Marshaler{EmitDefaults: true, OrigName: true, EnumsAsInts: true} - t.Marshal(&buffer, message) - json.Unmarshal(buffer.Bytes(), &newData) - } else { - newData = data - } - - c.JSON(http.StatusOK, newData) - } -} - -func _Users_UploadProfile0_HTTP_Handler(srv UsersHTTPServer) gin.HandlerFunc { - return func(c *gin.Context) { - var in UploadProfileRequest - - if err := c.Bind(&in); err != nil { - c.Error(err) - c.Abort() - return - } - - out, err := srv.UploadProfile(c, &in) - if err != nil { - c.Error(err) - c.Abort() - return - } - if c.IsAborted() { - return - } - - var buffer bytes.Buffer - var data interface{} - var newData interface{} - - data = out - if message, ok := data.(proto.Message); ok { - t := jsonpb.Marshaler{EmitDefaults: true, OrigName: true, EnumsAsInts: true} - t.Marshal(&buffer, message) - json.Unmarshal(buffer.Bytes(), &newData) - } else { - newData = data - } - - c.JSON(http.StatusOK, newData) - } -} - -func _Users_ResetActivate0_HTTP_Handler(srv UsersHTTPServer) gin.HandlerFunc { - return func(c *gin.Context) { - var in ResetActivateRequest - - if err := c.Bind(&in); err != nil { - c.Error(err) - c.Abort() - return - } - if err := c.BindUri(&in); err != nil { - c.Error(err) - c.Abort() - return - } - - out, err := srv.ResetActivate(c, &in) - if err != nil { - c.Error(err) - c.Abort() - return - } - if c.IsAborted() { - return - } - - var buffer bytes.Buffer - var data interface{} - var newData interface{} - - data = out - if message, ok := data.(proto.Message); ok { - t := jsonpb.Marshaler{EmitDefaults: true, OrigName: true, EnumsAsInts: true} - t.Marshal(&buffer, message) - json.Unmarshal(buffer.Bytes(), &newData) - } else { - newData = data - } - - c.JSON(http.StatusOK, newData) - } -} - -func _Users_ResetPassword0_HTTP_Handler(srv UsersHTTPServer) gin.HandlerFunc { - return func(c *gin.Context) { - var in ResetPasswordRequest - - if err := c.Bind(&in); err != nil { - c.Error(err) - c.Abort() - return - } - if err := c.BindUri(&in); err != nil { - c.Error(err) - c.Abort() - return - } - - out, err := srv.ResetPassword(c, &in) - if err != nil { - c.Error(err) - c.Abort() - return - } - if c.IsAborted() { - return - } - - var buffer bytes.Buffer - var data interface{} - var newData interface{} - - data = out - if message, ok := data.(proto.Message); ok { - t := jsonpb.Marshaler{EmitDefaults: true, OrigName: true, EnumsAsInts: true} - t.Marshal(&buffer, message) - json.Unmarshal(buffer.Bytes(), &newData) - } else { - newData = data - } - - c.JSON(http.StatusOK, newData) - } -} - -func _Users_Reset2FA0_HTTP_Handler(srv UsersHTTPServer) gin.HandlerFunc { - return func(c *gin.Context) { - var in Reset2FARequest - - if err := c.Bind(&in); err != nil { - c.Error(err) - c.Abort() - return - } - if err := c.BindUri(&in); err != nil { - c.Error(err) - c.Abort() - return - } - - out, err := srv.Reset2FA(c, &in) - if err != nil { - c.Error(err) - c.Abort() - return - } - if c.IsAborted() { - return - } - - var buffer bytes.Buffer - var data interface{} - var newData interface{} - - data = out - if message, ok := data.(proto.Message); ok { - t := jsonpb.Marshaler{EmitDefaults: true, OrigName: true, EnumsAsInts: true} - t.Marshal(&buffer, message) - json.Unmarshal(buffer.Bytes(), &newData) - } else { - newData = data - } - - c.JSON(http.StatusOK, newData) - } -} - -func _Users_EnableUser0_HTTP_Handler(srv UsersHTTPServer) gin.HandlerFunc { - return func(c *gin.Context) { - var in EnableUserRequest - - if err := c.Bind(&in); err != nil { - c.Error(err) - c.Abort() - return - } - if err := c.BindUri(&in); err != nil { - c.Error(err) - c.Abort() - return - } - - out, err := srv.EnableUser(c, &in) - if err != nil { - c.Error(err) - c.Abort() - return - } - if c.IsAborted() { - return - } - - var buffer bytes.Buffer - var data interface{} - var newData interface{} - - data = out - if message, ok := data.(proto.Message); ok { - t := jsonpb.Marshaler{EmitDefaults: true, OrigName: true, EnumsAsInts: true} - t.Marshal(&buffer, message) - json.Unmarshal(buffer.Bytes(), &newData) - } else { - newData = data - } - - c.JSON(http.StatusOK, newData) - } -} - -func _Users_User0_HTTP_Handler(srv UsersHTTPServer) gin.HandlerFunc { - return func(c *gin.Context) { - var in empty.Empty - if err := c.BindQuery(&in); err != nil { - c.Error(err) - c.Abort() - return - } - - out, err := srv.User(c, &in) - if err != nil { - c.Error(err) - c.Abort() - return - } - if c.IsAborted() { - return - } - - var buffer bytes.Buffer - var data interface{} - var newData interface{} - - data = out - if message, ok := data.(proto.Message); ok { - t := jsonpb.Marshaler{EmitDefaults: true, OrigName: true, EnumsAsInts: true} - t.Marshal(&buffer, message) - json.Unmarshal(buffer.Bytes(), &newData) - } else { - newData = data - } - - c.JSON(http.StatusOK, newData) - } -} - -func _Users_ChangePassword0_HTTP_Handler(srv UsersHTTPServer) gin.HandlerFunc { - return func(c *gin.Context) { - var in ChangePasswordRequest - - if err := c.Bind(&in); err != nil { - c.Error(err) - c.Abort() - return - } - - out, err := srv.ChangePassword(c, &in) - if err != nil { - c.Error(err) - c.Abort() - return - } - if c.IsAborted() { - return - } - - var buffer bytes.Buffer - var data interface{} - var newData interface{} - - data = out - if message, ok := data.(proto.Message); ok { - t := jsonpb.Marshaler{EmitDefaults: true, OrigName: true, EnumsAsInts: true} - t.Marshal(&buffer, message) - json.Unmarshal(buffer.Bytes(), &newData) - } else { - newData = data - } - - c.JSON(http.StatusOK, newData) - } -} - -func _Users_UpdateCurrentUser0_HTTP_Handler(srv UsersHTTPServer) gin.HandlerFunc { - return func(c *gin.Context) { - var in UpdateCurrentUserRequest - - if err := c.Bind(&in); err != nil { - c.Error(err) - c.Abort() - return - } - - out, err := srv.UpdateCurrentUser(c, &in) - if err != nil { - c.Error(err) - c.Abort() - return - } - if c.IsAborted() { - return - } - - var buffer bytes.Buffer - var data interface{} - var newData interface{} - - data = out - if message, ok := data.(proto.Message); ok { - t := jsonpb.Marshaler{EmitDefaults: true, OrigName: true, EnumsAsInts: true} - t.Marshal(&buffer, message) - json.Unmarshal(buffer.Bytes(), &newData) - } else { - newData = data - } - - c.JSON(http.StatusOK, newData) - } -} diff --git a/protoc-gen-go-crud/internal/authorization/deliveries/authorization.go b/protoc-gen-go-crud/internal/authorization/deliveries/authorization.go deleted file mode 100644 index ee44277..0000000 --- a/protoc-gen-go-crud/internal/authorization/deliveries/authorization.go +++ /dev/null @@ -1,23 +0,0 @@ -package deliveries - -import ( - empty "github.com/golang/protobuf/ptypes/empty" -) - -type AuthService struct { - ac usecase.IAuthUseCase -} - -func (a AuthService) ListMenus(c *gin.Context, in *empty.Empty) (*authorizationV1.Menus, error) { - panic("todo") -} - -func (a AuthService) Log(c *gin.Context) *zap.SugaredLogger { - return global.Logger(c).Named("AuthRepo") -} - -func NewAuthService(ac usecase.IAuthUseCase) authorizationV1.AuthHTTPServer { - return &AuthService{ - ac: ac, - } -} diff --git a/protoc-gen-go-crud/internal/authorization/deliveries/role.go b/protoc-gen-go-crud/internal/authorization/deliveries/role.go deleted file mode 100644 index cec1cb7..0000000 --- a/protoc-gen-go-crud/internal/authorization/deliveries/role.go +++ /dev/null @@ -1,40 +0,0 @@ -package deliveries - -import ( - components "github.com/fynntang/protobuf-gen-go/protoc-gen-go-crud/api/v1/components" - empty "github.com/golang/protobuf/ptypes/empty" -) - -type RoleService struct { - rc usecase.IRoleUseCase -} - -func (r RoleService) CreateRole(c *gin.Context, in *authorizationV1.CreateRoleRequest) (*empty.Empty, error) { - panic("todo") -} - -func (r RoleService) EnableRole(c *gin.Context, in *authorizationV1.EnableRoleRequest) (*empty.Empty, error) { - panic("todo") -} - -func (r RoleService) GetRole(c *gin.Context, in *authorizationV1.GetRoleRequest) (*components.Role, error) { - panic("todo") -} - -func (r RoleService) ListRoles(c *gin.Context, in *authorizationV1.ListRolesRequest) (*authorizationV1.Roles, error) { - panic("todo") -} - -func (r RoleService) UpdateRole(c *gin.Context, in *authorizationV1.UpdateRoleRequest) (*empty.Empty, error) { - panic("todo") -} - -func (r RoleService) Log(c *gin.Context) *zap.SugaredLogger { - return global.Logger(c).Named("RoleRepo") -} - -func NewRoleService(rc usecase.IRoleUseCase) authorizationV1.RoleHTTPServer { - return &RoleService{ - rc: rc, - } -} diff --git a/protoc-gen-go-crud/internal/authorization/entities/authorization.go b/protoc-gen-go-crud/internal/authorization/entities/authorization.go deleted file mode 100644 index 102aa99..0000000 --- a/protoc-gen-go-crud/internal/authorization/entities/authorization.go +++ /dev/null @@ -1,7 +0,0 @@ -package entities - -type Auth struct { - entity.BaseEntity -} - -func (a *Auth) TableName() string { return "auths" } diff --git a/protoc-gen-go-crud/internal/authorization/entities/role.go b/protoc-gen-go-crud/internal/authorization/entities/role.go deleted file mode 100644 index c66c3a3..0000000 --- a/protoc-gen-go-crud/internal/authorization/entities/role.go +++ /dev/null @@ -1,7 +0,0 @@ -package entities - -type Role struct { - entity.BaseEntity -} - -func (r *Role) TableName() string { return "roles" } diff --git a/protoc-gen-go-crud/internal/authorization/repositories/authorization.go b/protoc-gen-go-crud/internal/authorization/repositories/authorization.go deleted file mode 100644 index 58fdfc9..0000000 --- a/protoc-gen-go-crud/internal/authorization/repositories/authorization.go +++ /dev/null @@ -1,45 +0,0 @@ -package repositories - -type IAuthRepo interface { - CreateAuth(ctx context.Context, Auth *entities.Auth) error - UpdateAuth(ctx context.Context, updateFields []string, Auth *entities.Auth) error - GetAuth(ctx context.Context, id entity.ID) (*entities.Auth, error) - GetAuths(ctx context.Context, filter *database.Filter) (res []*entities.Auth, count int64, err error) - DeleteAuth(ctx context.Context, id entity.ID) error - Log(ctx context.Context) *zap.SugaredLogger -} - -type AuthRepo struct { -} - -func (a *AuthRepo) DB(ctx context.Context) *gorm.DB { - return global.DBFromContext(ctx).Model(&entities.Auth{}) -} - -func (a AuthRepo) CreateAuth(ctx context.Context, auth *entities.Auth) error { - panic("todo") -} - -func (a AuthRepo) UpdateAuth(ctx context.Context, updateFields []string, auth *entities.Auth) error { - panic("todo") -} - -func (a AuthRepo) GetAuth(ctx context.Context, id entity.ID) (*entities.Auth, error) { - panic("todo") -} - -func (a AuthRepo) DeleteAuth(ctx context.Context, id entity.ID) error { - panic("todo") -} - -func (a AuthRepo) GetAuths(ctx context.Context, filter *database.Filter) (res []*entities.Auth, count int64, err error) { - panic("todo") -} - -func (a AuthRepo) Log(ctx context.Context) *zap.SugaredLogger { - return global.Logger(ctx).Named("AuthRepo") -} - -func NewAuthRepo() IAuthRepo { - return &AuthRepo{} -} diff --git a/protoc-gen-go-crud/internal/authorization/repositories/role.go b/protoc-gen-go-crud/internal/authorization/repositories/role.go deleted file mode 100644 index 11d9ba3..0000000 --- a/protoc-gen-go-crud/internal/authorization/repositories/role.go +++ /dev/null @@ -1,45 +0,0 @@ -package repositories - -type IRoleRepo interface { - CreateRole(ctx context.Context, Role *entities.Role) error - UpdateRole(ctx context.Context, updateFields []string, Role *entities.Role) error - GetRole(ctx context.Context, id entity.ID) (*entities.Role, error) - GetRoles(ctx context.Context, filter *database.Filter) (res []*entities.Role, count int64, err error) - DeleteRole(ctx context.Context, id entity.ID) error - Log(ctx context.Context) *zap.SugaredLogger -} - -type RoleRepo struct { -} - -func (r *RoleRepo) DB(ctx context.Context) *gorm.DB { - return global.DBFromContext(ctx).Model(&entities.Role{}) -} - -func (r RoleRepo) CreateRole(ctx context.Context, role *entities.Role) error { - panic("todo") -} - -func (r RoleRepo) UpdateRole(ctx context.Context, updateFields []string, role *entities.Role) error { - panic("todo") -} - -func (r RoleRepo) GetRole(ctx context.Context, id entity.ID) (*entities.Role, error) { - panic("todo") -} - -func (r RoleRepo) DeleteRole(ctx context.Context, id entity.ID) error { - panic("todo") -} - -func (r RoleRepo) GetRoles(ctx context.Context, filter *database.Filter) (res []*entities.Role, count int64, err error) { - panic("todo") -} - -func (r RoleRepo) Log(ctx context.Context) *zap.SugaredLogger { - return global.Logger(ctx).Named("RoleRepo") -} - -func NewRoleRepo() IRoleRepo { - return &RoleRepo{} -} diff --git a/protoc-gen-go-crud/internal/authorization/usecase/authorization.go b/protoc-gen-go-crud/internal/authorization/usecase/authorization.go deleted file mode 100644 index 7b9d935..0000000 --- a/protoc-gen-go-crud/internal/authorization/usecase/authorization.go +++ /dev/null @@ -1,41 +0,0 @@ -package usecase - -type IAuthUseCase interface { - CreateAuth(ctx context.Context, in *authorizationV1.CreateAuthRequest) error - UpdateAuth(ctx context.Context, in *authorizationV1.UpdateAuthRequest) error - DeleteAuth(ctx context.Context, in *authorizationV1.DeleteAuthRequest) error - GetAuth(ctx context.Context, in *authorizationV1.GetAuthRequest) (*entities.Auth, error) - ListAuth(ctx context.Context, in *authorizationV1.ListAuthRequest) ([]*entities.Auth, int64, error) - Log(ctx context.Context) *zap.SugaredLogger -} - -type AuthUseCase struct { -} - -func NewAuthUseCase() IAuthUseCase { - return &AuthUseCase{} -} - -func (a *AuthUseCase) CreateAuth(ctx context.Context, in *authorizationV1.CreateAuthRequest) error { - panic("todo") -} - -func (a *AuthUseCase) UpdateAuth(ctx context.Context, in *authorizationV1.UpdateAuthRequest) error { - panic("todo") -} - -func (a *AuthUseCase) DeleteAuth(ctx context.Context, in *authorizationV1.DeleteAuthRequest) error { - panic("todo") -} - -func (a *AuthUseCase) GetAuth(ctx context.Context, in *authorizationV1.GetAuthRequest) (*entities.Auth, error) { - panic("todo") -} - -func (a *AuthUseCase) ListAuth(ctx context.Context, in *authorizationV1.ListAuthRequest) ([]*entities.Auth, int64, error) { - panic("todo") -} - -func (a AuthUseCase) Log(ctx context.Context) *zap.SugaredLogger { - return global.Logger(ctx).Named("AuthRepo") -} diff --git a/protoc-gen-go-crud/internal/authorization/usecase/role.go b/protoc-gen-go-crud/internal/authorization/usecase/role.go deleted file mode 100644 index 6c973a1..0000000 --- a/protoc-gen-go-crud/internal/authorization/usecase/role.go +++ /dev/null @@ -1,41 +0,0 @@ -package usecase - -type IRoleUseCase interface { - CreateRole(ctx context.Context, in *authorizationV1.CreateRoleRequest) error - UpdateRole(ctx context.Context, in *authorizationV1.UpdateRoleRequest) error - DeleteRole(ctx context.Context, in *authorizationV1.DeleteRoleRequest) error - GetRole(ctx context.Context, in *authorizationV1.GetRoleRequest) (*entities.Role, error) - ListRole(ctx context.Context, in *authorizationV1.ListRoleRequest) ([]*entities.Role, int64, error) - Log(ctx context.Context) *zap.SugaredLogger -} - -type RoleUseCase struct { -} - -func NewRoleUseCase() IRoleUseCase { - return &RoleUseCase{} -} - -func (r *RoleUseCase) CreateRole(ctx context.Context, in *authorizationV1.CreateRoleRequest) error { - panic("todo") -} - -func (r *RoleUseCase) UpdateRole(ctx context.Context, in *authorizationV1.UpdateRoleRequest) error { - panic("todo") -} - -func (r *RoleUseCase) DeleteRole(ctx context.Context, in *authorizationV1.DeleteRoleRequest) error { - panic("todo") -} - -func (r *RoleUseCase) GetRole(ctx context.Context, in *authorizationV1.GetRoleRequest) (*entities.Role, error) { - panic("todo") -} - -func (r *RoleUseCase) ListRole(ctx context.Context, in *authorizationV1.ListRoleRequest) ([]*entities.Role, int64, error) { - panic("todo") -} - -func (r RoleUseCase) Log(ctx context.Context) *zap.SugaredLogger { - return global.Logger(ctx).Named("RoleRepo") -} diff --git a/protoc-gen-go-crud/internal/users/deliveries/users.go b/protoc-gen-go-crud/internal/users/deliveries/users.go deleted file mode 100644 index 88de667..0000000 --- a/protoc-gen-go-crud/internal/users/deliveries/users.go +++ /dev/null @@ -1,72 +0,0 @@ -package deliveries - -import ( - components "github.com/fynntang/protobuf-gen-go/protoc-gen-go-crud/api/v1/components" - empty "github.com/golang/protobuf/ptypes/empty" -) - -type UserService struct { - uc usecase.IUserUseCase -} - -func (u UserService) ChangePassword(c *gin.Context, in *usersV1.ChangePasswordRequest) (*empty.Empty, error) { - panic("todo") -} - -func (u UserService) CreateUser(c *gin.Context, in *usersV1.CreateUserRequest) (*empty.Empty, error) { - panic("todo") -} - -func (u UserService) DeleteUser(c *gin.Context, in *usersV1.DeleteUserRequest) (*empty.Empty, error) { - panic("todo") -} - -func (u UserService) EnableUser(c *gin.Context, in *usersV1.EnableUserRequest) (*empty.Empty, error) { - panic("todo") -} - -func (u UserService) GetUser(c *gin.Context, in *usersV1.GetUserRequest) (*components.User, error) { - panic("todo") -} - -func (u UserService) ListUsers(c *gin.Context, in *usersV1.ListUsersRequest) (*usersV1.ListUsersReply, error) { - panic("todo") -} - -func (u UserService) Reset2FA(c *gin.Context, in *usersV1.Reset2FARequest) (*empty.Empty, error) { - panic("todo") -} - -func (u UserService) ResetActivate(c *gin.Context, in *usersV1.ResetActivateRequest) (*empty.Empty, error) { - panic("todo") -} - -func (u UserService) ResetPassword(c *gin.Context, in *usersV1.ResetPasswordRequest) (*empty.Empty, error) { - panic("todo") -} - -func (u UserService) UpdateCurrentUser(c *gin.Context, in *usersV1.UpdateCurrentUserRequest) (*empty.Empty, error) { - panic("todo") -} - -func (u UserService) UpdateUser(c *gin.Context, in *usersV1.UpdateUserRequest) (*empty.Empty, error) { - panic("todo") -} - -func (u UserService) UploadProfile(c *gin.Context, in *usersV1.UploadProfileRequest) (*usersV1.UploadProfileResponse, error) { - panic("todo") -} - -func (u UserService) User(c *gin.Context, in *empty.Empty) (*components.User, error) { - panic("todo") -} - -func (u UserService) Log(c *gin.Context) *zap.SugaredLogger { - return global.Logger(c).Named("UserRepo") -} - -func NewUserService(uc usecase.IUserUseCase) usersV1.UserHTTPServer { - return &UserService{ - uc: uc, - } -} diff --git a/protoc-gen-go-crud/internal/users/entities/users.go b/protoc-gen-go-crud/internal/users/entities/users.go deleted file mode 100644 index 381f3d4..0000000 --- a/protoc-gen-go-crud/internal/users/entities/users.go +++ /dev/null @@ -1,7 +0,0 @@ -package entities - -type User struct { - entity.BaseEntity -} - -func (u *User) TableName() string { return "users" } diff --git a/protoc-gen-go-crud/internal/users/repositories/users.go b/protoc-gen-go-crud/internal/users/repositories/users.go deleted file mode 100644 index bd51fb1..0000000 --- a/protoc-gen-go-crud/internal/users/repositories/users.go +++ /dev/null @@ -1,45 +0,0 @@ -package repositories - -type IUserRepo interface { - CreateUser(ctx context.Context, User *entities.User) error - UpdateUser(ctx context.Context, updateFields []string, User *entities.User) error - GetUser(ctx context.Context, id entity.ID) (*entities.User, error) - GetUsers(ctx context.Context, filter *database.Filter) (res []*entities.User, count int64, err error) - DeleteUser(ctx context.Context, id entity.ID) error - Log(ctx context.Context) *zap.SugaredLogger -} - -type UserRepo struct { -} - -func (u *UserRepo) DB(ctx context.Context) *gorm.DB { - return global.DBFromContext(ctx).Model(&entities.User{}) -} - -func (u UserRepo) CreateUser(ctx context.Context, user *entities.User) error { - panic("todo") -} - -func (u UserRepo) UpdateUser(ctx context.Context, updateFields []string, user *entities.User) error { - panic("todo") -} - -func (u UserRepo) GetUser(ctx context.Context, id entity.ID) (*entities.User, error) { - panic("todo") -} - -func (u UserRepo) DeleteUser(ctx context.Context, id entity.ID) error { - panic("todo") -} - -func (u UserRepo) GetUsers(ctx context.Context, filter *database.Filter) (res []*entities.User, count int64, err error) { - panic("todo") -} - -func (u UserRepo) Log(ctx context.Context) *zap.SugaredLogger { - return global.Logger(ctx).Named("UserRepo") -} - -func NewUserRepo() IUserRepo { - return &UserRepo{} -} diff --git a/protoc-gen-go-crud/internal/users/usecase/users.go b/protoc-gen-go-crud/internal/users/usecase/users.go deleted file mode 100644 index 8e6e11a..0000000 --- a/protoc-gen-go-crud/internal/users/usecase/users.go +++ /dev/null @@ -1,41 +0,0 @@ -package usecase - -type IUserUseCase interface { - CreateUser(ctx context.Context, in *usersV1.CreateUserRequest) error - UpdateUser(ctx context.Context, in *usersV1.UpdateUserRequest) error - DeleteUser(ctx context.Context, in *usersV1.DeleteUserRequest) error - GetUser(ctx context.Context, in *usersV1.GetUserRequest) (*entities.User, error) - ListUser(ctx context.Context, in *usersV1.ListUserRequest) ([]*entities.User, int64, error) - Log(ctx context.Context) *zap.SugaredLogger -} - -type UserUseCase struct { -} - -func NewUserUseCase() IUserUseCase { - return &UserUseCase{} -} - -func (u *UserUseCase) CreateUser(ctx context.Context, in *usersV1.CreateUserRequest) error { - panic("todo") -} - -func (u *UserUseCase) UpdateUser(ctx context.Context, in *usersV1.UpdateUserRequest) error { - panic("todo") -} - -func (u *UserUseCase) DeleteUser(ctx context.Context, in *usersV1.DeleteUserRequest) error { - panic("todo") -} - -func (u *UserUseCase) GetUser(ctx context.Context, in *usersV1.GetUserRequest) (*entities.User, error) { - panic("todo") -} - -func (u *UserUseCase) ListUser(ctx context.Context, in *usersV1.ListUserRequest) ([]*entities.User, int64, error) { - panic("todo") -} - -func (u UserUseCase) Log(ctx context.Context) *zap.SugaredLogger { - return global.Logger(ctx).Named("UserRepo") -} diff --git a/protoc-gen-go-crud/pkg/database/database.go b/protoc-gen-go-crud/pkg/database/database.go deleted file mode 100644 index 76e87e7..0000000 --- a/protoc-gen-go-crud/pkg/database/database.go +++ /dev/null @@ -1,74 +0,0 @@ -package database - -import ( - secretscfg "bitbucket.org/antalphadev/earn/configs/common_secrets" - "bitbucket.org/antalphadev/earn/pkg/dictionary" - "bitbucket.org/antalphadev/earn/pkg/logger" - "context" - "fmt" - "go.uber.org/zap/zapcore" - "gorm.io/driver/mysql" - "gorm.io/gorm" - gormlogger "gorm.io/gorm/logger" - "moul.io/zapgorm2" - "strings" - "time" -) - -var DB *gorm.DB - -type MysqlCfg struct { - Host string `yaml:"host"` - Port int `yaml:"port"` - User string `yaml:"user"` - Password string `yaml:"password"` - Database string `yaml:"database"` -} - -func NewDatabase(env string) { - var masterDsn string - - for name, c := range secretscfg.Databases.Mysql { - if strings.Contains(name, "master") { - masterDsn = fmt.Sprintf("%s:%s@tcp(%s:%d)/%s?charset=utf8mb4&parseTime=True&loc=Local", c.User, c.Password, c.Host, c.Port, c.Database) - } - } - zLogger := zapLogger(env) - - db, err := gorm.Open(mysql.Open(masterDsn), &gorm.Config{Logger: zLogger}) - if err != nil { - panic(fmt.Sprintf("gorm.Open error: %v\n", err)) - } - - // TODO: add slave db - - sqlDB, err := db.DB() - if err != nil { - panic(fmt.Sprintf("db.DB error: %v\n", err)) - } - - sqlDB.SetMaxIdleConns(10) - sqlDB.SetMaxOpenConns(100) - sqlDB.SetConnMaxIdleTime(time.Minute * 5) - - DB = db.Debug() -} - -func zapLogger(env string) gormlogger.Interface { - zaplogger := logger.Get(context.Background()).Named("gorm") - zLogger := zapgorm2.Logger{ - ZapLogger: zaplogger, - LogLevel: gormlogger.Warn, - SlowThreshold: 100 * time.Millisecond, - IgnoreRecordNotFoundError: false, - Context: func(ctx context.Context) (fields []zapcore.Field) { - return fields - }, - } - - if env != dictionary.EnvProduction { - zLogger.LogLevel = gormlogger.Info - } - zLogger.SetAsDefault() - return zLogger -} diff --git a/protoc-gen-go-crud/pkg/database/entity/base.go b/protoc-gen-go-crud/pkg/database/entity/base.go deleted file mode 100644 index fe56351..0000000 --- a/protoc-gen-go-crud/pkg/database/entity/base.go +++ /dev/null @@ -1,106 +0,0 @@ -package entity - -import ( - "bitbucket.org/antalphadev/earn/pkg/dictionary" - pkgRedis "bitbucket.org/antalphadev/earn/pkg/redis" - "bitbucket.org/antalphadev/earn/pkg/utils" - "context" - "encoding/json" - "errors" - "github.com/redis/go-redis/v9" - "gorm.io/gorm" - "log" - "strconv" - "time" -) - -type BaseEntity struct { - ID ID `gorm:"column:id;primary_key"` - CreatedAt time.Time `gorm:"<-:create;column:created_at"` - CreatedBy string `gorm:"<-:create;column:created_by"` - UpdatedAt time.Time `gorm:"column:updated_at"` - UpdatedBy string `gorm:"column:updated_by"` -} - -type DeletedAt struct { - DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;index"` -} - -type BaseTenantEntity struct { - BaseEntity - TenantID string `gorm:"column:tenant_id;index"` -} - -func (b *BaseEntity) BeforeCreate(tx *gorm.DB) error { - if b.ID == 0 { - b.ID = b.ID.FromInt64(utils.Snowflake().Generate().Int64()) - } - b.CreatedAt = time.Now() - ctx := tx.Statement.Context - log.Printf("BeforeCreate ctx: %#v\n", ctx) - if uid, ok := ctx.Value(dictionary.UserFieldUserID).(ID); ok { - log.Printf("BeforeCreate uid: %#v\n", uid) - b.CreatedBy = uid.String() - b.UpdatedBy = b.CreatedBy - } - b.UpdatedAt = b.CreatedAt - - return nil -} - -func (b *BaseEntity) BeforeUpdate(tx *gorm.DB) error { - b.UpdatedAt = time.Now() - ctx := tx.Statement.Context - if uid, ok := ctx.Value(dictionary.UserFieldUserID).(ID); ok { - tx.Statement.SetColumn("updated_by", uid.String()) - } - - return nil -} - -func (b *BaseEntity) AfterFind(tx *gorm.DB) error { - users := userNicknameCache(tx.Statement.Context) - - for id, nickname := range users { - if b.CreatedBy == id { - b.CreatedBy = nickname - } - if b.UpdatedBy == id { - b.UpdatedBy = nickname - } - } - - return nil -} - -func userNicknameCache(ctx context.Context) map[string]string { - - cacheKey := "dictionary:users" - var userCache string - var users = make(map[string]string) - - cache := pkgRedis.GetRedis().Get(ctx, cacheKey) - if err := cache.Err(); err != nil && !errors.Is(err, redis.Nil) { - return nil - } - if cache.Val() != "" && cache.Val() != "{}" { - _ = json.Unmarshal([]byte(cache.Val()), &users) - return users - } else { - var result []map[string]interface{} - - if db, ok := ctx.Value(dictionary.ContextDB).(*gorm.DB); ok { - db.Table("users").Select([]string{"id", "nickname"}).Find(&result) - } - - for _, item := range result { - users[strconv.FormatInt(item["id"].(int64), 10)] = item["nickname"].(string) - } - usersMarshal, _ := json.Marshal(users) - userCache = string(usersMarshal) - - pkgRedis.GetRedis().Set(ctx, cacheKey, userCache, time.Hour) - } - - return users -} diff --git a/protoc-gen-go-crud/pkg/database/entity/id.go b/protoc-gen-go-crud/pkg/database/entity/id.go deleted file mode 100644 index 8b7cfc5..0000000 --- a/protoc-gen-go-crud/pkg/database/entity/id.go +++ /dev/null @@ -1,35 +0,0 @@ -package entity - -import ( - "strconv" -) - -type ID int64 - -func (id ID) Int64() int64 { - return int64(id) -} - -func (id ID) String() string { - return strconv.FormatInt(id.Int64(), 10) -} - -func (id ID) FromInt64(i int64) ID { - return IDFromInt64(i) -} - -func (id ID) FromString(s string) ID { - return IDFromString(s) -} - -func IDFromString(s string) ID { - id, _ := IDFromStringError(s) - return id -} -func IDFromStringError(s string) (ID, error) { - i, err := strconv.ParseInt(s, 10, 64) - return ID(i), err -} -func IDFromInt64(i int64) ID { - return ID(i) -} diff --git a/protoc-gen-go-crud/pkg/database/filters.go b/protoc-gen-go-crud/pkg/database/filters.go deleted file mode 100644 index c5a0551..0000000 --- a/protoc-gen-go-crud/pkg/database/filters.go +++ /dev/null @@ -1,88 +0,0 @@ -package database - -import "gorm.io/gorm" - -type OrderBy string - -const ( - OrderByAsc OrderBy = "asc" - OrderByDesc OrderBy = "desc" -) - -type Where struct { - column string - op string - value interface{} -} - -type Filter struct { - where []Where - offset int - limit int - orderBy map[string]OrderBy -} - -func NewFilter() *Filter { - return &Filter{ - where: make([]Where, 0), - orderBy: make(map[string]OrderBy), - } -} - -func (f *Filter) AddWhere(column, op string, value interface{}) *Filter { - f.where = append(f.where, Where{column: column, op: op, value: value}) - return f -} - -func (f *Filter) AddOrderBy(column string, orderBy OrderBy) *Filter { - f.orderBy[column] = orderBy - - return f -} - -func (f *Filter) SetOffset(offset int) *Filter { - f.offset = offset - return f -} - -func (f *Filter) SetLimit(limit int) *Filter { - f.limit = limit - return f -} - -func (f *Filter) Build(db *gorm.DB) *gorm.DB { - - if len(f.where) > 0 { - for _, v := range f.where { - db = db.Where(v.column+" "+v.op+" ?", v.value) - } - } - - if f.limit > 0 && f.offset > 0 { - db = db.Limit(f.limit).Offset((f.offset - 1) * f.limit) - } else if f.limit > 0 { - db = db.Limit(f.limit) - } else if f.offset > 0 { - db = db.Offset((f.offset - 1) * f.limit) - } - - if len(f.orderBy) > 0 { - for k, v := range f.orderBy { - db = db.Order(k + " " + string(v)) - } - } else { - db = db.Order("id desc") - } - - return db -} - -func (f *Filter) Count(db *gorm.DB) int64 { - var count int64 - f. - SetOffset(0). - SetLimit(0). - Build(db). - Count(&count) - return count -} diff --git a/protoc-gen-go-crud/pkg/third_party/README.md b/protoc-gen-go-crud/pkg/third_party/README.md deleted file mode 100644 index 005faa2..0000000 --- a/protoc-gen-go-crud/pkg/third_party/README.md +++ /dev/null @@ -1 +0,0 @@ -# third_party diff --git a/protoc-gen-go-crud/pkg/third_party/protos/errors/errors.proto b/protoc-gen-go-crud/pkg/third_party/protos/errors/errors.proto deleted file mode 100644 index 0963d91..0000000 --- a/protoc-gen-go-crud/pkg/third_party/protos/errors/errors.proto +++ /dev/null @@ -1,18 +0,0 @@ -syntax = "proto3"; - -package errors; - -option go_package = "github.com/go-kratos/kratos/v2/errors;errors"; -option java_multiple_files = true; -option java_package = "com.github.kratos.errors"; -option objc_class_prefix = "KratosErrors"; - -import "google/protobuf/descriptor.proto"; - -extend google.protobuf.EnumOptions { - int32 default_code = 1108; -} - -extend google.protobuf.EnumValueOptions { - int32 code = 1109; -} \ No newline at end of file diff --git a/protoc-gen-go-crud/pkg/third_party/protos/google/api/annotations.proto b/protoc-gen-go-crud/pkg/third_party/protos/google/api/annotations.proto deleted file mode 100644 index 85c361b..0000000 --- a/protoc-gen-go-crud/pkg/third_party/protos/google/api/annotations.proto +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) 2015, Google Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.api; - -import "google/api/http.proto"; -import "google/protobuf/descriptor.proto"; - -option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; -option java_multiple_files = true; -option java_outer_classname = "AnnotationsProto"; -option java_package = "com.google.api"; -option objc_class_prefix = "GAPI"; - -extend google.protobuf.MethodOptions { - // See `HttpRule`. - HttpRule http = 72295728; -} diff --git a/protoc-gen-go-crud/pkg/third_party/protos/google/api/client.proto b/protoc-gen-go-crud/pkg/third_party/protos/google/api/client.proto deleted file mode 100644 index d3d1ead..0000000 --- a/protoc-gen-go-crud/pkg/third_party/protos/google/api/client.proto +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.api; - -import "google/protobuf/descriptor.proto"; - -option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; -option java_multiple_files = true; -option java_outer_classname = "ClientProto"; -option java_package = "com.google.api"; -option objc_class_prefix = "GAPI"; - - -extend google.protobuf.ServiceOptions { - // The hostname for this service. - // This should be specified with no prefix or protocol. - // - // Example: - // - // service Foo { - // option (google.api.default_host) = "foo.googleapi.com"; - // ... - // } - string default_host = 1049; - - // OAuth scopes needed for the client. - // - // Example: - // - // service Foo { - // option (google.api.oauth_scopes) = \ - // "https://www.googleapis.com/auth/cloud-platform"; - // ... - // } - // - // If there is more than one scope, use a comma-separated string: - // - // Example: - // - // service Foo { - // option (google.api.oauth_scopes) = \ - // "https://www.googleapis.com/auth/cloud-platform," - // "https://www.googleapis.com/auth/monitoring"; - // ... - // } - string oauth_scopes = 1050; -} - - -extend google.protobuf.MethodOptions { - // A definition of a client library method signature. - // - // In client libraries, each proto RPC corresponds to one or more methods - // which the end user is able to call, and calls the underlying RPC. - // Normally, this method receives a single argument (a struct or instance - // corresponding to the RPC request object). Defining this field will - // add one or more overloads providing flattened or simpler method signatures - // in some languages. - // - // The fields on the method signature are provided as a comma-separated - // string. - // - // For example, the proto RPC and annotation: - // - // rpc CreateSubscription(CreateSubscriptionRequest) - // returns (Subscription) { - // option (google.api.method_signature) = "name,topic"; - // } - // - // Would add the following Java overload (in addition to the method accepting - // the request object): - // - // public final Subscription createSubscription(String name, String topic) - // - // The following backwards-compatibility guidelines apply: - // - // * Adding this annotation to an unannotated method is backwards - // compatible. - // * Adding this annotation to a method which already has existing - // method signature annotations is backwards compatible if and only if - // the new method signature annotation is last in the sequence. - // * Modifying or removing an existing method signature annotation is - // a breaking change. - // * Re-ordering existing method signature annotations is a breaking - // change. - repeated string method_signature = 1051; -} \ No newline at end of file diff --git a/protoc-gen-go-crud/pkg/third_party/protos/google/api/field_behavior.proto b/protoc-gen-go-crud/pkg/third_party/protos/google/api/field_behavior.proto deleted file mode 100644 index e9716a2..0000000 --- a/protoc-gen-go-crud/pkg/third_party/protos/google/api/field_behavior.proto +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2019 Google LLC. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.api; - -import "google/protobuf/descriptor.proto"; - -option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; -option java_multiple_files = true; -option java_outer_classname = "FieldBehaviorProto"; -option java_package = "com.google.api"; -option objc_class_prefix = "GAPI"; - - -// An indicator of the behavior of a given field (for example, that a field -// is required in requests, or given as output but ignored as input). -// This **does not** change the behavior in protocol buffers itself; it only -// denotes the behavior and may affect how API tooling handles the field. -// -// Note: This enum **may** receive new values in the future. -enum FieldBehavior { - // Conventional default for enums. Do not use this. - FIELD_BEHAVIOR_UNSPECIFIED = 0; - - // Specifically denotes a field as optional. - // While all fields in protocol buffers are optional, this may be specified - // for emphasis if appropriate. - OPTIONAL = 1; - - // Denotes a field as required. - // This indicates that the field **must** be provided as part of the request, - // and failure to do so will cause an error (usually `INVALID_ARGUMENT`). - REQUIRED = 2; - - // Denotes a field as output only. - // This indicates that the field is provided in responses, but including the - // field in a request does nothing (the server *must* ignore it and - // *must not* throw an error as a result of the field's presence). - OUTPUT_ONLY = 3; - - // Denotes a field as input only. - // This indicates that the field is provided in requests, and the - // corresponding field is not included in output. - INPUT_ONLY = 4; - - // Denotes a field as immutable. - // This indicates that the field may be set once in a request to create a - // resource, but may not be changed thereafter. - IMMUTABLE = 5; -} - - -extend google.protobuf.FieldOptions { - // A designation of a specific field behavior (required, output only, etc.) - // in protobuf messages. - // - // Examples: - // - // string name = 1 [(google.api.field_behavior) = REQUIRED]; - // State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - // google.protobuf.Duration ttl = 1 - // [(google.api.field_behavior) = INPUT_ONLY]; - // google.protobuf.Timestamp expire_time = 1 - // [(google.api.field_behavior) = OUTPUT_ONLY, - // (google.api.field_behavior) = IMMUTABLE]; - repeated FieldBehavior field_behavior = 1052; -} \ No newline at end of file diff --git a/protoc-gen-go-crud/pkg/third_party/protos/google/api/http.proto b/protoc-gen-go-crud/pkg/third_party/protos/google/api/http.proto deleted file mode 100644 index 69460cf..0000000 --- a/protoc-gen-go-crud/pkg/third_party/protos/google/api/http.proto +++ /dev/null @@ -1,375 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.api; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations"; -option java_multiple_files = true; -option java_outer_classname = "HttpProto"; -option java_package = "com.google.api"; -option objc_class_prefix = "GAPI"; - -// Defines the HTTP configuration for an API service. It contains a list of -// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method -// to one or more HTTP REST API methods. -message Http { - // A list of HTTP configuration rules that apply to individual API methods. - // - // **NOTE:** All service configuration rules follow "last one wins" order. - repeated HttpRule rules = 1; - - // When set to true, URL path parameters will be fully URI-decoded except in - // cases of single segment matches in reserved expansion, where "%2F" will be - // left encoded. - // - // The default behavior is to not decode RFC 6570 reserved characters in multi - // segment matches. - bool fully_decode_reserved_expansion = 2; -} - -// # gRPC Transcoding -// -// gRPC Transcoding is a feature for mapping between a gRPC method and one or -// more HTTP REST endpoints. It allows developers to build a single API service -// that supports both gRPC APIs and REST APIs. Many systems, including [Google -// APIs](https://github.com/googleapis/googleapis), -// [Cloud Endpoints](https://cloud.google.com/endpoints), [gRPC -// Gateway](https://github.com/grpc-ecosystem/grpc-gateway), -// and [Envoy](https://github.com/envoyproxy/envoy) proxy support this feature -// and use it for large scale production services. -// -// `HttpRule` defines the schema of the gRPC/REST mapping. The mapping specifies -// how different portions of the gRPC request message are mapped to the URL -// path, URL query parameters, and HTTP request body. It also controls how the -// gRPC response message is mapped to the HTTP response body. `HttpRule` is -// typically specified as an `google.api.http` annotation on the gRPC method. -// -// Each mapping specifies a URL path template and an HTTP method. The path -// template may refer to one or more fields in the gRPC request message, as long -// as each field is a non-repeated field with a primitive (non-message) type. -// The path template controls how fields of the request message are mapped to -// the URL path. -// -// Example: -// -// service Messaging { -// rpc GetMessage(GetMessageRequest) returns (Message) { -// option (google.api.http) = { -// get: "/v1/{name=messages/*}" -// }; -// } -// } -// message GetMessageRequest { -// string name = 1; // Mapped to URL path. -// } -// message Message { -// string text = 1; // The resource content. -// } -// -// This enables an HTTP REST to gRPC mapping as below: -// -// HTTP | gRPC -// -----|----- -// `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` -// -// Any fields in the request message which are not bound by the path template -// automatically become HTTP query parameters if there is no HTTP request body. -// For example: -// -// service Messaging { -// rpc GetMessage(GetMessageRequest) returns (Message) { -// option (google.api.http) = { -// get:"/v1/messages/{message_id}" -// }; -// } -// } -// message GetMessageRequest { -// message SubMessage { -// string subfield = 1; -// } -// string message_id = 1; // Mapped to URL path. -// int64 revision = 2; // Mapped to URL query parameter `revision`. -// SubMessage sub = 3; // Mapped to URL query parameter `sub.subfield`. -// } -// -// This enables a HTTP JSON to RPC mapping as below: -// -// HTTP | gRPC -// -----|----- -// `GET /v1/messages/123456?revision=2&sub.subfield=foo` | -// `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: -// "foo"))` -// -// Note that fields which are mapped to URL query parameters must have a -// primitive type or a repeated primitive type or a non-repeated message type. -// In the case of a repeated type, the parameter can be repeated in the URL -// as `...?param=A¶m=B`. In the case of a message type, each field of the -// message is mapped to a separate parameter, such as -// `...?foo.a=A&foo.b=B&foo.c=C`. -// -// For HTTP methods that allow a request body, the `body` field -// specifies the mapping. Consider a REST update method on the -// message resource collection: -// -// service Messaging { -// rpc UpdateMessage(UpdateMessageRequest) returns (Message) { -// option (google.api.http) = { -// patch: "/v1/messages/{message_id}" -// body: "message" -// }; -// } -// } -// message UpdateMessageRequest { -// string message_id = 1; // mapped to the URL -// Message message = 2; // mapped to the body -// } -// -// The following HTTP JSON to RPC mapping is enabled, where the -// representation of the JSON in the request body is determined by -// protos JSON encoding: -// -// HTTP | gRPC -// -----|----- -// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: -// "123456" message { text: "Hi!" })` -// -// The special name `*` can be used in the body mapping to define that -// every field not bound by the path template should be mapped to the -// request body. This enables the following alternative definition of -// the update method: -// -// service Messaging { -// rpc UpdateMessage(Message) returns (Message) { -// option (google.api.http) = { -// patch: "/v1/messages/{message_id}" -// body: "*" -// }; -// } -// } -// message Message { -// string message_id = 1; -// string text = 2; -// } -// -// -// The following HTTP JSON to RPC mapping is enabled: -// -// HTTP | gRPC -// -----|----- -// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: -// "123456" text: "Hi!")` -// -// Note that when using `*` in the body mapping, it is not possible to -// have HTTP parameters, as all fields not bound by the path end in -// the body. This makes this option more rarely used in practice when -// defining REST APIs. The common usage of `*` is in custom methods -// which don't use the URL at all for transferring data. -// -// It is possible to define multiple HTTP methods for one RPC by using -// the `additional_bindings` option. Example: -// -// service Messaging { -// rpc GetMessage(GetMessageRequest) returns (Message) { -// option (google.api.http) = { -// get: "/v1/messages/{message_id}" -// additional_bindings { -// get: "/v1/users/{user_id}/messages/{message_id}" -// } -// }; -// } -// } -// message GetMessageRequest { -// string message_id = 1; -// string user_id = 2; -// } -// -// This enables the following two alternative HTTP JSON to RPC mappings: -// -// HTTP | gRPC -// -----|----- -// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` -// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: -// "123456")` -// -// ## Rules for HTTP mapping -// -// 1. Leaf request fields (recursive expansion nested messages in the request -// message) are classified into three categories: -// - Fields referred by the path template. They are passed via the URL path. -// - Fields referred by the [HttpRule.body][google.api.HttpRule.body]. They are passed via the HTTP -// request body. -// - All other fields are passed via the URL query parameters, and the -// parameter name is the field path in the request message. A repeated -// field can be represented as multiple query parameters under the same -// name. -// 2. If [HttpRule.body][google.api.HttpRule.body] is "*", there is no URL query parameter, all fields -// are passed via URL path and HTTP request body. -// 3. If [HttpRule.body][google.api.HttpRule.body] is omitted, there is no HTTP request body, all -// fields are passed via URL path and URL query parameters. -// -// ### Path template syntax -// -// Template = "/" Segments [ Verb ] ; -// Segments = Segment { "/" Segment } ; -// Segment = "*" | "**" | LITERAL | Variable ; -// Variable = "{" FieldPath [ "=" Segments ] "}" ; -// FieldPath = IDENT { "." IDENT } ; -// Verb = ":" LITERAL ; -// -// The syntax `*` matches a single URL path segment. The syntax `**` matches -// zero or more URL path segments, which must be the last part of the URL path -// except the `Verb`. -// -// The syntax `Variable` matches part of the URL path as specified by its -// template. A variable template must not contain other variables. If a variable -// matches a single path segment, its template may be omitted, e.g. `{var}` -// is equivalent to `{var=*}`. -// -// The syntax `LITERAL` matches literal text in the URL path. If the `LITERAL` -// contains any reserved character, such characters should be percent-encoded -// before the matching. -// -// If a variable contains exactly one path segment, such as `"{var}"` or -// `"{var=*}"`, when such a variable is expanded into a URL path on the client -// side, all characters except `[-_.~0-9a-zA-Z]` are percent-encoded. The -// server side does the reverse decoding. Such variables show up in the -// [Discovery -// Document](https://developers.google.com/discovery/v1/reference/apis) as -// `{var}`. -// -// If a variable contains multiple path segments, such as `"{var=foo/*}"` -// or `"{var=**}"`, when such a variable is expanded into a URL path on the -// client side, all characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. -// The server side does the reverse decoding, except "%2F" and "%2f" are left -// unchanged. Such variables show up in the -// [Discovery -// Document](https://developers.google.com/discovery/v1/reference/apis) as -// `{+var}`. -// -// ## Using gRPC API Service Configuration -// -// gRPC API Service Configuration (service config) is a configuration language -// for configuring a gRPC service to become a user-facing product. The -// service config is simply the YAML representation of the `google.api.Service` -// proto message. -// -// As an alternative to annotating your proto file, you can configure gRPC -// transcoding in your service config YAML files. You do this by specifying a -// `HttpRule` that maps the gRPC method to a REST endpoint, achieving the same -// effect as the proto annotation. This can be particularly useful if you -// have a proto that is reused in multiple services. Note that any transcoding -// specified in the service config will override any matching transcoding -// configuration in the proto. -// -// Example: -// -// http: -// rules: -// # Selects a gRPC method and applies HttpRule to it. -// - selector: example.v1.Messaging.GetMessage -// get: /v1/messages/{message_id}/{sub.subfield} -// -// ## Special notes -// -// When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the -// proto to JSON conversion must follow the [proto3 -// specification](https://developers.google.com/protocol-buffers/docs/proto3#json). -// -// While the single segment variable follows the semantics of -// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2 Simple String -// Expansion, the multi segment variable **does not** follow RFC 6570 Section -// 3.2.3 Reserved Expansion. The reason is that the Reserved Expansion -// does not expand special characters like `?` and `#`, which would lead -// to invalid URLs. As the result, gRPC Transcoding uses a custom encoding -// for multi segment variables. -// -// The path variables **must not** refer to any repeated or mapped field, -// because client libraries are not capable of handling such variable expansion. -// -// The path variables **must not** capture the leading "/" character. The reason -// is that the most common use case "{var}" does not capture the leading "/" -// character. For consistency, all path variables must share the same behavior. -// -// Repeated message fields must not be mapped to URL query parameters, because -// no client library can support such complicated mapping. -// -// If an API needs to use a JSON array for request or response body, it can map -// the request or response body to a repeated field. However, some gRPC -// Transcoding implementations may not support this feature. -message HttpRule { - // Selects a method to which this rule applies. - // - // Refer to [selector][google.api.DocumentationRule.selector] for syntax details. - string selector = 1; - - // Determines the URL pattern is matched by this rules. This pattern can be - // used with any of the {get|put|post|delete|patch} methods. A custom method - // can be defined using the 'custom' field. - oneof pattern { - // Maps to HTTP GET. Used for listing and getting information about - // resources. - string get = 2; - - // Maps to HTTP PUT. Used for replacing a resource. - string put = 3; - - // Maps to HTTP POST. Used for creating a resource or performing an action. - string post = 4; - - // Maps to HTTP DELETE. Used for deleting a resource. - string delete = 5; - - // Maps to HTTP PATCH. Used for updating a resource. - string patch = 6; - - // The custom pattern is used for specifying an HTTP method that is not - // included in the `pattern` field, such as HEAD, or "*" to leave the - // HTTP method unspecified for this rule. The wild-card rule is useful - // for services that provide content to Web (HTML) clients. - CustomHttpPattern custom = 8; - } - - // The name of the request field whose value is mapped to the HTTP request - // body, or `*` for mapping all request fields not captured by the path - // pattern to the HTTP body, or omitted for not having any HTTP request body. - // - // NOTE: the referred field must be present at the top-level of the request - // message type. - string body = 7; - - // Optional. The name of the response field whose value is mapped to the HTTP - // response body. When omitted, the entire response message will be used - // as the HTTP response body. - // - // NOTE: The referred field must be present at the top-level of the response - // message type. - string response_body = 12; - - // Additional HTTP bindings for the selector. Nested bindings must - // not contain an `additional_bindings` field themselves (that is, - // the nesting may only be one level deep). - repeated HttpRule additional_bindings = 11; -} - -// A custom pattern is used for defining custom HTTP verb. -message CustomHttpPattern { - // The name of this custom HTTP verb. - string kind = 1; - - // The path matched by this custom verb. - string path = 2; -} diff --git a/protoc-gen-go-crud/pkg/third_party/protos/google/api/httpbody.proto b/protoc-gen-go-crud/pkg/third_party/protos/google/api/httpbody.proto deleted file mode 100644 index 1a5bb78..0000000 --- a/protoc-gen-go-crud/pkg/third_party/protos/google/api/httpbody.proto +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2020 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.api; - -import "google/protobuf/any.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/api/httpbody;httpbody"; -option java_multiple_files = true; -option java_outer_classname = "HttpBodyProto"; -option java_package = "com.google.api"; -option objc_class_prefix = "GAPI"; - -// Message that represents an arbitrary HTTP body. It should only be used for -// payload formats that can't be represented as JSON, such as raw binary or -// an HTML page. -// -// -// This message can be used both in streaming and non-streaming API methods in -// the request as well as the response. -// -// It can be used as a top-level request field, which is convenient if one -// wants to extract parameters from either the URL or HTTP template into the -// request fields and also want access to the raw HTTP body. -// -// Example: -// -// message GetResourceRequest { -// // A unique request id. -// string request_id = 1; -// -// // The raw HTTP body is bound to this field. -// google.api.HttpBody http_body = 2; -// } -// -// service ResourceService { -// rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); -// rpc UpdateResource(google.api.HttpBody) returns -// (google.protobuf.Empty); -// } -// -// Example with streaming methods: -// -// service CaldavService { -// rpc GetCalendar(stream google.api.HttpBody) -// returns (stream google.api.HttpBody); -// rpc UpdateCalendar(stream google.api.HttpBody) -// returns (stream google.api.HttpBody); -// } -// -// Use of this type only changes how the request and response bodies are -// handled, all other features will continue to work unchanged. -message HttpBody { - // The HTTP Content-Type header value specifying the content type of the body. - string content_type = 1; - - // The HTTP request/response body as raw binary. - bytes data = 2; - - // Application specific response metadata. Must be set in the first response - // for streaming APIs. - repeated google.protobuf.Any extensions = 3; -} diff --git a/protoc-gen-go-crud/pkg/third_party/protos/google/protobuf/descriptor.proto b/protoc-gen-go-crud/pkg/third_party/protos/google/protobuf/descriptor.proto deleted file mode 100644 index 9e23422..0000000 --- a/protoc-gen-go-crud/pkg/third_party/protos/google/protobuf/descriptor.proto +++ /dev/null @@ -1,911 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Author: kenton@google.com (Kenton Varda) -// Based on original Protocol Buffers design by -// Sanjay Ghemawat, Jeff Dean, and others. -// -// The messages in this file describe the definitions found in .proto files. -// A valid .proto file can be translated directly to a FileDescriptorProto -// without any other information (e.g. without reading its imports). - - -syntax = "proto2"; - -package google.protobuf; - -option go_package = "google.golang.org/protobuf/types/descriptorpb"; -option java_package = "com.google.protobuf"; -option java_outer_classname = "DescriptorProtos"; -option csharp_namespace = "Google.Protobuf.Reflection"; -option objc_class_prefix = "GPB"; -option cc_enable_arenas = true; - -// descriptor.proto must be optimized for speed because reflection-based -// algorithms don't work during bootstrapping. -option optimize_for = SPEED; - -// The protocol compiler can output a FileDescriptorSet containing the .proto -// files it parses. -message FileDescriptorSet { - repeated FileDescriptorProto file = 1; -} - -// Describes a complete .proto file. -message FileDescriptorProto { - optional string name = 1; // file name, relative to root of source tree - optional string package = 2; // e.g. "foo", "foo.bar", etc. - - // Names of files imported by this file. - repeated string dependency = 3; - // Indexes of the public imported files in the dependency list above. - repeated int32 public_dependency = 10; - // Indexes of the weak imported files in the dependency list. - // For Google-internal migration only. Do not use. - repeated int32 weak_dependency = 11; - - // All top-level definitions in this file. - repeated DescriptorProto message_type = 4; - repeated EnumDescriptorProto enum_type = 5; - repeated ServiceDescriptorProto service = 6; - repeated FieldDescriptorProto extension = 7; - - optional FileOptions options = 8; - - // This field contains optional information about the original source code. - // You may safely remove this entire field without harming runtime - // functionality of the descriptors -- the information is needed only by - // development tools. - optional SourceCodeInfo source_code_info = 9; - - // The syntax of the proto file. - // The supported values are "proto2" and "proto3". - optional string syntax = 12; -} - -// Describes a message type. -message DescriptorProto { - optional string name = 1; - - repeated FieldDescriptorProto field = 2; - repeated FieldDescriptorProto extension = 6; - - repeated DescriptorProto nested_type = 3; - repeated EnumDescriptorProto enum_type = 4; - - message ExtensionRange { - optional int32 start = 1; // Inclusive. - optional int32 end = 2; // Exclusive. - - optional ExtensionRangeOptions options = 3; - } - repeated ExtensionRange extension_range = 5; - - repeated OneofDescriptorProto oneof_decl = 8; - - optional MessageOptions options = 7; - - // Range of reserved tag numbers. Reserved tag numbers may not be used by - // fields or extension ranges in the same message. Reserved ranges may - // not overlap. - message ReservedRange { - optional int32 start = 1; // Inclusive. - optional int32 end = 2; // Exclusive. - } - repeated ReservedRange reserved_range = 9; - // Reserved field names, which may not be used by fields in the same message. - // A given name may only be reserved once. - repeated string reserved_name = 10; -} - -message ExtensionRangeOptions { - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -// Describes a field within a message. -message FieldDescriptorProto { - enum Type { - // 0 is reserved for errors. - // Order is weird for historical reasons. - TYPE_DOUBLE = 1; - TYPE_FLOAT = 2; - // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if - // negative values are likely. - TYPE_INT64 = 3; - TYPE_UINT64 = 4; - // Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if - // negative values are likely. - TYPE_INT32 = 5; - TYPE_FIXED64 = 6; - TYPE_FIXED32 = 7; - TYPE_BOOL = 8; - TYPE_STRING = 9; - // Tag-delimited aggregate. - // Group type is deprecated and not supported in proto3. However, Proto3 - // implementations should still be able to parse the group wire format and - // treat group fields as unknown fields. - TYPE_GROUP = 10; - TYPE_MESSAGE = 11; // Length-delimited aggregate. - - // New in version 2. - TYPE_BYTES = 12; - TYPE_UINT32 = 13; - TYPE_ENUM = 14; - TYPE_SFIXED32 = 15; - TYPE_SFIXED64 = 16; - TYPE_SINT32 = 17; // Uses ZigZag encoding. - TYPE_SINT64 = 18; // Uses ZigZag encoding. - } - - enum Label { - // 0 is reserved for errors - LABEL_OPTIONAL = 1; - LABEL_REQUIRED = 2; - LABEL_REPEATED = 3; - } - - optional string name = 1; - optional int32 number = 3; - optional Label label = 4; - - // If type_name is set, this need not be set. If both this and type_name - // are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. - optional Type type = 5; - - // For message and enum types, this is the name of the type. If the name - // starts with a '.', it is fully-qualified. Otherwise, C++-like scoping - // rules are used to find the type (i.e. first the nested types within this - // message are searched, then within the parent, on up to the root - // namespace). - optional string type_name = 6; - - // For extensions, this is the name of the type being extended. It is - // resolved in the same manner as type_name. - optional string extendee = 2; - - // For numeric types, contains the original text representation of the value. - // For booleans, "true" or "false". - // For strings, contains the default text contents (not escaped in any way). - // For bytes, contains the C escaped value. All bytes >= 128 are escaped. - // TODO(kenton): Base-64 encode? - optional string default_value = 7; - - // If set, gives the index of a oneof in the containing type's oneof_decl - // list. This field is a member of that oneof. - optional int32 oneof_index = 9; - - // JSON name of this field. The value is set by protocol compiler. If the - // user has set a "json_name" option on this field, that option's value - // will be used. Otherwise, it's deduced from the field's name by converting - // it to camelCase. - optional string json_name = 10; - - optional FieldOptions options = 8; - - // If true, this is a proto3 "optional". When a proto3 field is optional, it - // tracks presence regardless of field type. - // - // When proto3_optional is true, this field must be belong to a oneof to - // signal to old proto3 clients that presence is tracked for this field. This - // oneof is known as a "synthetic" oneof, and this field must be its sole - // member (each proto3 optional field gets its own synthetic oneof). Synthetic - // oneofs exist in the descriptor only, and do not generate any API. Synthetic - // oneofs must be ordered after all "real" oneofs. - // - // For message fields, proto3_optional doesn't create any semantic change, - // since non-repeated message fields always track presence. However it still - // indicates the semantic detail of whether the user wrote "optional" or not. - // This can be useful for round-tripping the .proto file. For consistency we - // give message fields a synthetic oneof also, even though it is not required - // to track presence. This is especially important because the parser can't - // tell if a field is a message or an enum, so it must always create a - // synthetic oneof. - // - // Proto2 optional fields do not set this flag, because they already indicate - // optional with `LABEL_OPTIONAL`. - optional bool proto3_optional = 17; -} - -// Describes a oneof. -message OneofDescriptorProto { - optional string name = 1; - optional OneofOptions options = 2; -} - -// Describes an enum type. -message EnumDescriptorProto { - optional string name = 1; - - repeated EnumValueDescriptorProto value = 2; - - optional EnumOptions options = 3; - - // Range of reserved numeric values. Reserved values may not be used by - // entries in the same enum. Reserved ranges may not overlap. - // - // Note that this is distinct from DescriptorProto.ReservedRange in that it - // is inclusive such that it can appropriately represent the entire int32 - // domain. - message EnumReservedRange { - optional int32 start = 1; // Inclusive. - optional int32 end = 2; // Inclusive. - } - - // Range of reserved numeric values. Reserved numeric values may not be used - // by enum values in the same enum declaration. Reserved ranges may not - // overlap. - repeated EnumReservedRange reserved_range = 4; - - // Reserved enum value names, which may not be reused. A given name may only - // be reserved once. - repeated string reserved_name = 5; -} - -// Describes a value within an enum. -message EnumValueDescriptorProto { - optional string name = 1; - optional int32 number = 2; - - optional EnumValueOptions options = 3; -} - -// Describes a service. -message ServiceDescriptorProto { - optional string name = 1; - repeated MethodDescriptorProto method = 2; - - optional ServiceOptions options = 3; -} - -// Describes a method of a service. -message MethodDescriptorProto { - optional string name = 1; - - // Input and output type names. These are resolved in the same way as - // FieldDescriptorProto.type_name, but must refer to a message type. - optional string input_type = 2; - optional string output_type = 3; - - optional MethodOptions options = 4; - - // Identifies if client streams multiple client messages - optional bool client_streaming = 5 [default = false]; - // Identifies if server streams multiple server messages - optional bool server_streaming = 6 [default = false]; -} - - -// =================================================================== -// Options - -// Each of the definitions above may have "options" attached. These are -// just annotations which may cause code to be generated slightly differently -// or may contain hints for code that manipulates protocol messages. -// -// Clients may define custom options as extensions of the *Options messages. -// These extensions may not yet be known at parsing time, so the parser cannot -// store the values in them. Instead it stores them in a field in the *Options -// message called uninterpreted_option. This field must have the same name -// across all *Options messages. We then use this field to populate the -// extensions when we build a descriptor, at which point all protos have been -// parsed and so all extensions are known. -// -// Extension numbers for custom options may be chosen as follows: -// * For options which will only be used within a single application or -// organization, or for experimental options, use field numbers 50000 -// through 99999. It is up to you to ensure that you do not use the -// same number for multiple options. -// * For options which will be published and used publicly by multiple -// independent entities, e-mail protobuf-global-extension-registry@google.com -// to reserve extension numbers. Simply provide your project name (e.g. -// Objective-C plugin) and your project website (if available) -- there's no -// need to explain how you intend to use them. Usually you only need one -// extension number. You can declare multiple options with only one extension -// number by putting them in a sub-message. See the Custom Options section of -// the docs for examples: -// https://developers.google.com/protocol-buffers/docs/proto#options -// If this turns out to be popular, a web service will be set up -// to automatically assign option numbers. - -message FileOptions { - - // Sets the Java package where classes generated from this .proto will be - // placed. By default, the proto package is used, but this is often - // inappropriate because proto packages do not normally start with backwards - // domain names. - optional string java_package = 1; - - - // Controls the name of the wrapper Java class generated for the .proto file. - // That class will always contain the .proto file's getDescriptor() method as - // well as any top-level extensions defined in the .proto file. - // If java_multiple_files is disabled, then all the other classes from the - // .proto file will be nested inside the single wrapper outer class. - optional string java_outer_classname = 8; - - // If enabled, then the Java code generator will generate a separate .java - // file for each top-level message, enum, and service defined in the .proto - // file. Thus, these types will *not* be nested inside the wrapper class - // named by java_outer_classname. However, the wrapper class will still be - // generated to contain the file's getDescriptor() method as well as any - // top-level extensions defined in the file. - optional bool java_multiple_files = 10 [default = false]; - - // This option does nothing. - optional bool java_generate_equals_and_hash = 20 [deprecated=true]; - - // If set true, then the Java2 code generator will generate code that - // throws an exception whenever an attempt is made to assign a non-UTF-8 - // byte sequence to a string field. - // Message reflection will do the same. - // However, an extension field still accepts non-UTF-8 byte sequences. - // This option has no effect on when used with the lite runtime. - optional bool java_string_check_utf8 = 27 [default = false]; - - - // Generated classes can be optimized for speed or code size. - enum OptimizeMode { - SPEED = 1; // Generate complete code for parsing, serialization, - // etc. - CODE_SIZE = 2; // Use ReflectionOps to implement these methods. - LITE_RUNTIME = 3; // Generate code using MessageLite and the lite runtime. - } - optional OptimizeMode optimize_for = 9 [default = SPEED]; - - // Sets the Go package where structs generated from this .proto will be - // placed. If omitted, the Go package will be derived from the following: - // - The basename of the package import path, if provided. - // - Otherwise, the package statement in the .proto file, if present. - // - Otherwise, the basename of the .proto file, without extension. - optional string go_package = 11; - - - - - // Should generic services be generated in each language? "Generic" services - // are not specific to any particular RPC system. They are generated by the - // main code generators in each language (without additional plugins). - // Generic services were the only kind of service generation supported by - // early versions of google.protobuf. - // - // Generic services are now considered deprecated in favor of using plugins - // that generate code specific to your particular RPC system. Therefore, - // these default to false. Old code which depends on generic services should - // explicitly set them to true. - optional bool cc_generic_services = 16 [default = false]; - optional bool java_generic_services = 17 [default = false]; - optional bool py_generic_services = 18 [default = false]; - optional bool php_generic_services = 42 [default = false]; - - // Is this file deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for everything in the file, or it will be completely ignored; in the very - // least, this is a formalization for deprecating files. - optional bool deprecated = 23 [default = false]; - - // Enables the use of arenas for the proto messages in this file. This applies - // only to generated classes for C++. - optional bool cc_enable_arenas = 31 [default = true]; - - - // Sets the objective c class prefix which is prepended to all objective c - // generated classes from this .proto. There is no default. - optional string objc_class_prefix = 36; - - // Namespace for generated classes; defaults to the package. - optional string csharp_namespace = 37; - - // By default Swift generators will take the proto package and CamelCase it - // replacing '.' with underscore and use that to prefix the types/symbols - // defined. When this options is provided, they will use this value instead - // to prefix the types/symbols defined. - optional string swift_prefix = 39; - - // Sets the php class prefix which is prepended to all php generated classes - // from this .proto. Default is empty. - optional string php_class_prefix = 40; - - // Use this option to change the namespace of php generated classes. Default - // is empty. When this option is empty, the package name will be used for - // determining the namespace. - optional string php_namespace = 41; - - // Use this option to change the namespace of php generated metadata classes. - // Default is empty. When this option is empty, the proto file name will be - // used for determining the namespace. - optional string php_metadata_namespace = 44; - - // Use this option to change the package of ruby generated classes. Default - // is empty. When this option is not set, the package name will be used for - // determining the ruby package. - optional string ruby_package = 45; - - - // The parser stores options it doesn't recognize here. - // See the documentation for the "Options" section above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. - // See the documentation for the "Options" section above. - extensions 1000 to max; - - reserved 38; -} - -message MessageOptions { - // Set true to use the old proto1 MessageSet wire format for extensions. - // This is provided for backwards-compatibility with the MessageSet wire - // format. You should not use this for any other reason: It's less - // efficient, has fewer features, and is more complicated. - // - // The message must be defined exactly as follows: - // message Foo { - // option message_set_wire_format = true; - // extensions 4 to max; - // } - // Note that the message cannot have any defined fields; MessageSets only - // have extensions. - // - // All extensions of your type must be singular messages; e.g. they cannot - // be int32s, enums, or repeated messages. - // - // Because this is an option, the above two restrictions are not enforced by - // the protocol compiler. - optional bool message_set_wire_format = 1 [default = false]; - - // Disables the generation of the standard "descriptor()" accessor, which can - // conflict with a field of the same name. This is meant to make migration - // from proto1 easier; new code should avoid fields named "descriptor". - optional bool no_standard_descriptor_accessor = 2 [default = false]; - - // Is this message deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the message, or it will be completely ignored; in the very least, - // this is a formalization for deprecating messages. - optional bool deprecated = 3 [default = false]; - - reserved 4, 5, 6; - - // Whether the message is an automatically generated map entry type for the - // maps field. - // - // For maps fields: - // map map_field = 1; - // The parsed descriptor looks like: - // message MapFieldEntry { - // option map_entry = true; - // optional KeyType key = 1; - // optional ValueType value = 2; - // } - // repeated MapFieldEntry map_field = 1; - // - // Implementations may choose not to generate the map_entry=true message, but - // use a native map in the target language to hold the keys and values. - // The reflection APIs in such implementations still need to work as - // if the field is a repeated message field. - // - // NOTE: Do not set the option in .proto files. Always use the maps syntax - // instead. The option should only be implicitly set by the proto compiler - // parser. - optional bool map_entry = 7; - - reserved 8; // javalite_serializable - reserved 9; // javanano_as_lite - - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message FieldOptions { - // The ctype option instructs the C++ code generator to use a different - // representation of the field than it normally would. See the specific - // options below. This option is not yet implemented in the open source - // release -- sorry, we'll try to include it in a future version! - optional CType ctype = 1 [default = STRING]; - enum CType { - // Default mode. - STRING = 0; - - CORD = 1; - - STRING_PIECE = 2; - } - // The packed option can be enabled for repeated primitive fields to enable - // a more efficient representation on the wire. Rather than repeatedly - // writing the tag and type for each element, the entire array is encoded as - // a single length-delimited blob. In proto3, only explicit setting it to - // false will avoid using packed encoding. - optional bool packed = 2; - - // The jstype option determines the JavaScript type used for values of the - // field. The option is permitted only for 64 bit integral and fixed types - // (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING - // is represented as JavaScript string, which avoids loss of precision that - // can happen when a large value is converted to a floating point JavaScript. - // Specifying JS_NUMBER for the jstype causes the generated JavaScript code to - // use the JavaScript "number" type. The behavior of the default option - // JS_NORMAL is implementation dependent. - // - // This option is an enum to permit additional types to be added, e.g. - // goog.math.Integer. - optional JSType jstype = 6 [default = JS_NORMAL]; - enum JSType { - // Use the default type. - JS_NORMAL = 0; - - // Use JavaScript strings. - JS_STRING = 1; - - // Use JavaScript numbers. - JS_NUMBER = 2; - } - - // Should this field be parsed lazily? Lazy applies only to message-type - // fields. It means that when the outer message is initially parsed, the - // inner message's contents will not be parsed but instead stored in encoded - // form. The inner message will actually be parsed when it is first accessed. - // - // This is only a hint. Implementations are free to choose whether to use - // eager or lazy parsing regardless of the value of this option. However, - // setting this option true suggests that the protocol author believes that - // using lazy parsing on this field is worth the additional bookkeeping - // overhead typically needed to implement it. - // - // This option does not affect the public interface of any generated code; - // all method signatures remain the same. Furthermore, thread-safety of the - // interface is not affected by this option; const methods remain safe to - // call from multiple threads concurrently, while non-const methods continue - // to require exclusive access. - // - // - // Note that implementations may choose not to check required fields within - // a lazy sub-message. That is, calling IsInitialized() on the outer message - // may return true even if the inner message has missing required fields. - // This is necessary because otherwise the inner message would have to be - // parsed in order to perform the check, defeating the purpose of lazy - // parsing. An implementation which chooses not to check required fields - // must be consistent about it. That is, for any particular sub-message, the - // implementation must either *always* check its required fields, or *never* - // check its required fields, regardless of whether or not the message has - // been parsed. - optional bool lazy = 5 [default = false]; - - // Is this field deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for accessors, or it will be completely ignored; in the very least, this - // is a formalization for deprecating fields. - optional bool deprecated = 3 [default = false]; - - // For Google-internal migration only. Do not use. - optional bool weak = 10 [default = false]; - - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; - - reserved 4; // removed jtype -} - -message OneofOptions { - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message EnumOptions { - - // Set this option to true to allow mapping different tag names to the same - // value. - optional bool allow_alias = 2; - - // Is this enum deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the enum, or it will be completely ignored; in the very least, this - // is a formalization for deprecating enums. - optional bool deprecated = 3 [default = false]; - - reserved 5; // javanano_as_lite - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message EnumValueOptions { - // Is this enum value deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the enum value, or it will be completely ignored; in the very least, - // this is a formalization for deprecating enum values. - optional bool deprecated = 1 [default = false]; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message ServiceOptions { - - // Note: Field numbers 1 through 32 are reserved for Google's internal RPC - // framework. We apologize for hoarding these numbers to ourselves, but - // we were already using them long before we decided to release Protocol - // Buffers. - - // Is this service deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the service, or it will be completely ignored; in the very least, - // this is a formalization for deprecating services. - optional bool deprecated = 33 [default = false]; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - -message MethodOptions { - - // Note: Field numbers 1 through 32 are reserved for Google's internal RPC - // framework. We apologize for hoarding these numbers to ourselves, but - // we were already using them long before we decided to release Protocol - // Buffers. - - // Is this method deprecated? - // Depending on the target platform, this can emit Deprecated annotations - // for the method, or it will be completely ignored; in the very least, - // this is a formalization for deprecating methods. - optional bool deprecated = 33 [default = false]; - - // Is this method side-effect-free (or safe in HTTP parlance), or idempotent, - // or neither? HTTP based RPC implementation may choose GET verb for safe - // methods, and PUT verb for idempotent methods instead of the default POST. - enum IdempotencyLevel { - IDEMPOTENCY_UNKNOWN = 0; - NO_SIDE_EFFECTS = 1; // implies idempotent - IDEMPOTENT = 2; // idempotent, but may have side effects - } - optional IdempotencyLevel idempotency_level = 34 - [default = IDEMPOTENCY_UNKNOWN]; - - // The parser stores options it doesn't recognize here. See above. - repeated UninterpretedOption uninterpreted_option = 999; - - // Clients can define custom options in extensions of this message. See above. - extensions 1000 to max; -} - - -// A message representing a option the parser does not recognize. This only -// appears in options protos created by the compiler::Parser class. -// DescriptorPool resolves these when building Descriptor objects. Therefore, -// options protos in descriptor objects (e.g. returned by Descriptor::options(), -// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions -// in them. -message UninterpretedOption { - // The name of the uninterpreted option. Each string represents a segment in - // a dot-separated name. is_extension is true iff a segment represents an - // extension (denoted with parentheses in options specs in .proto files). - // E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents - // "foo.(bar.baz).qux". - message NamePart { - required string name_part = 1; - required bool is_extension = 2; - } - repeated NamePart name = 2; - - // The value of the uninterpreted option, in whatever type the tokenizer - // identified it as during parsing. Exactly one of these should be set. - optional string identifier_value = 3; - optional uint64 positive_int_value = 4; - optional int64 negative_int_value = 5; - optional double double_value = 6; - optional bytes string_value = 7; - optional string aggregate_value = 8; -} - -// =================================================================== -// Optional source code info - -// Encapsulates information about the original source file from which a -// FileDescriptorProto was generated. -message SourceCodeInfo { - // A Location identifies a piece of source code in a .proto file which - // corresponds to a particular definition. This information is intended - // to be useful to IDEs, code indexers, documentation generators, and similar - // tools. - // - // For example, say we have a file like: - // message Foo { - // optional string foo = 1; - // } - // Let's look at just the field definition: - // optional string foo = 1; - // ^ ^^ ^^ ^ ^^^ - // a bc de f ghi - // We have the following locations: - // span path represents - // [a,i) [ 4, 0, 2, 0 ] The whole field definition. - // [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). - // [c,d) [ 4, 0, 2, 0, 5 ] The type (string). - // [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). - // [g,h) [ 4, 0, 2, 0, 3 ] The number (1). - // - // Notes: - // - A location may refer to a repeated field itself (i.e. not to any - // particular index within it). This is used whenever a set of elements are - // logically enclosed in a single code segment. For example, an entire - // extend block (possibly containing multiple extension definitions) will - // have an outer location whose path refers to the "extensions" repeated - // field without an index. - // - Multiple locations may have the same path. This happens when a single - // logical declaration is spread out across multiple places. The most - // obvious example is the "extend" block again -- there may be multiple - // extend blocks in the same scope, each of which will have the same path. - // - A location's span is not always a subset of its parent's span. For - // example, the "extendee" of an extension declaration appears at the - // beginning of the "extend" block and is shared by all extensions within - // the block. - // - Just because a location's span is a subset of some other location's span - // does not mean that it is a descendant. For example, a "group" defines - // both a type and a field in a single declaration. Thus, the locations - // corresponding to the type and field and their components will overlap. - // - Code which tries to interpret locations should probably be designed to - // ignore those that it doesn't understand, as more types of locations could - // be recorded in the future. - repeated Location location = 1; - message Location { - // Identifies which part of the FileDescriptorProto was defined at this - // location. - // - // Each element is a field number or an index. They form a path from - // the root FileDescriptorProto to the place where the definition occurs. For - // example, this path: - // [ 4, 3, 2, 7, 1 ] - // refers to: - // file.message_type(3) // 4, 3 - // .field(7) // 2, 7 - // .name() // 1 - // This is because FileDescriptorProto.message_type has field number 4: - // repeated DescriptorProto message_type = 4; - // and DescriptorProto.field has field number 2: - // repeated FieldDescriptorProto field = 2; - // and FieldDescriptorProto.name has field number 1: - // optional string name = 1; - // - // Thus, the above path gives the location of a field name. If we removed - // the last element: - // [ 4, 3, 2, 7 ] - // this path refers to the whole field declaration (from the beginning - // of the label to the terminating semicolon). - repeated int32 path = 1 [packed = true]; - - // Always has exactly three or four elements: start line, start column, - // end line (optional, otherwise assumed same as start line), end column. - // These are packed into a single field for efficiency. Note that line - // and column numbers are zero-based -- typically you will want to add - // 1 to each before displaying to a user. - repeated int32 span = 2 [packed = true]; - - // If this SourceCodeInfo represents a complete declaration, these are any - // comments appearing before and after the declaration which appear to be - // attached to the declaration. - // - // A series of line comments appearing on consecutive lines, with no other - // tokens appearing on those lines, will be treated as a single comment. - // - // leading_detached_comments will keep paragraphs of comments that appear - // before (but not connected to) the current element. Each paragraph, - // separated by empty lines, will be one comment element in the repeated - // field. - // - // Only the comment content is provided; comment markers (e.g. //) are - // stripped out. For block comments, leading whitespace and an asterisk - // will be stripped from the beginning of each line other than the first. - // Newlines are included in the output. - // - // Examples: - // - // optional int32 foo = 1; // Comment attached to foo. - // // Comment attached to bar. - // optional int32 bar = 2; - // - // optional string baz = 3; - // // Comment attached to baz. - // // Another line attached to baz. - // - // // Comment attached to qux. - // // - // // Another line attached to qux. - // optional double qux = 4; - // - // // Detached comment for corge. This is not leading or trailing comments - // // to qux or corge because there are blank lines separating it from - // // both. - // - // // Detached comment for corge paragraph 2. - // - // optional string corge = 5; - // /* Block comment attached - // * to corge. Leading asterisks - // * will be removed. */ - // /* Block comment attached to - // * grault. */ - // optional int32 grault = 6; - // - // // ignored detached comments. - optional string leading_comments = 3; - optional string trailing_comments = 4; - repeated string leading_detached_comments = 6; - } -} - -// Describes the relationship between generated code and its original source -// file. A GeneratedCodeInfo message is associated with only one generated -// source file, but may contain references to different source .proto files. -message GeneratedCodeInfo { - // An Annotation connects some span of text in generated code to an element - // of its generating .proto file. - repeated Annotation annotation = 1; - message Annotation { - // Identifies the element in the original source .proto file. This field - // is formatted the same as SourceCodeInfo.Location.path. - repeated int32 path = 1 [packed = true]; - - // Identifies the filesystem path to the original source .proto. - optional string source_file = 2; - - // Identifies the starting offset in bytes in the generated code - // that relates to the identified object. - optional int32 begin = 3; - - // Identifies the ending offset in bytes in the generated code that - // relates to the identified offset. The end offset should be one past - // the last relevant byte (so the length of the text = end - begin). - optional int32 end = 4; - } -} diff --git a/protoc-gen-go-crud/pkg/third_party/protos/google/protobuf/duration.proto b/protoc-gen-go-crud/pkg/third_party/protos/google/protobuf/duration.proto deleted file mode 100644 index 81c3e36..0000000 --- a/protoc-gen-go-crud/pkg/third_party/protos/google/protobuf/duration.proto +++ /dev/null @@ -1,116 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; - -package google.protobuf; - -option csharp_namespace = "Google.Protobuf.WellKnownTypes"; -option cc_enable_arenas = true; -option go_package = "google.golang.org/protobuf/types/known/durationpb"; -option java_package = "com.google.protobuf"; -option java_outer_classname = "DurationProto"; -option java_multiple_files = true; -option objc_class_prefix = "GPB"; - -// A Duration represents a signed, fixed-length span of time represented -// as a count of seconds and fractions of seconds at nanosecond -// resolution. It is independent of any calendar and concepts like "day" -// or "month". It is related to Timestamp in that the difference between -// two Timestamp values is a Duration and it can be added or subtracted -// from a Timestamp. Range is approximately +-10,000 years. -// -// # Examples -// -// Example 1: Compute Duration from two Timestamps in pseudo code. -// -// Timestamp start = ...; -// Timestamp end = ...; -// Duration duration = ...; -// -// duration.seconds = end.seconds - start.seconds; -// duration.nanos = end.nanos - start.nanos; -// -// if (duration.seconds < 0 && duration.nanos > 0) { -// duration.seconds += 1; -// duration.nanos -= 1000000000; -// } else if (duration.seconds > 0 && duration.nanos < 0) { -// duration.seconds -= 1; -// duration.nanos += 1000000000; -// } -// -// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code. -// -// Timestamp start = ...; -// Duration duration = ...; -// Timestamp end = ...; -// -// end.seconds = start.seconds + duration.seconds; -// end.nanos = start.nanos + duration.nanos; -// -// if (end.nanos < 0) { -// end.seconds -= 1; -// end.nanos += 1000000000; -// } else if (end.nanos >= 1000000000) { -// end.seconds += 1; -// end.nanos -= 1000000000; -// } -// -// Example 3: Compute Duration from datetime.timedelta in Python. -// -// td = datetime.timedelta(days=3, minutes=10) -// duration = Duration() -// duration.FromTimedelta(td) -// -// # JSON Mapping -// -// In JSON format, the Duration type is encoded as a string rather than an -// object, where the string ends in the suffix "s" (indicating seconds) and -// is preceded by the number of seconds, with nanoseconds expressed as -// fractional seconds. For example, 3 seconds with 0 nanoseconds should be -// encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should -// be expressed in JSON format as "3.000000001s", and 3 seconds and 1 -// microsecond should be expressed in JSON format as "3.000001s". -// -// -message Duration { - // Signed seconds of the span of time. Must be from -315,576,000,000 - // to +315,576,000,000 inclusive. Note: these bounds are computed from: - // 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years - int64 seconds = 1; - - // Signed fractions of a second at nanosecond resolution of the span - // of time. Durations less than one second are represented with a 0 - // `seconds` field and a positive or negative `nanos` field. For durations - // of one second or more, a non-zero value for the `nanos` field must be - // of the same sign as the `seconds` field. Must be from -999,999,999 - // to +999,999,999 inclusive. - int32 nanos = 2; -} diff --git a/protoc-gen-go-crud/pkg/third_party/protos/google/protobuf/empty.proto b/protoc-gen-go-crud/pkg/third_party/protos/google/protobuf/empty.proto deleted file mode 100644 index 03cacd2..0000000 --- a/protoc-gen-go-crud/pkg/third_party/protos/google/protobuf/empty.proto +++ /dev/null @@ -1,52 +0,0 @@ -// Protocol Buffers - Google's data interchange format -// Copyright 2008 Google Inc. All rights reserved. -// https://developers.google.com/protocol-buffers/ -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto3"; - -package google.protobuf; - -option csharp_namespace = "Google.Protobuf.WellKnownTypes"; -option go_package = "github.com/golang/protobuf/ptypes/empty"; -option java_package = "com.google.protobuf"; -option java_outer_classname = "EmptyProto"; -option java_multiple_files = true; -option objc_class_prefix = "GPB"; -option cc_enable_arenas = true; - -// A generic empty message that you can re-use to avoid defining duplicated -// empty messages in your APIs. A typical example is to use it as the request -// or the response type of an API method. For instance: -// -// service Foo { -// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); -// } -// -// The JSON representation for `Empty` is empty JSON object `{}`. -message Empty {} diff --git a/protoc-gen-go-crud/pkg/third_party/protos/protoc-gen-openapiv2/options/annotations.proto b/protoc-gen-go-crud/pkg/third_party/protos/protoc-gen-openapiv2/options/annotations.proto deleted file mode 100644 index 9d4f4c9..0000000 --- a/protoc-gen-go-crud/pkg/third_party/protos/protoc-gen-openapiv2/options/annotations.proto +++ /dev/null @@ -1,44 +0,0 @@ -syntax = "proto3"; - -package grpc.gateway.protoc_gen_openapiv2.options; - -import "google/protobuf/descriptor.proto"; -import "protoc-gen-openapiv2/options/openapiv2.proto"; - -option go_package = "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"; - -extend google.protobuf.FileOptions { - // ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. - // - // All IDs are the same, as assigned. It is okay that they are the same, as they extend - // different descriptor messages. - Swagger openapiv2_swagger = 1042; -} -extend google.protobuf.MethodOptions { - // ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. - // - // All IDs are the same, as assigned. It is okay that they are the same, as they extend - // different descriptor messages. - Operation openapiv2_operation = 1042; -} -extend google.protobuf.MessageOptions { - // ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. - // - // All IDs are the same, as assigned. It is okay that they are the same, as they extend - // different descriptor messages. - Schema openapiv2_schema = 1042; -} -extend google.protobuf.ServiceOptions { - // ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. - // - // All IDs are the same, as assigned. It is okay that they are the same, as they extend - // different descriptor messages. - Tag openapiv2_tag = 1042; -} -extend google.protobuf.FieldOptions { - // ID assigned by protobuf-global-extension-registry@google.com for gRPC-Gateway project. - // - // All IDs are the same, as assigned. It is okay that they are the same, as they extend - // different descriptor messages. - JSONSchema openapiv2_field = 1042; -} \ No newline at end of file diff --git a/protoc-gen-go-crud/pkg/third_party/protos/protoc-gen-openapiv2/options/openapiv2.proto b/protoc-gen-go-crud/pkg/third_party/protos/protoc-gen-openapiv2/options/openapiv2.proto deleted file mode 100644 index c9aae5c..0000000 --- a/protoc-gen-go-crud/pkg/third_party/protos/protoc-gen-openapiv2/options/openapiv2.proto +++ /dev/null @@ -1,720 +0,0 @@ -syntax = "proto3"; - -package grpc.gateway.protoc_gen_openapiv2.options; - -import "google/protobuf/struct.proto"; - -option go_package = "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"; - -// Scheme describes the schemes supported by the OpenAPI Swagger -// and Operation objects. -enum Scheme { - UNKNOWN = 0; - HTTP = 1; - HTTPS = 2; - WS = 3; - WSS = 4; -} - -// `Swagger` is a representation of OpenAPI v2 specification's Swagger object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#swaggerObject -// -// Example: -// -// option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { -// info: { -// title: "Echo API"; -// version: "1.0"; -// description: ""; -// contact: { -// name: "gRPC-Gateway project"; -// url: "https://github.com/grpc-ecosystem/grpc-gateway"; -// email: "none@example.com"; -// }; -// license: { -// name: "BSD 3-Clause License"; -// url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/main/LICENSE.txt"; -// }; -// }; -// schemes: HTTPS; -// consumes: "application/json"; -// produces: "application/json"; -// }; -// -message Swagger { - // Specifies the OpenAPI Specification version being used. It can be - // used by the OpenAPI UI and other clients to interpret the API listing. The - // value MUST be "2.0". - string swagger = 1; - // Provides metadata about the API. The metadata can be used by the - // clients if needed. - Info info = 2; - // The host (name or ip) serving the API. This MUST be the host only and does - // not include the scheme nor sub-paths. It MAY include a port. If the host is - // not included, the host serving the documentation is to be used (including - // the port). The host does not support path templating. - string host = 3; - // The base path on which the API is served, which is relative to the host. If - // it is not included, the API is served directly under the host. The value - // MUST start with a leading slash (/). The basePath does not support path - // templating. - // Note that using `base_path` does not change the endpoint paths that are - // generated in the resulting OpenAPI file. If you wish to use `base_path` - // with relatively generated OpenAPI paths, the `base_path` prefix must be - // manually removed from your `google.api.http` paths and your code changed to - // serve the API from the `base_path`. - string base_path = 4; - // The transfer protocol of the API. Values MUST be from the list: "http", - // "https", "ws", "wss". If the schemes is not included, the default scheme to - // be used is the one used to access the OpenAPI definition itself. - repeated Scheme schemes = 5; - // A list of MIME types the APIs can consume. This is global to all APIs but - // can be overridden on specific API calls. Value MUST be as described under - // Mime Types. - repeated string consumes = 6; - // A list of MIME types the APIs can produce. This is global to all APIs but - // can be overridden on specific API calls. Value MUST be as described under - // Mime Types. - repeated string produces = 7; - // field 8 is reserved for 'paths'. - reserved 8; - // field 9 is reserved for 'definitions', which at this time are already - // exposed as and customizable as proto messages. - reserved 9; - // An object to hold responses that can be used across operations. This - // property does not define global responses for all operations. - map responses = 10; - // Security scheme definitions that can be used across the specification. - SecurityDefinitions security_definitions = 11; - // A declaration of which security schemes are applied for the API as a whole. - // The list of values describes alternative security schemes that can be used - // (that is, there is a logical OR between the security requirements). - // Individual operations can override this definition. - repeated SecurityRequirement security = 12; - // A list of tags for API documentation control. Tags can be used for logical - // grouping of operations by resources or any other qualifier. - repeated Tag tags = 13; - // Additional external documentation. - ExternalDocumentation external_docs = 14; - // Custom properties that start with "x-" such as "x-foo" used to describe - // extra functionality that is not covered by the standard OpenAPI Specification. - // See: https://swagger.io/docs/specification/2-0/swagger-extensions/ - map extensions = 15; -} - -// `Operation` is a representation of OpenAPI v2 specification's Operation object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#operationObject -// -// Example: -// -// service EchoService { -// rpc Echo(SimpleMessage) returns (SimpleMessage) { -// option (google.api.http) = { -// get: "/v1/example/echo/{id}" -// }; -// -// option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { -// summary: "Get a message."; -// operation_id: "getMessage"; -// tags: "echo"; -// responses: { -// key: "200" -// value: { -// description: "OK"; -// } -// } -// }; -// } -// } -message Operation { - // A list of tags for API documentation control. Tags can be used for logical - // grouping of operations by resources or any other qualifier. - repeated string tags = 1; - // A short summary of what the operation does. For maximum readability in the - // swagger-ui, this field SHOULD be less than 120 characters. - string summary = 2; - // A verbose explanation of the operation behavior. GFM syntax can be used for - // rich text representation. - string description = 3; - // Additional external documentation for this operation. - ExternalDocumentation external_docs = 4; - // Unique string used to identify the operation. The id MUST be unique among - // all operations described in the API. Tools and libraries MAY use the - // operationId to uniquely identify an operation, therefore, it is recommended - // to follow common programming naming conventions. - string operation_id = 5; - // A list of MIME types the operation can consume. This overrides the consumes - // definition at the OpenAPI Object. An empty value MAY be used to clear the - // global definition. Value MUST be as described under Mime Types. - repeated string consumes = 6; - // A list of MIME types the operation can produce. This overrides the produces - // definition at the OpenAPI Object. An empty value MAY be used to clear the - // global definition. Value MUST be as described under Mime Types. - repeated string produces = 7; - // field 8 is reserved for 'parameters'. - reserved 8; - // The list of possible responses as they are returned from executing this - // operation. - map responses = 9; - // The transfer protocol for the operation. Values MUST be from the list: - // "http", "https", "ws", "wss". The value overrides the OpenAPI Object - // schemes definition. - repeated Scheme schemes = 10; - // Declares this operation to be deprecated. Usage of the declared operation - // should be refrained. Default value is false. - bool deprecated = 11; - // A declaration of which security schemes are applied for this operation. The - // list of values describes alternative security schemes that can be used - // (that is, there is a logical OR between the security requirements). This - // definition overrides any declared top-level security. To remove a top-level - // security declaration, an empty array can be used. - repeated SecurityRequirement security = 12; - // Custom properties that start with "x-" such as "x-foo" used to describe - // extra functionality that is not covered by the standard OpenAPI Specification. - // See: https://swagger.io/docs/specification/2-0/swagger-extensions/ - map extensions = 13; - // Custom parameters such as HTTP request headers. - // See: https://swagger.io/docs/specification/2-0/describing-parameters/ - // and https://swagger.io/specification/v2/#parameter-object. - Parameters parameters = 14; -} - -// `Parameters` is a representation of OpenAPI v2 specification's parameters object. -// Note: This technically breaks compatibility with the OpenAPI 2 definition structure as we only -// allow header parameters to be set here since we do not want users specifying custom non-header -// parameters beyond those inferred from the Protobuf schema. -// See: https://swagger.io/specification/v2/#parameter-object -message Parameters { - // `Headers` is one or more HTTP header parameter. - // See: https://swagger.io/docs/specification/2-0/describing-parameters/#header-parameters - repeated HeaderParameter headers = 1; -} - -// `HeaderParameter` a HTTP header parameter. -// See: https://swagger.io/specification/v2/#parameter-object -message HeaderParameter { - // `Type` is a a supported HTTP header type. - // See https://swagger.io/specification/v2/#parameterType. - enum Type { - UNKNOWN = 0; - STRING = 1; - NUMBER = 2; - INTEGER = 3; - BOOLEAN = 4; - } - - // `Name` is the header name. - string name = 1; - // `Description` is a short description of the header. - string description = 2; - // `Type` is the type of the object. The value MUST be one of "string", "number", "integer", or "boolean". The "array" type is not supported. - // See: https://swagger.io/specification/v2/#parameterType. - Type type = 3; - // `Format` The extending format for the previously mentioned type. - string format = 4; - // `Required` indicates if the header is optional - bool required = 5; - // field 6 is reserved for 'items', but in OpenAPI-specific way. - reserved 6; - // field 7 is reserved `Collection Format`. Determines the format of the array if type array is used. - reserved 7; -} - -// `Header` is a representation of OpenAPI v2 specification's Header object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#headerObject -// -message Header { - // `Description` is a short description of the header. - string description = 1; - // The type of the object. The value MUST be one of "string", "number", "integer", or "boolean". The "array" type is not supported. - string type = 2; - // `Format` The extending format for the previously mentioned type. - string format = 3; - // field 4 is reserved for 'items', but in OpenAPI-specific way. - reserved 4; - // field 5 is reserved `Collection Format` Determines the format of the array if type array is used. - reserved 5; - // `Default` Declares the value of the header that the server will use if none is provided. - // See: https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-6.2. - // Unlike JSON Schema this value MUST conform to the defined type for the header. - string default = 6; - // field 7 is reserved for 'maximum'. - reserved 7; - // field 8 is reserved for 'exclusiveMaximum'. - reserved 8; - // field 9 is reserved for 'minimum'. - reserved 9; - // field 10 is reserved for 'exclusiveMinimum'. - reserved 10; - // field 11 is reserved for 'maxLength'. - reserved 11; - // field 12 is reserved for 'minLength'. - reserved 12; - // 'Pattern' See https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.2.3. - string pattern = 13; - // field 14 is reserved for 'maxItems'. - reserved 14; - // field 15 is reserved for 'minItems'. - reserved 15; - // field 16 is reserved for 'uniqueItems'. - reserved 16; - // field 17 is reserved for 'enum'. - reserved 17; - // field 18 is reserved for 'multipleOf'. - reserved 18; -} - -// `Response` is a representation of OpenAPI v2 specification's Response object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#responseObject -// -message Response { - // `Description` is a short description of the response. - // GFM syntax can be used for rich text representation. - string description = 1; - // `Schema` optionally defines the structure of the response. - // If `Schema` is not provided, it means there is no content to the response. - Schema schema = 2; - // `Headers` A list of headers that are sent with the response. - // `Header` name is expected to be a string in the canonical format of the MIME header key - // See: https://golang.org/pkg/net/textproto/#CanonicalMIMEHeaderKey - map headers = 3; - // `Examples` gives per-mimetype response examples. - // See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#example-object - map examples = 4; - // Custom properties that start with "x-" such as "x-foo" used to describe - // extra functionality that is not covered by the standard OpenAPI Specification. - // See: https://swagger.io/docs/specification/2-0/swagger-extensions/ - map extensions = 5; -} - -// `Info` is a representation of OpenAPI v2 specification's Info object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#infoObject -// -// Example: -// -// option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { -// info: { -// title: "Echo API"; -// version: "1.0"; -// description: ""; -// contact: { -// name: "gRPC-Gateway project"; -// url: "https://github.com/grpc-ecosystem/grpc-gateway"; -// email: "none@example.com"; -// }; -// license: { -// name: "BSD 3-Clause License"; -// url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/main/LICENSE.txt"; -// }; -// }; -// ... -// }; -// -message Info { - // The title of the application. - string title = 1; - // A short description of the application. GFM syntax can be used for rich - // text representation. - string description = 2; - // The Terms of Service for the API. - string terms_of_service = 3; - // The contact information for the exposed API. - Contact contact = 4; - // The license information for the exposed API. - License license = 5; - // Provides the version of the application API (not to be confused - // with the specification version). - string version = 6; - // Custom properties that start with "x-" such as "x-foo" used to describe - // extra functionality that is not covered by the standard OpenAPI Specification. - // See: https://swagger.io/docs/specification/2-0/swagger-extensions/ - map extensions = 7; -} - -// `Contact` is a representation of OpenAPI v2 specification's Contact object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#contactObject -// -// Example: -// -// option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { -// info: { -// ... -// contact: { -// name: "gRPC-Gateway project"; -// url: "https://github.com/grpc-ecosystem/grpc-gateway"; -// email: "none@example.com"; -// }; -// ... -// }; -// ... -// }; -// -message Contact { - // The identifying name of the contact person/organization. - string name = 1; - // The URL pointing to the contact information. MUST be in the format of a - // URL. - string url = 2; - // The email address of the contact person/organization. MUST be in the format - // of an email address. - string email = 3; -} - -// `License` is a representation of OpenAPI v2 specification's License object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#licenseObject -// -// Example: -// -// option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { -// info: { -// ... -// license: { -// name: "BSD 3-Clause License"; -// url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/main/LICENSE.txt"; -// }; -// ... -// }; -// ... -// }; -// -message License { - // The license name used for the API. - string name = 1; - // A URL to the license used for the API. MUST be in the format of a URL. - string url = 2; -} - -// `ExternalDocumentation` is a representation of OpenAPI v2 specification's -// ExternalDocumentation object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#externalDocumentationObject -// -// Example: -// -// option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { -// ... -// external_docs: { -// description: "More about gRPC-Gateway"; -// url: "https://github.com/grpc-ecosystem/grpc-gateway"; -// } -// ... -// }; -// -message ExternalDocumentation { - // A short description of the target documentation. GFM syntax can be used for - // rich text representation. - string description = 1; - // The URL for the target documentation. Value MUST be in the format - // of a URL. - string url = 2; -} - -// `Schema` is a representation of OpenAPI v2 specification's Schema object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject -// -message Schema { - JSONSchema json_schema = 1; - // Adds support for polymorphism. The discriminator is the schema property - // name that is used to differentiate between other schema that inherit this - // schema. The property name used MUST be defined at this schema and it MUST - // be in the required property list. When used, the value MUST be the name of - // this schema or any schema that inherits it. - string discriminator = 2; - // Relevant only for Schema "properties" definitions. Declares the property as - // "read only". This means that it MAY be sent as part of a response but MUST - // NOT be sent as part of the request. Properties marked as readOnly being - // true SHOULD NOT be in the required list of the defined schema. Default - // value is false. - bool read_only = 3; - // field 4 is reserved for 'xml'. - reserved 4; - // Additional external documentation for this schema. - ExternalDocumentation external_docs = 5; - // A free-form property to include an example of an instance for this schema in JSON. - // This is copied verbatim to the output. - string example = 6; -} - -// `JSONSchema` represents properties from JSON Schema taken, and as used, in -// the OpenAPI v2 spec. -// -// This includes changes made by OpenAPI v2. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject -// -// See also: https://cswr.github.io/JsonSchema/spec/basic_types/, -// https://github.com/json-schema-org/json-schema-spec/blob/master/schema.json -// -// Example: -// -// message SimpleMessage { -// option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { -// json_schema: { -// title: "SimpleMessage" -// description: "A simple message." -// required: ["id"] -// } -// }; -// -// // Id represents the message identifier. -// string id = 1; [ -// (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { -// description: "The unique identifier of the simple message." -// }]; -// } -// -message JSONSchema { - // field 1 is reserved for '$id', omitted from OpenAPI v2. - reserved 1; - // field 2 is reserved for '$schema', omitted from OpenAPI v2. - reserved 2; - // Ref is used to define an external reference to include in the message. - // This could be a fully qualified proto message reference, and that type must - // be imported into the protofile. If no message is identified, the Ref will - // be used verbatim in the output. - // For example: - // `ref: ".google.protobuf.Timestamp"`. - string ref = 3; - // field 4 is reserved for '$comment', omitted from OpenAPI v2. - reserved 4; - // The title of the schema. - string title = 5; - // A short description of the schema. - string description = 6; - string default = 7; - bool read_only = 8; - // A free-form property to include a JSON example of this field. This is copied - // verbatim to the output swagger.json. Quotes must be escaped. - // This property is the same for 2.0 and 3.0.0 https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/3.0.0.md#schemaObject https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject - string example = 9; - double multiple_of = 10; - // Maximum represents an inclusive upper limit for a numeric instance. The - // value of MUST be a number, - double maximum = 11; - bool exclusive_maximum = 12; - // minimum represents an inclusive lower limit for a numeric instance. The - // value of MUST be a number, - double minimum = 13; - bool exclusive_minimum = 14; - uint64 max_length = 15; - uint64 min_length = 16; - string pattern = 17; - // field 18 is reserved for 'additionalItems', omitted from OpenAPI v2. - reserved 18; - // field 19 is reserved for 'items', but in OpenAPI-specific way. - // TODO(ivucica): add 'items'? - reserved 19; - uint64 max_items = 20; - uint64 min_items = 21; - bool unique_items = 22; - // field 23 is reserved for 'contains', omitted from OpenAPI v2. - reserved 23; - uint64 max_properties = 24; - uint64 min_properties = 25; - repeated string required = 26; - // field 27 is reserved for 'additionalProperties', but in OpenAPI-specific - // way. TODO(ivucica): add 'additionalProperties'? - reserved 27; - // field 28 is reserved for 'definitions', omitted from OpenAPI v2. - reserved 28; - // field 29 is reserved for 'properties', but in OpenAPI-specific way. - // TODO(ivucica): add 'additionalProperties'? - reserved 29; - // following fields are reserved, as the properties have been omitted from - // OpenAPI v2: - // patternProperties, dependencies, propertyNames, const - reserved 30 to 33; - // Items in 'array' must be unique. - repeated string array = 34; - - enum JSONSchemaSimpleTypes { - UNKNOWN = 0; - ARRAY = 1; - BOOLEAN = 2; - INTEGER = 3; - NULL = 4; - NUMBER = 5; - OBJECT = 6; - STRING = 7; - } - - repeated JSONSchemaSimpleTypes type = 35; - // `Format` - string format = 36; - // following fields are reserved, as the properties have been omitted from - // OpenAPI v2: contentMediaType, contentEncoding, if, then, else - reserved 37 to 41; - // field 42 is reserved for 'allOf', but in OpenAPI-specific way. - // TODO(ivucica): add 'allOf'? - reserved 42; - // following fields are reserved, as the properties have been omitted from - // OpenAPI v2: - // anyOf, oneOf, not - reserved 43 to 45; - // Items in `enum` must be unique https://tools.ietf.org/html/draft-fge-json-schema-validation-00#section-5.5.1 - repeated string enum = 46; - - // Additional field level properties used when generating the OpenAPI v2 file. - FieldConfiguration field_configuration = 1001; - - // 'FieldConfiguration' provides additional field level properties used when generating the OpenAPI v2 file. - // These properties are not defined by OpenAPIv2, but they are used to control the generation. - message FieldConfiguration { - // Alternative parameter name when used as path parameter. If set, this will - // be used as the complete parameter name when this field is used as a path - // parameter. Use this to avoid having auto generated path parameter names - // for overlapping paths. - string path_param_name = 47; - } - // Custom properties that start with "x-" such as "x-foo" used to describe - // extra functionality that is not covered by the standard OpenAPI Specification. - // See: https://swagger.io/docs/specification/2-0/swagger-extensions/ - map extensions = 48; -} - -// `Tag` is a representation of OpenAPI v2 specification's Tag object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#tagObject -// -message Tag { - // The name of the tag. Use it to allow override of the name of a - // global Tag object, then use that name to reference the tag throughout the - // OpenAPI file. - string name = 1; - // A short description for the tag. GFM syntax can be used for rich text - // representation. - string description = 2; - // Additional external documentation for this tag. - ExternalDocumentation external_docs = 3; - // Custom properties that start with "x-" such as "x-foo" used to describe - // extra functionality that is not covered by the standard OpenAPI Specification. - // See: https://swagger.io/docs/specification/2-0/swagger-extensions/ - map extensions = 4; -} - -// `SecurityDefinitions` is a representation of OpenAPI v2 specification's -// Security Definitions object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securityDefinitionsObject -// -// A declaration of the security schemes available to be used in the -// specification. This does not enforce the security schemes on the operations -// and only serves to provide the relevant details for each scheme. -message SecurityDefinitions { - // A single security scheme definition, mapping a "name" to the scheme it - // defines. - map security = 1; -} - -// `SecurityScheme` is a representation of OpenAPI v2 specification's -// Security Scheme object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securitySchemeObject -// -// Allows the definition of a security scheme that can be used by the -// operations. Supported schemes are basic authentication, an API key (either as -// a header or as a query parameter) and OAuth2's common flows (implicit, -// password, application and access code). -message SecurityScheme { - // The type of the security scheme. Valid values are "basic", - // "apiKey" or "oauth2". - enum Type { - TYPE_INVALID = 0; - TYPE_BASIC = 1; - TYPE_API_KEY = 2; - TYPE_OAUTH2 = 3; - } - - // The location of the API key. Valid values are "query" or "header". - enum In { - IN_INVALID = 0; - IN_QUERY = 1; - IN_HEADER = 2; - } - - // The flow used by the OAuth2 security scheme. Valid values are - // "implicit", "password", "application" or "accessCode". - enum Flow { - FLOW_INVALID = 0; - FLOW_IMPLICIT = 1; - FLOW_PASSWORD = 2; - FLOW_APPLICATION = 3; - FLOW_ACCESS_CODE = 4; - } - - // The type of the security scheme. Valid values are "basic", - // "apiKey" or "oauth2". - Type type = 1; - // A short description for security scheme. - string description = 2; - // The name of the header or query parameter to be used. - // Valid for apiKey. - string name = 3; - // The location of the API key. Valid values are "query" or - // "header". - // Valid for apiKey. - In in = 4; - // The flow used by the OAuth2 security scheme. Valid values are - // "implicit", "password", "application" or "accessCode". - // Valid for oauth2. - Flow flow = 5; - // The authorization URL to be used for this flow. This SHOULD be in - // the form of a URL. - // Valid for oauth2/implicit and oauth2/accessCode. - string authorization_url = 6; - // The token URL to be used for this flow. This SHOULD be in the - // form of a URL. - // Valid for oauth2/password, oauth2/application and oauth2/accessCode. - string token_url = 7; - // The available scopes for the OAuth2 security scheme. - // Valid for oauth2. - Scopes scopes = 8; - // Custom properties that start with "x-" such as "x-foo" used to describe - // extra functionality that is not covered by the standard OpenAPI Specification. - // See: https://swagger.io/docs/specification/2-0/swagger-extensions/ - map extensions = 9; -} - -// `SecurityRequirement` is a representation of OpenAPI v2 specification's -// Security Requirement object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#securityRequirementObject -// -// Lists the required security schemes to execute this operation. The object can -// have multiple security schemes declared in it which are all required (that -// is, there is a logical AND between the schemes). -// -// The name used for each property MUST correspond to a security scheme -// declared in the Security Definitions. -message SecurityRequirement { - // If the security scheme is of type "oauth2", then the value is a list of - // scope names required for the execution. For other security scheme types, - // the array MUST be empty. - message SecurityRequirementValue { - repeated string scope = 1; - } - // Each name must correspond to a security scheme which is declared in - // the Security Definitions. If the security scheme is of type "oauth2", - // then the value is a list of scope names required for the execution. - // For other security scheme types, the array MUST be empty. - map security_requirement = 1; -} - -// `Scopes` is a representation of OpenAPI v2 specification's Scopes object. -// -// See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#scopesObject -// -// Lists the available scopes for an OAuth2 security scheme. -message Scopes { - // Maps between a name of a scope to a short description of it (as the value - // of the property). - map scope = 1; -} \ No newline at end of file diff --git a/protoc-gen-go-crud/pkg/third_party/protos/validate/README.md b/protoc-gen-go-crud/pkg/third_party/protos/validate/README.md deleted file mode 100644 index 56698db..0000000 --- a/protoc-gen-go-crud/pkg/third_party/protos/validate/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# protoc-gen-validate (PGV) - -* https://github.com/envoyproxy/protoc-gen-validate diff --git a/protoc-gen-go-crud/pkg/third_party/protos/validate/validate.proto b/protoc-gen-go-crud/pkg/third_party/protos/validate/validate.proto deleted file mode 100644 index 4195ecf..0000000 --- a/protoc-gen-go-crud/pkg/third_party/protos/validate/validate.proto +++ /dev/null @@ -1,863 +0,0 @@ -syntax = "proto2"; -package validate; - -option go_package = "github.com/envoyproxy/protoc-gen-validate/validate"; -option java_package = "io.envoyproxy.pgv.validate"; - -import "google/protobuf/descriptor.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -// Validation rules applied at the message level -extend google.protobuf.MessageOptions { - // Disabled nullifies any validation rules for this message, including any - // message fields associated with it that do support validation. - optional bool disabled = 1071; - // Ignore skips generation of validation methods for this message. - optional bool ignored = 1072; -} - -// Validation rules applied at the oneof level -extend google.protobuf.OneofOptions { - // Required ensures that exactly one the field options in a oneof is set; - // validation fails if no fields in the oneof are set. - optional bool required = 1071; -} - -// Validation rules applied at the field level -extend google.protobuf.FieldOptions { - // Rules specify the validations to be performed on this field. By default, - // no validation is performed against a field. - optional FieldRules rules = 1071; -} - -// FieldRules encapsulates the rules for each type of field. Depending on the -// field, the correct set should be used to ensure proper validations. -message FieldRules { - optional MessageRules message = 17; - oneof type { - // Scalar Field Types - FloatRules float = 1; - DoubleRules double = 2; - Int32Rules int32 = 3; - Int64Rules int64 = 4; - UInt32Rules uint32 = 5; - UInt64Rules uint64 = 6; - SInt32Rules sint32 = 7; - SInt64Rules sint64 = 8; - Fixed32Rules fixed32 = 9; - Fixed64Rules fixed64 = 10; - SFixed32Rules sfixed32 = 11; - SFixed64Rules sfixed64 = 12; - BoolRules bool = 13; - StringRules string = 14; - BytesRules bytes = 15; - - // Complex Field Types - EnumRules enum = 16; - RepeatedRules repeated = 18; - MapRules map = 19; - - // Well-Known Field Types - AnyRules any = 20; - DurationRules duration = 21; - TimestampRules timestamp = 22; - } -} - -// FloatRules describes the constraints applied to `float` values -message FloatRules { - // Const specifies that this field must be exactly the specified value - optional float const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional float lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional float lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional float gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional float gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated float in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated float not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// DoubleRules describes the constraints applied to `double` values -message DoubleRules { - // Const specifies that this field must be exactly the specified value - optional double const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional double lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional double lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional double gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional double gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated double in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated double not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// Int32Rules describes the constraints applied to `int32` values -message Int32Rules { - // Const specifies that this field must be exactly the specified value - optional int32 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional int32 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional int32 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional int32 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional int32 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated int32 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated int32 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// Int64Rules describes the constraints applied to `int64` values -message Int64Rules { - // Const specifies that this field must be exactly the specified value - optional int64 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional int64 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional int64 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional int64 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional int64 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated int64 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated int64 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// UInt32Rules describes the constraints applied to `uint32` values -message UInt32Rules { - // Const specifies that this field must be exactly the specified value - optional uint32 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional uint32 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional uint32 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional uint32 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional uint32 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated uint32 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated uint32 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// UInt64Rules describes the constraints applied to `uint64` values -message UInt64Rules { - // Const specifies that this field must be exactly the specified value - optional uint64 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional uint64 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional uint64 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional uint64 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional uint64 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated uint64 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated uint64 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// SInt32Rules describes the constraints applied to `sint32` values -message SInt32Rules { - // Const specifies that this field must be exactly the specified value - optional sint32 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional sint32 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional sint32 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional sint32 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional sint32 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated sint32 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated sint32 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// SInt64Rules describes the constraints applied to `sint64` values -message SInt64Rules { - // Const specifies that this field must be exactly the specified value - optional sint64 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional sint64 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional sint64 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional sint64 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional sint64 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated sint64 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated sint64 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// Fixed32Rules describes the constraints applied to `fixed32` values -message Fixed32Rules { - // Const specifies that this field must be exactly the specified value - optional fixed32 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional fixed32 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional fixed32 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional fixed32 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional fixed32 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated fixed32 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated fixed32 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// Fixed64Rules describes the constraints applied to `fixed64` values -message Fixed64Rules { - // Const specifies that this field must be exactly the specified value - optional fixed64 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional fixed64 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional fixed64 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional fixed64 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional fixed64 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated fixed64 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated fixed64 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// SFixed32Rules describes the constraints applied to `sfixed32` values -message SFixed32Rules { - // Const specifies that this field must be exactly the specified value - optional sfixed32 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional sfixed32 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional sfixed32 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional sfixed32 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional sfixed32 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated sfixed32 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated sfixed32 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// SFixed64Rules describes the constraints applied to `sfixed64` values -message SFixed64Rules { - // Const specifies that this field must be exactly the specified value - optional sfixed64 const = 1; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional sfixed64 lt = 2; - - // Lte specifies that this field must be less than or equal to the - // specified value, inclusive - optional sfixed64 lte = 3; - - // Gt specifies that this field must be greater than the specified value, - // exclusive. If the value of Gt is larger than a specified Lt or Lte, the - // range is reversed. - optional sfixed64 gt = 4; - - // Gte specifies that this field must be greater than or equal to the - // specified value, inclusive. If the value of Gte is larger than a - // specified Lt or Lte, the range is reversed. - optional sfixed64 gte = 5; - - // In specifies that this field must be equal to one of the specified - // values - repeated sfixed64 in = 6; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated sfixed64 not_in = 7; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 8; -} - -// BoolRules describes the constraints applied to `bool` values -message BoolRules { - // Const specifies that this field must be exactly the specified value - optional bool const = 1; -} - -// StringRules describe the constraints applied to `string` values -message StringRules { - // Const specifies that this field must be exactly the specified value - optional string const = 1; - - // Len specifies that this field must be the specified number of - // characters (Unicode code points). Note that the number of - // characters may differ from the number of bytes in the string. - optional uint64 len = 19; - - // MinLen specifies that this field must be the specified number of - // characters (Unicode code points) at a minimum. Note that the number of - // characters may differ from the number of bytes in the string. - optional uint64 min_len = 2; - - // MaxLen specifies that this field must be the specified number of - // characters (Unicode code points) at a maximum. Note that the number of - // characters may differ from the number of bytes in the string. - optional uint64 max_len = 3; - - // LenBytes specifies that this field must be the specified number of bytes - // at a minimum - optional uint64 len_bytes = 20; - - // MinBytes specifies that this field must be the specified number of bytes - // at a minimum - optional uint64 min_bytes = 4; - - // MaxBytes specifies that this field must be the specified number of bytes - // at a maximum - optional uint64 max_bytes = 5; - - // Pattern specifes that this field must match against the specified - // regular expression (RE2 syntax). The included expression should elide - // any delimiters. - optional string pattern = 6; - - // Prefix specifies that this field must have the specified substring at - // the beginning of the string. - optional string prefix = 7; - - // Suffix specifies that this field must have the specified substring at - // the end of the string. - optional string suffix = 8; - - // Contains specifies that this field must have the specified substring - // anywhere in the string. - optional string contains = 9; - - // NotContains specifies that this field cannot have the specified substring - // anywhere in the string. - optional string not_contains = 23; - - // In specifies that this field must be equal to one of the specified - // values - repeated string in = 10; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated string not_in = 11; - - // WellKnown rules provide advanced constraints against common string - // patterns - oneof well_known { - // Email specifies that the field must be a valid email address as - // defined by RFC 5322 - bool email = 12; - - // Hostname specifies that the field must be a valid hostname as - // defined by RFC 1034. This constraint does not support - // internationalized domain names (IDNs). - bool hostname = 13; - - // Ip specifies that the field must be a valid IP (v4 or v6) address. - // Valid IPv6 addresses should not include surrounding square brackets. - bool ip = 14; - - // Ipv4 specifies that the field must be a valid IPv4 address. - bool ipv4 = 15; - - // Ipv6 specifies that the field must be a valid IPv6 address. Valid - // IPv6 addresses should not include surrounding square brackets. - bool ipv6 = 16; - - // Uri specifies that the field must be a valid, absolute URI as defined - // by RFC 3986 - bool uri = 17; - - // UriRef specifies that the field must be a valid URI as defined by RFC - // 3986 and may be relative or absolute. - bool uri_ref = 18; - - // Address specifies that the field must be either a valid hostname as - // defined by RFC 1034 (which does not support internationalized domain - // names or IDNs), or it can be a valid IP (v4 or v6). - bool address = 21; - - // Uuid specifies that the field must be a valid UUID as defined by - // RFC 4122 - bool uuid = 22; - - // WellKnownRegex specifies a common well known pattern defined as a regex. - KnownRegex well_known_regex = 24; - } - - // This applies to regexes HTTP_HEADER_NAME and HTTP_HEADER_VALUE to enable - // strict header validation. - // By default, this is true, and HTTP header validations are RFC-compliant. - // Setting to false will enable a looser validations that only disallows - // \r\n\0 characters, which can be used to bypass header matching rules. - optional bool strict = 25 [default = true]; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 26; -} - -// WellKnownRegex contain some well-known patterns. -enum KnownRegex { - UNKNOWN = 0; - - // HTTP header name as defined by RFC 7230. - HTTP_HEADER_NAME = 1; - - // HTTP header value as defined by RFC 7230. - HTTP_HEADER_VALUE = 2; -} - -// BytesRules describe the constraints applied to `bytes` values -message BytesRules { - // Const specifies that this field must be exactly the specified value - optional bytes const = 1; - - // Len specifies that this field must be the specified number of bytes - optional uint64 len = 13; - - // MinLen specifies that this field must be the specified number of bytes - // at a minimum - optional uint64 min_len = 2; - - // MaxLen specifies that this field must be the specified number of bytes - // at a maximum - optional uint64 max_len = 3; - - // Pattern specifes that this field must match against the specified - // regular expression (RE2 syntax). The included expression should elide - // any delimiters. - optional string pattern = 4; - - // Prefix specifies that this field must have the specified bytes at the - // beginning of the string. - optional bytes prefix = 5; - - // Suffix specifies that this field must have the specified bytes at the - // end of the string. - optional bytes suffix = 6; - - // Contains specifies that this field must have the specified bytes - // anywhere in the string. - optional bytes contains = 7; - - // In specifies that this field must be equal to one of the specified - // values - repeated bytes in = 8; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated bytes not_in = 9; - - // WellKnown rules provide advanced constraints against common byte - // patterns - oneof well_known { - // Ip specifies that the field must be a valid IP (v4 or v6) address in - // byte format - bool ip = 10; - - // Ipv4 specifies that the field must be a valid IPv4 address in byte - // format - bool ipv4 = 11; - - // Ipv6 specifies that the field must be a valid IPv6 address in byte - // format - bool ipv6 = 12; - } - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 14; -} - -// EnumRules describe the constraints applied to enum values -message EnumRules { - // Const specifies that this field must be exactly the specified value - optional int32 const = 1; - - // DefinedOnly specifies that this field must be only one of the defined - // values for this enum, failing on any undefined value. - optional bool defined_only = 2; - - // In specifies that this field must be equal to one of the specified - // values - repeated int32 in = 3; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated int32 not_in = 4; -} - -// MessageRules describe the constraints applied to embedded message values. -// For message-type fields, validation is performed recursively. -message MessageRules { - // Skip specifies that the validation rules of this field should not be - // evaluated - optional bool skip = 1; - - // Required specifies that this field must be set - optional bool required = 2; -} - -// RepeatedRules describe the constraints applied to `repeated` values -message RepeatedRules { - // MinItems specifies that this field must have the specified number of - // items at a minimum - optional uint64 min_items = 1; - - // MaxItems specifies that this field must have the specified number of - // items at a maximum - optional uint64 max_items = 2; - - // Unique specifies that all elements in this field must be unique. This - // contraint is only applicable to scalar and enum types (messages are not - // supported). - optional bool unique = 3; - - // Items specifies the contraints to be applied to each item in the field. - // Repeated message fields will still execute validation against each item - // unless skip is specified here. - optional FieldRules items = 4; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 5; -} - -// MapRules describe the constraints applied to `map` values -message MapRules { - // MinPairs specifies that this field must have the specified number of - // KVs at a minimum - optional uint64 min_pairs = 1; - - // MaxPairs specifies that this field must have the specified number of - // KVs at a maximum - optional uint64 max_pairs = 2; - - // NoSparse specifies values in this field cannot be unset. This only - // applies to map's with message value types. - optional bool no_sparse = 3; - - // Keys specifies the constraints to be applied to each key in the field. - optional FieldRules keys = 4; - - // Values specifies the constraints to be applied to the value of each key - // in the field. Message values will still have their validations evaluated - // unless skip is specified here. - optional FieldRules values = 5; - - // IgnoreEmpty specifies that the validation rules of this field should be - // evaluated only if the field is not empty - optional bool ignore_empty = 6; -} - -// AnyRules describe constraints applied exclusively to the -// `google.protobuf.Any` well-known type -message AnyRules { - // Required specifies that this field must be set - optional bool required = 1; - - // In specifies that this field's `type_url` must be equal to one of the - // specified values. - repeated string in = 2; - - // NotIn specifies that this field's `type_url` must not be equal to any of - // the specified values. - repeated string not_in = 3; -} - -// DurationRules describe the constraints applied exclusively to the -// `google.protobuf.Duration` well-known type -message DurationRules { - // Required specifies that this field must be set - optional bool required = 1; - - // Const specifies that this field must be exactly the specified value - optional google.protobuf.Duration const = 2; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional google.protobuf.Duration lt = 3; - - // Lt specifies that this field must be less than the specified value, - // inclusive - optional google.protobuf.Duration lte = 4; - - // Gt specifies that this field must be greater than the specified value, - // exclusive - optional google.protobuf.Duration gt = 5; - - // Gte specifies that this field must be greater than the specified value, - // inclusive - optional google.protobuf.Duration gte = 6; - - // In specifies that this field must be equal to one of the specified - // values - repeated google.protobuf.Duration in = 7; - - // NotIn specifies that this field cannot be equal to one of the specified - // values - repeated google.protobuf.Duration not_in = 8; -} - -// TimestampRules describe the constraints applied exclusively to the -// `google.protobuf.Timestamp` well-known type -message TimestampRules { - // Required specifies that this field must be set - optional bool required = 1; - - // Const specifies that this field must be exactly the specified value - optional google.protobuf.Timestamp const = 2; - - // Lt specifies that this field must be less than the specified value, - // exclusive - optional google.protobuf.Timestamp lt = 3; - - // Lte specifies that this field must be less than the specified value, - // inclusive - optional google.protobuf.Timestamp lte = 4; - - // Gt specifies that this field must be greater than the specified value, - // exclusive - optional google.protobuf.Timestamp gt = 5; - - // Gte specifies that this field must be greater than the specified value, - // inclusive - optional google.protobuf.Timestamp gte = 6; - - // LtNow specifies that this must be less than the current time. LtNow - // can only be used with the Within rule. - optional bool lt_now = 7; - - // GtNow specifies that this must be greater than the current time. GtNow - // can only be used with the Within rule. - optional bool gt_now = 8; - - // Within specifies that this field must be within this duration of the - // current time. This constraint can be used alone or with the LtNow and - // GtNow rules. - optional google.protobuf.Duration within = 9; -}