diff --git a/anonymous/v1/anonymousv1connect/service.connect.go b/anonymous/v1/anonymousv1connect/service.connect.go new file mode 100644 index 0000000..d2fa210 --- /dev/null +++ b/anonymous/v1/anonymousv1connect/service.connect.go @@ -0,0 +1,109 @@ +// Code generated by protoc-gen-connect-go. DO NOT EDIT. +// +// Source: anonymous/v1/service.proto + +package anonymousv1connect + +import ( + connect "connectrpc.com/connect" + context "context" + errors "errors" + v1 "git.shenxianhe.cn/shenxianhe/sdk/anonymous/v1" + http "net/http" + strings "strings" +) + +// This is a compile-time assertion to ensure that this generated file and the connect package are +// compatible. If you get a compiler error that this constant is not defined, this code was +// generated with a version of connect newer than the one compiled into your binary. You can fix the +// problem by either regenerating this code with an older version of connect or updating the connect +// version compiled into your binary. +const _ = connect.IsAtLeastVersion1_13_0 + +const ( + // AnonymousServiceName is the fully-qualified name of the AnonymousService service. + AnonymousServiceName = "anonymous.v1.AnonymousService" +) + +// These constants are the fully-qualified names of the RPCs defined in this package. They're +// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route. +// +// Note that these are different from the fully-qualified method names used by +// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to +// reflection-formatted method names, remove the leading slash and convert the remaining slash to a +// period. +const ( + // AnonymousServiceSendCredentialProcedure is the fully-qualified name of the AnonymousService's + // SendCredential RPC. + AnonymousServiceSendCredentialProcedure = "/anonymous.v1.AnonymousService/SendCredential" +) + +// AnonymousServiceClient is a client for the anonymous.v1.AnonymousService service. +type AnonymousServiceClient interface { + SendCredential(context.Context, *connect.Request[v1.SendCredentialRequest]) (*connect.Response[v1.SendCredentialResponse], error) +} + +// NewAnonymousServiceClient constructs a client for the anonymous.v1.AnonymousService service. By +// default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, +// and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the +// connect.WithGRPC() or connect.WithGRPCWeb() options. +// +// The URL supplied here should be the base URL for the Connect or gRPC server (for example, +// http://api.acme.com or https://acme.com/grpc). +func NewAnonymousServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) AnonymousServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + anonymousServiceMethods := v1.File_anonymous_v1_service_proto.Services().ByName("AnonymousService").Methods() + return &anonymousServiceClient{ + sendCredential: connect.NewClient[v1.SendCredentialRequest, v1.SendCredentialResponse]( + httpClient, + baseURL+AnonymousServiceSendCredentialProcedure, + connect.WithSchema(anonymousServiceMethods.ByName("SendCredential")), + connect.WithClientOptions(opts...), + ), + } +} + +// anonymousServiceClient implements AnonymousServiceClient. +type anonymousServiceClient struct { + sendCredential *connect.Client[v1.SendCredentialRequest, v1.SendCredentialResponse] +} + +// SendCredential calls anonymous.v1.AnonymousService.SendCredential. +func (c *anonymousServiceClient) SendCredential(ctx context.Context, req *connect.Request[v1.SendCredentialRequest]) (*connect.Response[v1.SendCredentialResponse], error) { + return c.sendCredential.CallUnary(ctx, req) +} + +// AnonymousServiceHandler is an implementation of the anonymous.v1.AnonymousService service. +type AnonymousServiceHandler interface { + SendCredential(context.Context, *connect.Request[v1.SendCredentialRequest]) (*connect.Response[v1.SendCredentialResponse], error) +} + +// NewAnonymousServiceHandler builds an HTTP handler from the service implementation. It returns the +// path on which to mount the handler and the handler itself. +// +// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf +// and JSON codecs. They also support gzip compression. +func NewAnonymousServiceHandler(svc AnonymousServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { + anonymousServiceMethods := v1.File_anonymous_v1_service_proto.Services().ByName("AnonymousService").Methods() + anonymousServiceSendCredentialHandler := connect.NewUnaryHandler( + AnonymousServiceSendCredentialProcedure, + svc.SendCredential, + connect.WithSchema(anonymousServiceMethods.ByName("SendCredential")), + connect.WithHandlerOptions(opts...), + ) + return "/anonymous.v1.AnonymousService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + switch r.URL.Path { + case AnonymousServiceSendCredentialProcedure: + anonymousServiceSendCredentialHandler.ServeHTTP(w, r) + default: + http.NotFound(w, r) + } + }) +} + +// UnimplementedAnonymousServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedAnonymousServiceHandler struct{} + +func (UnimplementedAnonymousServiceHandler) SendCredential(context.Context, *connect.Request[v1.SendCredentialRequest]) (*connect.Response[v1.SendCredentialResponse], error) { + return nil, connect.NewError(connect.CodeUnimplemented, errors.New("anonymous.v1.AnonymousService.SendCredential is not implemented")) +} diff --git a/anonymous/v1/service.pb.go b/anonymous/v1/service.pb.go new file mode 100644 index 0000000..968324d --- /dev/null +++ b/anonymous/v1/service.pb.go @@ -0,0 +1,67 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.7 +// protoc (unknown) +// source: anonymous/v1/service.proto + +package anonymousv1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + unsafe "unsafe" +) + +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) +) + +var File_anonymous_v1_service_proto protoreflect.FileDescriptor + +const file_anonymous_v1_service_proto_rawDesc = "" + + "\n" + + "\x1aanonymous/v1/service.proto\x12\fanonymous.v1\x1a\x17anonymous/v1/user.proto2o\n" + + "\x10AnonymousService\x12[\n" + + "\x0eSendCredential\x12#.anonymous.v1.SendCredentialRequest\x1a$.anonymous.v1.SendCredentialResponseB;Z9git.shenxianhe.cn/shenxianhe/sdk/anonymous/v1;anonymousv1b\x06proto3" + +var file_anonymous_v1_service_proto_goTypes = []any{ + (*SendCredentialRequest)(nil), // 0: anonymous.v1.SendCredentialRequest + (*SendCredentialResponse)(nil), // 1: anonymous.v1.SendCredentialResponse +} +var file_anonymous_v1_service_proto_depIdxs = []int32{ + 0, // 0: anonymous.v1.AnonymousService.SendCredential:input_type -> anonymous.v1.SendCredentialRequest + 1, // 1: anonymous.v1.AnonymousService.SendCredential:output_type -> anonymous.v1.SendCredentialResponse + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] 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_anonymous_v1_service_proto_init() } +func file_anonymous_v1_service_proto_init() { + if File_anonymous_v1_service_proto != nil { + return + } + file_anonymous_v1_user_proto_init() + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_anonymous_v1_service_proto_rawDesc), len(file_anonymous_v1_service_proto_rawDesc)), + NumEnums: 0, + NumMessages: 0, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_anonymous_v1_service_proto_goTypes, + DependencyIndexes: file_anonymous_v1_service_proto_depIdxs, + }.Build() + File_anonymous_v1_service_proto = out.File + file_anonymous_v1_service_proto_goTypes = nil + file_anonymous_v1_service_proto_depIdxs = nil +} diff --git a/anonymous/v1/user.pb.go b/anonymous/v1/user.pb.go new file mode 100644 index 0000000..95df0a3 --- /dev/null +++ b/anonymous/v1/user.pb.go @@ -0,0 +1,172 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.36.7 +// protoc (unknown) +// source: anonymous/v1/user.proto + +package anonymousv1 + +import ( + v1 "git.shenxianhe.cn/shenxianhe/sdk/enums/v1" + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" + unsafe "unsafe" +) + +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 SendCredentialRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + AuthType v1.AuthenticationType `protobuf:"varint,1,opt,name=auth_type,json=authType,proto3,enum=enums.v1.AuthenticationType" json:"auth_type,omitempty"` // 认证类型 + AuthId string `protobuf:"bytes,2,opt,name=auth_id,json=authId,proto3" json:"auth_id,omitempty"` // 认证ID,根据auth_type存储不同的账号信息 + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SendCredentialRequest) Reset() { + *x = SendCredentialRequest{} + mi := &file_anonymous_v1_user_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SendCredentialRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SendCredentialRequest) ProtoMessage() {} + +func (x *SendCredentialRequest) ProtoReflect() protoreflect.Message { + mi := &file_anonymous_v1_user_proto_msgTypes[0] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SendCredentialRequest.ProtoReflect.Descriptor instead. +func (*SendCredentialRequest) Descriptor() ([]byte, []int) { + return file_anonymous_v1_user_proto_rawDescGZIP(), []int{0} +} + +func (x *SendCredentialRequest) GetAuthType() v1.AuthenticationType { + if x != nil { + return x.AuthType + } + return v1.AuthenticationType(0) +} + +func (x *SendCredentialRequest) GetAuthId() string { + if x != nil { + return x.AuthId + } + return "" +} + +type SendCredentialResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SendCredentialResponse) Reset() { + *x = SendCredentialResponse{} + mi := &file_anonymous_v1_user_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SendCredentialResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SendCredentialResponse) ProtoMessage() {} + +func (x *SendCredentialResponse) ProtoReflect() protoreflect.Message { + mi := &file_anonymous_v1_user_proto_msgTypes[1] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SendCredentialResponse.ProtoReflect.Descriptor instead. +func (*SendCredentialResponse) Descriptor() ([]byte, []int) { + return file_anonymous_v1_user_proto_rawDescGZIP(), []int{1} +} + +var File_anonymous_v1_user_proto protoreflect.FileDescriptor + +const file_anonymous_v1_user_proto_rawDesc = "" + + "\n" + + "\x17anonymous/v1/user.proto\x12\fanonymous.v1\x1a\x13enums/v1/user.proto\"k\n" + + "\x15SendCredentialRequest\x129\n" + + "\tauth_type\x18\x01 \x01(\x0e2\x1c.enums.v1.AuthenticationTypeR\bauthType\x12\x17\n" + + "\aauth_id\x18\x02 \x01(\tR\x06authId\"\x18\n" + + "\x16SendCredentialResponseB;Z9git.shenxianhe.cn/shenxianhe/sdk/anonymous/v1;anonymousv1b\x06proto3" + +var ( + file_anonymous_v1_user_proto_rawDescOnce sync.Once + file_anonymous_v1_user_proto_rawDescData []byte +) + +func file_anonymous_v1_user_proto_rawDescGZIP() []byte { + file_anonymous_v1_user_proto_rawDescOnce.Do(func() { + file_anonymous_v1_user_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_anonymous_v1_user_proto_rawDesc), len(file_anonymous_v1_user_proto_rawDesc))) + }) + return file_anonymous_v1_user_proto_rawDescData +} + +var file_anonymous_v1_user_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_anonymous_v1_user_proto_goTypes = []any{ + (*SendCredentialRequest)(nil), // 0: anonymous.v1.SendCredentialRequest + (*SendCredentialResponse)(nil), // 1: anonymous.v1.SendCredentialResponse + (v1.AuthenticationType)(0), // 2: enums.v1.AuthenticationType +} +var file_anonymous_v1_user_proto_depIdxs = []int32{ + 2, // 0: anonymous.v1.SendCredentialRequest.auth_type:type_name -> enums.v1.AuthenticationType + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] 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_anonymous_v1_user_proto_init() } +func file_anonymous_v1_user_proto_init() { + if File_anonymous_v1_user_proto != nil { + return + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: unsafe.Slice(unsafe.StringData(file_anonymous_v1_user_proto_rawDesc), len(file_anonymous_v1_user_proto_rawDesc)), + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_anonymous_v1_user_proto_goTypes, + DependencyIndexes: file_anonymous_v1_user_proto_depIdxs, + MessageInfos: file_anonymous_v1_user_proto_msgTypes, + }.Build() + File_anonymous_v1_user_proto = out.File + file_anonymous_v1_user_proto_goTypes = nil + file_anonymous_v1_user_proto_depIdxs = nil +} diff --git a/user/v1/service.pb.go b/user/v1/service.pb.go index a2b3b57..c6f5fda 100644 --- a/user/v1/service.pb.go +++ b/user/v1/service.pb.go @@ -24,9 +24,8 @@ var File_user_v1_service_proto protoreflect.FileDescriptor const file_user_v1_service_proto_rawDesc = "" + "\n" + - "\x15user/v1/service.proto\x12\auser.v1\x1a\x12user/v1/user.proto2\xdd\x04\n" + - "\vUserService\x12Q\n" + - "\x0eSendCredential\x12\x1e.user.v1.SendCredentialRequest\x1a\x1f.user.v1.SendCredentialResponse\x123\n" + + "\x15user/v1/service.proto\x12\auser.v1\x1a\x12user/v1/user.proto2\x8a\x04\n" + + "\vUserService\x123\n" + "\x04Auth\x12\x14.user.v1.AuthRequest\x1a\x15.user.v1.AuthResponse\x12H\n" + "\vSetPassword\x12\x1b.user.v1.SetPasswordRequest\x1a\x1c.user.v1.SetPasswordResponse\x12<\n" + "\aSetName\x12\x17.user.v1.SetNameRequest\x1a\x18.user.v1.SetNameResponse\x12]\n" + @@ -36,42 +35,38 @@ const file_user_v1_service_proto_rawDesc = "" + "\vGetUserInfo\x12\x1b.user.v1.GetUserInfoRequest\x1a\x1c.user.v1.GetUserInfoResponseB1Z/git.shenxianhe.cn/shenxianhe/sdk/user/v1;userv1b\x06proto3" var file_user_v1_service_proto_goTypes = []any{ - (*SendCredentialRequest)(nil), // 0: user.v1.SendCredentialRequest - (*AuthRequest)(nil), // 1: user.v1.AuthRequest - (*SetPasswordRequest)(nil), // 2: user.v1.SetPasswordRequest - (*SetNameRequest)(nil), // 3: user.v1.SetNameRequest - (*GetAvatarUploadURLRequest)(nil), // 4: user.v1.GetAvatarUploadURLRequest - (*SetAvatarRequest)(nil), // 5: user.v1.SetAvatarRequest - (*SetDescriptionRequest)(nil), // 6: user.v1.SetDescriptionRequest - (*GetUserInfoRequest)(nil), // 7: user.v1.GetUserInfoRequest - (*SendCredentialResponse)(nil), // 8: user.v1.SendCredentialResponse - (*AuthResponse)(nil), // 9: user.v1.AuthResponse - (*SetPasswordResponse)(nil), // 10: user.v1.SetPasswordResponse - (*SetNameResponse)(nil), // 11: user.v1.SetNameResponse - (*GetAvatarUploadURLResponse)(nil), // 12: user.v1.GetAvatarUploadURLResponse - (*SetAvatarResponse)(nil), // 13: user.v1.SetAvatarResponse - (*SetDescriptionResponse)(nil), // 14: user.v1.SetDescriptionResponse - (*GetUserInfoResponse)(nil), // 15: user.v1.GetUserInfoResponse + (*AuthRequest)(nil), // 0: user.v1.AuthRequest + (*SetPasswordRequest)(nil), // 1: user.v1.SetPasswordRequest + (*SetNameRequest)(nil), // 2: user.v1.SetNameRequest + (*GetAvatarUploadURLRequest)(nil), // 3: user.v1.GetAvatarUploadURLRequest + (*SetAvatarRequest)(nil), // 4: user.v1.SetAvatarRequest + (*SetDescriptionRequest)(nil), // 5: user.v1.SetDescriptionRequest + (*GetUserInfoRequest)(nil), // 6: user.v1.GetUserInfoRequest + (*AuthResponse)(nil), // 7: user.v1.AuthResponse + (*SetPasswordResponse)(nil), // 8: user.v1.SetPasswordResponse + (*SetNameResponse)(nil), // 9: user.v1.SetNameResponse + (*GetAvatarUploadURLResponse)(nil), // 10: user.v1.GetAvatarUploadURLResponse + (*SetAvatarResponse)(nil), // 11: user.v1.SetAvatarResponse + (*SetDescriptionResponse)(nil), // 12: user.v1.SetDescriptionResponse + (*GetUserInfoResponse)(nil), // 13: user.v1.GetUserInfoResponse } var file_user_v1_service_proto_depIdxs = []int32{ - 0, // 0: user.v1.UserService.SendCredential:input_type -> user.v1.SendCredentialRequest - 1, // 1: user.v1.UserService.Auth:input_type -> user.v1.AuthRequest - 2, // 2: user.v1.UserService.SetPassword:input_type -> user.v1.SetPasswordRequest - 3, // 3: user.v1.UserService.SetName:input_type -> user.v1.SetNameRequest - 4, // 4: user.v1.UserService.GetAvatarUploadURL:input_type -> user.v1.GetAvatarUploadURLRequest - 5, // 5: user.v1.UserService.SetAvatar:input_type -> user.v1.SetAvatarRequest - 6, // 6: user.v1.UserService.SetDescription:input_type -> user.v1.SetDescriptionRequest - 7, // 7: user.v1.UserService.GetUserInfo:input_type -> user.v1.GetUserInfoRequest - 8, // 8: user.v1.UserService.SendCredential:output_type -> user.v1.SendCredentialResponse - 9, // 9: user.v1.UserService.Auth:output_type -> user.v1.AuthResponse - 10, // 10: user.v1.UserService.SetPassword:output_type -> user.v1.SetPasswordResponse - 11, // 11: user.v1.UserService.SetName:output_type -> user.v1.SetNameResponse - 12, // 12: user.v1.UserService.GetAvatarUploadURL:output_type -> user.v1.GetAvatarUploadURLResponse - 13, // 13: user.v1.UserService.SetAvatar:output_type -> user.v1.SetAvatarResponse - 14, // 14: user.v1.UserService.SetDescription:output_type -> user.v1.SetDescriptionResponse - 15, // 15: user.v1.UserService.GetUserInfo:output_type -> user.v1.GetUserInfoResponse - 8, // [8:16] is the sub-list for method output_type - 0, // [0:8] is the sub-list for method input_type + 0, // 0: user.v1.UserService.Auth:input_type -> user.v1.AuthRequest + 1, // 1: user.v1.UserService.SetPassword:input_type -> user.v1.SetPasswordRequest + 2, // 2: user.v1.UserService.SetName:input_type -> user.v1.SetNameRequest + 3, // 3: user.v1.UserService.GetAvatarUploadURL:input_type -> user.v1.GetAvatarUploadURLRequest + 4, // 4: user.v1.UserService.SetAvatar:input_type -> user.v1.SetAvatarRequest + 5, // 5: user.v1.UserService.SetDescription:input_type -> user.v1.SetDescriptionRequest + 6, // 6: user.v1.UserService.GetUserInfo:input_type -> user.v1.GetUserInfoRequest + 7, // 7: user.v1.UserService.Auth:output_type -> user.v1.AuthResponse + 8, // 8: user.v1.UserService.SetPassword:output_type -> user.v1.SetPasswordResponse + 9, // 9: user.v1.UserService.SetName:output_type -> user.v1.SetNameResponse + 10, // 10: user.v1.UserService.GetAvatarUploadURL:output_type -> user.v1.GetAvatarUploadURLResponse + 11, // 11: user.v1.UserService.SetAvatar:output_type -> user.v1.SetAvatarResponse + 12, // 12: user.v1.UserService.SetDescription:output_type -> user.v1.SetDescriptionResponse + 13, // 13: user.v1.UserService.GetUserInfo:output_type -> user.v1.GetUserInfoResponse + 7, // [7:14] is the sub-list for method output_type + 0, // [0:7] 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 diff --git a/user/v1/user.pb.go b/user/v1/user.pb.go index 10349d8..1a74dbb 100644 --- a/user/v1/user.pb.go +++ b/user/v1/user.pb.go @@ -22,94 +22,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -type SendCredentialRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - AuthType v1.AuthenticationType `protobuf:"varint,1,opt,name=auth_type,json=authType,proto3,enum=enums.v1.AuthenticationType" json:"auth_type,omitempty"` // 认证类型 - AuthId string `protobuf:"bytes,2,opt,name=auth_id,json=authId,proto3" json:"auth_id,omitempty"` // 认证ID,根据auth_type存储不同的账号信息 - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SendCredentialRequest) Reset() { - *x = SendCredentialRequest{} - mi := &file_user_v1_user_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SendCredentialRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SendCredentialRequest) ProtoMessage() {} - -func (x *SendCredentialRequest) ProtoReflect() protoreflect.Message { - mi := &file_user_v1_user_proto_msgTypes[0] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SendCredentialRequest.ProtoReflect.Descriptor instead. -func (*SendCredentialRequest) Descriptor() ([]byte, []int) { - return file_user_v1_user_proto_rawDescGZIP(), []int{0} -} - -func (x *SendCredentialRequest) GetAuthType() v1.AuthenticationType { - if x != nil { - return x.AuthType - } - return v1.AuthenticationType(0) -} - -func (x *SendCredentialRequest) GetAuthId() string { - if x != nil { - return x.AuthId - } - return "" -} - -type SendCredentialResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *SendCredentialResponse) Reset() { - *x = SendCredentialResponse{} - mi := &file_user_v1_user_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *SendCredentialResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SendCredentialResponse) ProtoMessage() {} - -func (x *SendCredentialResponse) ProtoReflect() protoreflect.Message { - mi := &file_user_v1_user_proto_msgTypes[1] - if x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SendCredentialResponse.ProtoReflect.Descriptor instead. -func (*SendCredentialResponse) Descriptor() ([]byte, []int) { - return file_user_v1_user_proto_rawDescGZIP(), []int{1} -} - type AuthRequest struct { state protoimpl.MessageState `protogen:"open.v1"` AuthType v1.AuthenticationType `protobuf:"varint,1,opt,name=auth_type,json=authType,proto3,enum=enums.v1.AuthenticationType" json:"auth_type,omitempty"` // 认证类型 @@ -122,7 +34,7 @@ type AuthRequest struct { func (x *AuthRequest) Reset() { *x = AuthRequest{} - mi := &file_user_v1_user_proto_msgTypes[2] + mi := &file_user_v1_user_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -134,7 +46,7 @@ func (x *AuthRequest) String() string { func (*AuthRequest) ProtoMessage() {} func (x *AuthRequest) ProtoReflect() protoreflect.Message { - mi := &file_user_v1_user_proto_msgTypes[2] + mi := &file_user_v1_user_proto_msgTypes[0] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -147,7 +59,7 @@ func (x *AuthRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use AuthRequest.ProtoReflect.Descriptor instead. func (*AuthRequest) Descriptor() ([]byte, []int) { - return file_user_v1_user_proto_rawDescGZIP(), []int{2} + return file_user_v1_user_proto_rawDescGZIP(), []int{0} } func (x *AuthRequest) GetAuthType() v1.AuthenticationType { @@ -187,7 +99,7 @@ type AuthResponse struct { func (x *AuthResponse) Reset() { *x = AuthResponse{} - mi := &file_user_v1_user_proto_msgTypes[3] + mi := &file_user_v1_user_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -199,7 +111,7 @@ func (x *AuthResponse) String() string { func (*AuthResponse) ProtoMessage() {} func (x *AuthResponse) ProtoReflect() protoreflect.Message { - mi := &file_user_v1_user_proto_msgTypes[3] + mi := &file_user_v1_user_proto_msgTypes[1] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -212,7 +124,7 @@ func (x *AuthResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use AuthResponse.ProtoReflect.Descriptor instead. func (*AuthResponse) Descriptor() ([]byte, []int) { - return file_user_v1_user_proto_rawDescGZIP(), []int{3} + return file_user_v1_user_proto_rawDescGZIP(), []int{1} } func (x *AuthResponse) GetToken() string { @@ -234,7 +146,7 @@ type SetPasswordRequest struct { func (x *SetPasswordRequest) Reset() { *x = SetPasswordRequest{} - mi := &file_user_v1_user_proto_msgTypes[4] + mi := &file_user_v1_user_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -246,7 +158,7 @@ func (x *SetPasswordRequest) String() string { func (*SetPasswordRequest) ProtoMessage() {} func (x *SetPasswordRequest) ProtoReflect() protoreflect.Message { - mi := &file_user_v1_user_proto_msgTypes[4] + mi := &file_user_v1_user_proto_msgTypes[2] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -259,7 +171,7 @@ func (x *SetPasswordRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SetPasswordRequest.ProtoReflect.Descriptor instead. func (*SetPasswordRequest) Descriptor() ([]byte, []int) { - return file_user_v1_user_proto_rawDescGZIP(), []int{4} + return file_user_v1_user_proto_rawDescGZIP(), []int{2} } func (x *SetPasswordRequest) GetAuthType() v1.AuthenticationType { @@ -298,7 +210,7 @@ type SetPasswordResponse struct { func (x *SetPasswordResponse) Reset() { *x = SetPasswordResponse{} - mi := &file_user_v1_user_proto_msgTypes[5] + mi := &file_user_v1_user_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -310,7 +222,7 @@ func (x *SetPasswordResponse) String() string { func (*SetPasswordResponse) ProtoMessage() {} func (x *SetPasswordResponse) ProtoReflect() protoreflect.Message { - mi := &file_user_v1_user_proto_msgTypes[5] + mi := &file_user_v1_user_proto_msgTypes[3] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -323,7 +235,7 @@ func (x *SetPasswordResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SetPasswordResponse.ProtoReflect.Descriptor instead. func (*SetPasswordResponse) Descriptor() ([]byte, []int) { - return file_user_v1_user_proto_rawDescGZIP(), []int{5} + return file_user_v1_user_proto_rawDescGZIP(), []int{3} } type SetNameRequest struct { @@ -335,7 +247,7 @@ type SetNameRequest struct { func (x *SetNameRequest) Reset() { *x = SetNameRequest{} - mi := &file_user_v1_user_proto_msgTypes[6] + mi := &file_user_v1_user_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -347,7 +259,7 @@ func (x *SetNameRequest) String() string { func (*SetNameRequest) ProtoMessage() {} func (x *SetNameRequest) ProtoReflect() protoreflect.Message { - mi := &file_user_v1_user_proto_msgTypes[6] + mi := &file_user_v1_user_proto_msgTypes[4] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -360,7 +272,7 @@ func (x *SetNameRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SetNameRequest.ProtoReflect.Descriptor instead. func (*SetNameRequest) Descriptor() ([]byte, []int) { - return file_user_v1_user_proto_rawDescGZIP(), []int{6} + return file_user_v1_user_proto_rawDescGZIP(), []int{4} } func (x *SetNameRequest) GetName() string { @@ -378,7 +290,7 @@ type SetNameResponse struct { func (x *SetNameResponse) Reset() { *x = SetNameResponse{} - mi := &file_user_v1_user_proto_msgTypes[7] + mi := &file_user_v1_user_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -390,7 +302,7 @@ func (x *SetNameResponse) String() string { func (*SetNameResponse) ProtoMessage() {} func (x *SetNameResponse) ProtoReflect() protoreflect.Message { - mi := &file_user_v1_user_proto_msgTypes[7] + mi := &file_user_v1_user_proto_msgTypes[5] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -403,7 +315,7 @@ func (x *SetNameResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SetNameResponse.ProtoReflect.Descriptor instead. func (*SetNameResponse) Descriptor() ([]byte, []int) { - return file_user_v1_user_proto_rawDescGZIP(), []int{7} + return file_user_v1_user_proto_rawDescGZIP(), []int{5} } type GetAvatarUploadURLRequest struct { @@ -414,7 +326,7 @@ type GetAvatarUploadURLRequest struct { func (x *GetAvatarUploadURLRequest) Reset() { *x = GetAvatarUploadURLRequest{} - mi := &file_user_v1_user_proto_msgTypes[8] + mi := &file_user_v1_user_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -426,7 +338,7 @@ func (x *GetAvatarUploadURLRequest) String() string { func (*GetAvatarUploadURLRequest) ProtoMessage() {} func (x *GetAvatarUploadURLRequest) ProtoReflect() protoreflect.Message { - mi := &file_user_v1_user_proto_msgTypes[8] + mi := &file_user_v1_user_proto_msgTypes[6] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -439,7 +351,7 @@ func (x *GetAvatarUploadURLRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetAvatarUploadURLRequest.ProtoReflect.Descriptor instead. func (*GetAvatarUploadURLRequest) Descriptor() ([]byte, []int) { - return file_user_v1_user_proto_rawDescGZIP(), []int{8} + return file_user_v1_user_proto_rawDescGZIP(), []int{6} } type GetAvatarUploadURLResponse struct { @@ -452,7 +364,7 @@ type GetAvatarUploadURLResponse struct { func (x *GetAvatarUploadURLResponse) Reset() { *x = GetAvatarUploadURLResponse{} - mi := &file_user_v1_user_proto_msgTypes[9] + mi := &file_user_v1_user_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -464,7 +376,7 @@ func (x *GetAvatarUploadURLResponse) String() string { func (*GetAvatarUploadURLResponse) ProtoMessage() {} func (x *GetAvatarUploadURLResponse) ProtoReflect() protoreflect.Message { - mi := &file_user_v1_user_proto_msgTypes[9] + mi := &file_user_v1_user_proto_msgTypes[7] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -477,7 +389,7 @@ func (x *GetAvatarUploadURLResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetAvatarUploadURLResponse.ProtoReflect.Descriptor instead. func (*GetAvatarUploadURLResponse) Descriptor() ([]byte, []int) { - return file_user_v1_user_proto_rawDescGZIP(), []int{9} + return file_user_v1_user_proto_rawDescGZIP(), []int{7} } func (x *GetAvatarUploadURLResponse) GetKey() string { @@ -503,7 +415,7 @@ type SetAvatarRequest struct { func (x *SetAvatarRequest) Reset() { *x = SetAvatarRequest{} - mi := &file_user_v1_user_proto_msgTypes[10] + mi := &file_user_v1_user_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -515,7 +427,7 @@ func (x *SetAvatarRequest) String() string { func (*SetAvatarRequest) ProtoMessage() {} func (x *SetAvatarRequest) ProtoReflect() protoreflect.Message { - mi := &file_user_v1_user_proto_msgTypes[10] + mi := &file_user_v1_user_proto_msgTypes[8] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -528,7 +440,7 @@ func (x *SetAvatarRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SetAvatarRequest.ProtoReflect.Descriptor instead. func (*SetAvatarRequest) Descriptor() ([]byte, []int) { - return file_user_v1_user_proto_rawDescGZIP(), []int{10} + return file_user_v1_user_proto_rawDescGZIP(), []int{8} } func (x *SetAvatarRequest) GetKey() string { @@ -546,7 +458,7 @@ type SetAvatarResponse struct { func (x *SetAvatarResponse) Reset() { *x = SetAvatarResponse{} - mi := &file_user_v1_user_proto_msgTypes[11] + mi := &file_user_v1_user_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -558,7 +470,7 @@ func (x *SetAvatarResponse) String() string { func (*SetAvatarResponse) ProtoMessage() {} func (x *SetAvatarResponse) ProtoReflect() protoreflect.Message { - mi := &file_user_v1_user_proto_msgTypes[11] + mi := &file_user_v1_user_proto_msgTypes[9] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -571,7 +483,7 @@ func (x *SetAvatarResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SetAvatarResponse.ProtoReflect.Descriptor instead. func (*SetAvatarResponse) Descriptor() ([]byte, []int) { - return file_user_v1_user_proto_rawDescGZIP(), []int{11} + return file_user_v1_user_proto_rawDescGZIP(), []int{9} } type SetDescriptionRequest struct { @@ -583,7 +495,7 @@ type SetDescriptionRequest struct { func (x *SetDescriptionRequest) Reset() { *x = SetDescriptionRequest{} - mi := &file_user_v1_user_proto_msgTypes[12] + mi := &file_user_v1_user_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -595,7 +507,7 @@ func (x *SetDescriptionRequest) String() string { func (*SetDescriptionRequest) ProtoMessage() {} func (x *SetDescriptionRequest) ProtoReflect() protoreflect.Message { - mi := &file_user_v1_user_proto_msgTypes[12] + mi := &file_user_v1_user_proto_msgTypes[10] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -608,7 +520,7 @@ func (x *SetDescriptionRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SetDescriptionRequest.ProtoReflect.Descriptor instead. func (*SetDescriptionRequest) Descriptor() ([]byte, []int) { - return file_user_v1_user_proto_rawDescGZIP(), []int{12} + return file_user_v1_user_proto_rawDescGZIP(), []int{10} } func (x *SetDescriptionRequest) GetDescription() string { @@ -626,7 +538,7 @@ type SetDescriptionResponse struct { func (x *SetDescriptionResponse) Reset() { *x = SetDescriptionResponse{} - mi := &file_user_v1_user_proto_msgTypes[13] + mi := &file_user_v1_user_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -638,7 +550,7 @@ func (x *SetDescriptionResponse) String() string { func (*SetDescriptionResponse) ProtoMessage() {} func (x *SetDescriptionResponse) ProtoReflect() protoreflect.Message { - mi := &file_user_v1_user_proto_msgTypes[13] + mi := &file_user_v1_user_proto_msgTypes[11] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -651,7 +563,7 @@ func (x *SetDescriptionResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SetDescriptionResponse.ProtoReflect.Descriptor instead. func (*SetDescriptionResponse) Descriptor() ([]byte, []int) { - return file_user_v1_user_proto_rawDescGZIP(), []int{13} + return file_user_v1_user_proto_rawDescGZIP(), []int{11} } type GetUserInfoRequest struct { @@ -662,7 +574,7 @@ type GetUserInfoRequest struct { func (x *GetUserInfoRequest) Reset() { *x = GetUserInfoRequest{} - mi := &file_user_v1_user_proto_msgTypes[14] + mi := &file_user_v1_user_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -674,7 +586,7 @@ func (x *GetUserInfoRequest) String() string { func (*GetUserInfoRequest) ProtoMessage() {} func (x *GetUserInfoRequest) ProtoReflect() protoreflect.Message { - mi := &file_user_v1_user_proto_msgTypes[14] + mi := &file_user_v1_user_proto_msgTypes[12] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -687,7 +599,7 @@ func (x *GetUserInfoRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetUserInfoRequest.ProtoReflect.Descriptor instead. func (*GetUserInfoRequest) Descriptor() ([]byte, []int) { - return file_user_v1_user_proto_rawDescGZIP(), []int{14} + return file_user_v1_user_proto_rawDescGZIP(), []int{12} } type GetUserInfoResponse struct { @@ -705,7 +617,7 @@ type GetUserInfoResponse struct { func (x *GetUserInfoResponse) Reset() { *x = GetUserInfoResponse{} - mi := &file_user_v1_user_proto_msgTypes[15] + mi := &file_user_v1_user_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -717,7 +629,7 @@ func (x *GetUserInfoResponse) String() string { func (*GetUserInfoResponse) ProtoMessage() {} func (x *GetUserInfoResponse) ProtoReflect() protoreflect.Message { - mi := &file_user_v1_user_proto_msgTypes[15] + mi := &file_user_v1_user_proto_msgTypes[13] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -730,7 +642,7 @@ func (x *GetUserInfoResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetUserInfoResponse.ProtoReflect.Descriptor instead. func (*GetUserInfoResponse) Descriptor() ([]byte, []int) { - return file_user_v1_user_proto_rawDescGZIP(), []int{15} + return file_user_v1_user_proto_rawDescGZIP(), []int{13} } func (x *GetUserInfoResponse) GetId() string { @@ -786,11 +698,7 @@ var File_user_v1_user_proto protoreflect.FileDescriptor const file_user_v1_user_proto_rawDesc = "" + "\n" + - "\x12user/v1/user.proto\x12\auser.v1\x1a\x13enums/v1/user.proto\"k\n" + - "\x15SendCredentialRequest\x129\n" + - "\tauth_type\x18\x01 \x01(\x0e2\x1c.enums.v1.AuthenticationTypeR\bauthType\x12\x17\n" + - "\aauth_id\x18\x02 \x01(\tR\x06authId\"\x18\n" + - "\x16SendCredentialResponse\"\xaa\x01\n" + + "\x12user/v1/user.proto\x12\auser.v1\x1a\x13enums/v1/user.proto\"\xaa\x01\n" + "\vAuthRequest\x129\n" + "\tauth_type\x18\x01 \x01(\x0e2\x1c.enums.v1.AuthenticationTypeR\bauthType\x12\x17\n" + "\aauth_id\x18\x02 \x01(\tR\x06authId\x12\x1e\n" + @@ -843,35 +751,32 @@ func file_user_v1_user_proto_rawDescGZIP() []byte { return file_user_v1_user_proto_rawDescData } -var file_user_v1_user_proto_msgTypes = make([]protoimpl.MessageInfo, 16) +var file_user_v1_user_proto_msgTypes = make([]protoimpl.MessageInfo, 14) var file_user_v1_user_proto_goTypes = []any{ - (*SendCredentialRequest)(nil), // 0: user.v1.SendCredentialRequest - (*SendCredentialResponse)(nil), // 1: user.v1.SendCredentialResponse - (*AuthRequest)(nil), // 2: user.v1.AuthRequest - (*AuthResponse)(nil), // 3: user.v1.AuthResponse - (*SetPasswordRequest)(nil), // 4: user.v1.SetPasswordRequest - (*SetPasswordResponse)(nil), // 5: user.v1.SetPasswordResponse - (*SetNameRequest)(nil), // 6: user.v1.SetNameRequest - (*SetNameResponse)(nil), // 7: user.v1.SetNameResponse - (*GetAvatarUploadURLRequest)(nil), // 8: user.v1.GetAvatarUploadURLRequest - (*GetAvatarUploadURLResponse)(nil), // 9: user.v1.GetAvatarUploadURLResponse - (*SetAvatarRequest)(nil), // 10: user.v1.SetAvatarRequest - (*SetAvatarResponse)(nil), // 11: user.v1.SetAvatarResponse - (*SetDescriptionRequest)(nil), // 12: user.v1.SetDescriptionRequest - (*SetDescriptionResponse)(nil), // 13: user.v1.SetDescriptionResponse - (*GetUserInfoRequest)(nil), // 14: user.v1.GetUserInfoRequest - (*GetUserInfoResponse)(nil), // 15: user.v1.GetUserInfoResponse - (v1.AuthenticationType)(0), // 16: enums.v1.AuthenticationType + (*AuthRequest)(nil), // 0: user.v1.AuthRequest + (*AuthResponse)(nil), // 1: user.v1.AuthResponse + (*SetPasswordRequest)(nil), // 2: user.v1.SetPasswordRequest + (*SetPasswordResponse)(nil), // 3: user.v1.SetPasswordResponse + (*SetNameRequest)(nil), // 4: user.v1.SetNameRequest + (*SetNameResponse)(nil), // 5: user.v1.SetNameResponse + (*GetAvatarUploadURLRequest)(nil), // 6: user.v1.GetAvatarUploadURLRequest + (*GetAvatarUploadURLResponse)(nil), // 7: user.v1.GetAvatarUploadURLResponse + (*SetAvatarRequest)(nil), // 8: user.v1.SetAvatarRequest + (*SetAvatarResponse)(nil), // 9: user.v1.SetAvatarResponse + (*SetDescriptionRequest)(nil), // 10: user.v1.SetDescriptionRequest + (*SetDescriptionResponse)(nil), // 11: user.v1.SetDescriptionResponse + (*GetUserInfoRequest)(nil), // 12: user.v1.GetUserInfoRequest + (*GetUserInfoResponse)(nil), // 13: user.v1.GetUserInfoResponse + (v1.AuthenticationType)(0), // 14: enums.v1.AuthenticationType } var file_user_v1_user_proto_depIdxs = []int32{ - 16, // 0: user.v1.SendCredentialRequest.auth_type:type_name -> enums.v1.AuthenticationType - 16, // 1: user.v1.AuthRequest.auth_type:type_name -> enums.v1.AuthenticationType - 16, // 2: user.v1.SetPasswordRequest.auth_type:type_name -> enums.v1.AuthenticationType - 3, // [3:3] is the sub-list for method output_type - 3, // [3:3] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name + 14, // 0: user.v1.AuthRequest.auth_type:type_name -> enums.v1.AuthenticationType + 14, // 1: user.v1.SetPasswordRequest.auth_type:type_name -> enums.v1.AuthenticationType + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name } func init() { file_user_v1_user_proto_init() } @@ -885,7 +790,7 @@ func file_user_v1_user_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_user_v1_user_proto_rawDesc), len(file_user_v1_user_proto_rawDesc)), NumEnums: 0, - NumMessages: 16, + NumMessages: 14, NumExtensions: 0, NumServices: 0, }, diff --git a/user/v1/userv1connect/service.connect.go b/user/v1/userv1connect/service.connect.go index a266d9f..291fac8 100644 --- a/user/v1/userv1connect/service.connect.go +++ b/user/v1/userv1connect/service.connect.go @@ -33,9 +33,6 @@ const ( // reflection-formatted method names, remove the leading slash and convert the remaining slash to a // period. const ( - // UserServiceSendCredentialProcedure is the fully-qualified name of the UserService's - // SendCredential RPC. - UserServiceSendCredentialProcedure = "/user.v1.UserService/SendCredential" // UserServiceAuthProcedure is the fully-qualified name of the UserService's Auth RPC. UserServiceAuthProcedure = "/user.v1.UserService/Auth" // UserServiceSetPasswordProcedure is the fully-qualified name of the UserService's SetPassword RPC. @@ -56,7 +53,6 @@ const ( // UserServiceClient is a client for the user.v1.UserService service. type UserServiceClient interface { - SendCredential(context.Context, *connect.Request[v1.SendCredentialRequest]) (*connect.Response[v1.SendCredentialResponse], error) Auth(context.Context, *connect.Request[v1.AuthRequest]) (*connect.Response[v1.AuthResponse], error) SetPassword(context.Context, *connect.Request[v1.SetPasswordRequest]) (*connect.Response[v1.SetPasswordResponse], error) SetName(context.Context, *connect.Request[v1.SetNameRequest]) (*connect.Response[v1.SetNameResponse], error) @@ -77,12 +73,6 @@ func NewUserServiceClient(httpClient connect.HTTPClient, baseURL string, opts .. baseURL = strings.TrimRight(baseURL, "/") userServiceMethods := v1.File_user_v1_service_proto.Services().ByName("UserService").Methods() return &userServiceClient{ - sendCredential: connect.NewClient[v1.SendCredentialRequest, v1.SendCredentialResponse]( - httpClient, - baseURL+UserServiceSendCredentialProcedure, - connect.WithSchema(userServiceMethods.ByName("SendCredential")), - connect.WithClientOptions(opts...), - ), auth: connect.NewClient[v1.AuthRequest, v1.AuthResponse]( httpClient, baseURL+UserServiceAuthProcedure, @@ -130,7 +120,6 @@ func NewUserServiceClient(httpClient connect.HTTPClient, baseURL string, opts .. // userServiceClient implements UserServiceClient. type userServiceClient struct { - sendCredential *connect.Client[v1.SendCredentialRequest, v1.SendCredentialResponse] auth *connect.Client[v1.AuthRequest, v1.AuthResponse] setPassword *connect.Client[v1.SetPasswordRequest, v1.SetPasswordResponse] setName *connect.Client[v1.SetNameRequest, v1.SetNameResponse] @@ -140,11 +129,6 @@ type userServiceClient struct { getUserInfo *connect.Client[v1.GetUserInfoRequest, v1.GetUserInfoResponse] } -// SendCredential calls user.v1.UserService.SendCredential. -func (c *userServiceClient) SendCredential(ctx context.Context, req *connect.Request[v1.SendCredentialRequest]) (*connect.Response[v1.SendCredentialResponse], error) { - return c.sendCredential.CallUnary(ctx, req) -} - // Auth calls user.v1.UserService.Auth. func (c *userServiceClient) Auth(ctx context.Context, req *connect.Request[v1.AuthRequest]) (*connect.Response[v1.AuthResponse], error) { return c.auth.CallUnary(ctx, req) @@ -182,7 +166,6 @@ func (c *userServiceClient) GetUserInfo(ctx context.Context, req *connect.Reques // UserServiceHandler is an implementation of the user.v1.UserService service. type UserServiceHandler interface { - SendCredential(context.Context, *connect.Request[v1.SendCredentialRequest]) (*connect.Response[v1.SendCredentialResponse], error) Auth(context.Context, *connect.Request[v1.AuthRequest]) (*connect.Response[v1.AuthResponse], error) SetPassword(context.Context, *connect.Request[v1.SetPasswordRequest]) (*connect.Response[v1.SetPasswordResponse], error) SetName(context.Context, *connect.Request[v1.SetNameRequest]) (*connect.Response[v1.SetNameResponse], error) @@ -199,12 +182,6 @@ type UserServiceHandler interface { // and JSON codecs. They also support gzip compression. func NewUserServiceHandler(svc UserServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) { userServiceMethods := v1.File_user_v1_service_proto.Services().ByName("UserService").Methods() - userServiceSendCredentialHandler := connect.NewUnaryHandler( - UserServiceSendCredentialProcedure, - svc.SendCredential, - connect.WithSchema(userServiceMethods.ByName("SendCredential")), - connect.WithHandlerOptions(opts...), - ) userServiceAuthHandler := connect.NewUnaryHandler( UserServiceAuthProcedure, svc.Auth, @@ -249,8 +226,6 @@ func NewUserServiceHandler(svc UserServiceHandler, opts ...connect.HandlerOption ) return "/user.v1.UserService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { switch r.URL.Path { - case UserServiceSendCredentialProcedure: - userServiceSendCredentialHandler.ServeHTTP(w, r) case UserServiceAuthProcedure: userServiceAuthHandler.ServeHTTP(w, r) case UserServiceSetPasswordProcedure: @@ -274,10 +249,6 @@ func NewUserServiceHandler(svc UserServiceHandler, opts ...connect.HandlerOption // UnimplementedUserServiceHandler returns CodeUnimplemented from all methods. type UnimplementedUserServiceHandler struct{} -func (UnimplementedUserServiceHandler) SendCredential(context.Context, *connect.Request[v1.SendCredentialRequest]) (*connect.Response[v1.SendCredentialResponse], error) { - return nil, connect.NewError(connect.CodeUnimplemented, errors.New("user.v1.UserService.SendCredential is not implemented")) -} - func (UnimplementedUserServiceHandler) Auth(context.Context, *connect.Request[v1.AuthRequest]) (*connect.Response[v1.AuthResponse], error) { return nil, connect.NewError(connect.CodeUnimplemented, errors.New("user.v1.UserService.Auth is not implemented")) }