From 6cb3063a1d53d06cdef17d4959f3468907e29cfc Mon Sep 17 00:00:00 2001 From: vallyenfail Date: Mon, 19 Jan 2026 19:29:53 +0300 Subject: [PATCH] add service --- api/proto/user/user.proto | 7 +- internal/grpc/user_handler.go | 8 +- pkg/pb/auth/auth.pb.go | 700 ---------------------------- pkg/pb/auth/auth_grpc.pb.go | 273 ----------- pkg/pb/invite/invite.pb.go | 359 -------------- pkg/pb/invite/invite_grpc.pb.go | 159 ------- pkg/pb/request/request.pb.go | 640 ------------------------- pkg/pb/request/request_grpc.pb.go | 235 ---------- pkg/pb/supplier/supplier.pb.go | 201 -------- pkg/pb/supplier/supplier_grpc.pb.go | 121 ----- pkg/pb/user/user.pb.go | 604 ------------------------ pkg/pb/user/user_grpc.pb.go | 235 ---------- tests/full_flow_test.go | 2 +- tests/user_handler_test.go | 9 +- 14 files changed, 12 insertions(+), 3541 deletions(-) delete mode 100644 pkg/pb/auth/auth.pb.go delete mode 100644 pkg/pb/auth/auth_grpc.pb.go delete mode 100644 pkg/pb/invite/invite.pb.go delete mode 100644 pkg/pb/invite/invite_grpc.pb.go delete mode 100644 pkg/pb/request/request.pb.go delete mode 100644 pkg/pb/request/request_grpc.pb.go delete mode 100644 pkg/pb/supplier/supplier.pb.go delete mode 100644 pkg/pb/supplier/supplier_grpc.pb.go delete mode 100644 pkg/pb/user/user.pb.go delete mode 100644 pkg/pb/user/user_grpc.pb.go diff --git a/api/proto/user/user.proto b/api/proto/user/user.proto index 0db9045..74fbf19 100644 --- a/api/proto/user/user.proto +++ b/api/proto/user/user.proto @@ -34,10 +34,9 @@ message GetStatisticsRequest { } message GetStatisticsResponse { - int32 total_requests = 1; - int32 successful_requests = 2; - int32 failed_requests = 3; - double total_spent = 4; + string suppliers_count = 1; + string requests_count = 2; + string created_tz = 3; } message GetBalanceStatisticsRequest { diff --git a/internal/grpc/user_handler.go b/internal/grpc/user_handler.go index 217b32b..e4fed82 100644 --- a/internal/grpc/user_handler.go +++ b/internal/grpc/user_handler.go @@ -2,6 +2,7 @@ package grpc import ( "context" + "strconv" "git.techease.ru/Smart-search/smart-search-back/pkg/errors" pb "git.techease.ru/Smart-search/smart-search-back/pkg/pb/user" @@ -40,10 +41,9 @@ func (h *UserHandler) GetStatistics(ctx context.Context, req *pb.GetStatisticsRe } return &pb.GetStatisticsResponse{ - TotalRequests: int32(stats.RequestsCount), - SuccessfulRequests: int32(stats.SuppliersCount), - FailedRequests: 0, - TotalSpent: 0, + SuppliersCount: strconv.Itoa(stats.SuppliersCount), + RequestsCount: strconv.Itoa(stats.RequestsCount), + CreatedTz: strconv.Itoa(stats.CreatedTZ), }, nil } diff --git a/pkg/pb/auth/auth.pb.go b/pkg/pb/auth/auth.pb.go deleted file mode 100644 index 438b1c0..0000000 --- a/pkg/pb/auth/auth.pb.go +++ /dev/null @@ -1,700 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.6 -// protoc v5.29.3 -// source: auth/auth.proto - -package auth - -import ( - 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 LoginRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` - Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` - Ip string `protobuf:"bytes,3,opt,name=ip,proto3" json:"ip,omitempty"` - UserAgent string `protobuf:"bytes,4,opt,name=user_agent,json=userAgent,proto3" json:"user_agent,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *LoginRequest) Reset() { - *x = LoginRequest{} - mi := &file_auth_auth_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *LoginRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LoginRequest) ProtoMessage() {} - -func (x *LoginRequest) ProtoReflect() protoreflect.Message { - mi := &file_auth_auth_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 LoginRequest.ProtoReflect.Descriptor instead. -func (*LoginRequest) Descriptor() ([]byte, []int) { - return file_auth_auth_proto_rawDescGZIP(), []int{0} -} - -func (x *LoginRequest) GetEmail() string { - if x != nil { - return x.Email - } - return "" -} - -func (x *LoginRequest) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *LoginRequest) GetIp() string { - if x != nil { - return x.Ip - } - return "" -} - -func (x *LoginRequest) GetUserAgent() string { - if x != nil { - return x.UserAgent - } - return "" -} - -type LoginResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` - RefreshToken string `protobuf:"bytes,2,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *LoginResponse) Reset() { - *x = LoginResponse{} - mi := &file_auth_auth_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *LoginResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LoginResponse) ProtoMessage() {} - -func (x *LoginResponse) ProtoReflect() protoreflect.Message { - mi := &file_auth_auth_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 LoginResponse.ProtoReflect.Descriptor instead. -func (*LoginResponse) Descriptor() ([]byte, []int) { - return file_auth_auth_proto_rawDescGZIP(), []int{1} -} - -func (x *LoginResponse) GetAccessToken() string { - if x != nil { - return x.AccessToken - } - return "" -} - -func (x *LoginResponse) GetRefreshToken() string { - if x != nil { - return x.RefreshToken - } - return "" -} - -type RefreshRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - RefreshToken string `protobuf:"bytes,1,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"` - Ip string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"` - UserAgent string `protobuf:"bytes,3,opt,name=user_agent,json=userAgent,proto3" json:"user_agent,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RefreshRequest) Reset() { - *x = RefreshRequest{} - mi := &file_auth_auth_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RefreshRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RefreshRequest) ProtoMessage() {} - -func (x *RefreshRequest) ProtoReflect() protoreflect.Message { - mi := &file_auth_auth_proto_msgTypes[2] - 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 RefreshRequest.ProtoReflect.Descriptor instead. -func (*RefreshRequest) Descriptor() ([]byte, []int) { - return file_auth_auth_proto_rawDescGZIP(), []int{2} -} - -func (x *RefreshRequest) GetRefreshToken() string { - if x != nil { - return x.RefreshToken - } - return "" -} - -func (x *RefreshRequest) GetIp() string { - if x != nil { - return x.Ip - } - return "" -} - -func (x *RefreshRequest) GetUserAgent() string { - if x != nil { - return x.UserAgent - } - return "" -} - -type RefreshResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` - RefreshToken string `protobuf:"bytes,2,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RefreshResponse) Reset() { - *x = RefreshResponse{} - mi := &file_auth_auth_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RefreshResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RefreshResponse) ProtoMessage() {} - -func (x *RefreshResponse) ProtoReflect() protoreflect.Message { - mi := &file_auth_auth_proto_msgTypes[3] - 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 RefreshResponse.ProtoReflect.Descriptor instead. -func (*RefreshResponse) Descriptor() ([]byte, []int) { - return file_auth_auth_proto_rawDescGZIP(), []int{3} -} - -func (x *RefreshResponse) GetAccessToken() string { - if x != nil { - return x.AccessToken - } - return "" -} - -func (x *RefreshResponse) GetRefreshToken() string { - if x != nil { - return x.RefreshToken - } - return "" -} - -type ValidateRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ValidateRequest) Reset() { - *x = ValidateRequest{} - mi := &file_auth_auth_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ValidateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ValidateRequest) ProtoMessage() {} - -func (x *ValidateRequest) ProtoReflect() protoreflect.Message { - mi := &file_auth_auth_proto_msgTypes[4] - 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 ValidateRequest.ProtoReflect.Descriptor instead. -func (*ValidateRequest) Descriptor() ([]byte, []int) { - return file_auth_auth_proto_rawDescGZIP(), []int{4} -} - -func (x *ValidateRequest) GetAccessToken() string { - if x != nil { - return x.AccessToken - } - return "" -} - -type ValidateResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Valid bool `protobuf:"varint,1,opt,name=valid,proto3" json:"valid,omitempty"` - UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ValidateResponse) Reset() { - *x = ValidateResponse{} - mi := &file_auth_auth_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ValidateResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ValidateResponse) ProtoMessage() {} - -func (x *ValidateResponse) ProtoReflect() protoreflect.Message { - mi := &file_auth_auth_proto_msgTypes[5] - 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 ValidateResponse.ProtoReflect.Descriptor instead. -func (*ValidateResponse) Descriptor() ([]byte, []int) { - return file_auth_auth_proto_rawDescGZIP(), []int{5} -} - -func (x *ValidateResponse) GetValid() bool { - if x != nil { - return x.Valid - } - return false -} - -func (x *ValidateResponse) GetUserId() int64 { - if x != nil { - return x.UserId - } - return 0 -} - -type LogoutRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *LogoutRequest) Reset() { - *x = LogoutRequest{} - mi := &file_auth_auth_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *LogoutRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LogoutRequest) ProtoMessage() {} - -func (x *LogoutRequest) ProtoReflect() protoreflect.Message { - mi := &file_auth_auth_proto_msgTypes[6] - 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 LogoutRequest.ProtoReflect.Descriptor instead. -func (*LogoutRequest) Descriptor() ([]byte, []int) { - return file_auth_auth_proto_rawDescGZIP(), []int{6} -} - -func (x *LogoutRequest) GetAccessToken() string { - if x != nil { - return x.AccessToken - } - return "" -} - -type LogoutResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *LogoutResponse) Reset() { - *x = LogoutResponse{} - mi := &file_auth_auth_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *LogoutResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*LogoutResponse) ProtoMessage() {} - -func (x *LogoutResponse) ProtoReflect() protoreflect.Message { - mi := &file_auth_auth_proto_msgTypes[7] - 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 LogoutResponse.ProtoReflect.Descriptor instead. -func (*LogoutResponse) Descriptor() ([]byte, []int) { - return file_auth_auth_proto_rawDescGZIP(), []int{7} -} - -func (x *LogoutResponse) GetSuccess() bool { - if x != nil { - return x.Success - } - return false -} - -type RegisterRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` - Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - Phone string `protobuf:"bytes,4,opt,name=phone,proto3" json:"phone,omitempty"` - InviteCode int64 `protobuf:"varint,5,opt,name=invite_code,json=inviteCode,proto3" json:"invite_code,omitempty"` - Ip string `protobuf:"bytes,6,opt,name=ip,proto3" json:"ip,omitempty"` - UserAgent string `protobuf:"bytes,7,opt,name=user_agent,json=userAgent,proto3" json:"user_agent,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RegisterRequest) Reset() { - *x = RegisterRequest{} - mi := &file_auth_auth_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RegisterRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RegisterRequest) ProtoMessage() {} - -func (x *RegisterRequest) ProtoReflect() protoreflect.Message { - mi := &file_auth_auth_proto_msgTypes[8] - 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 RegisterRequest.ProtoReflect.Descriptor instead. -func (*RegisterRequest) Descriptor() ([]byte, []int) { - return file_auth_auth_proto_rawDescGZIP(), []int{8} -} - -func (x *RegisterRequest) GetEmail() string { - if x != nil { - return x.Email - } - return "" -} - -func (x *RegisterRequest) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *RegisterRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *RegisterRequest) GetPhone() string { - if x != nil { - return x.Phone - } - return "" -} - -func (x *RegisterRequest) GetInviteCode() int64 { - if x != nil { - return x.InviteCode - } - return 0 -} - -func (x *RegisterRequest) GetIp() string { - if x != nil { - return x.Ip - } - return "" -} - -func (x *RegisterRequest) GetUserAgent() string { - if x != nil { - return x.UserAgent - } - return "" -} - -type RegisterResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` - RefreshToken string `protobuf:"bytes,2,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *RegisterResponse) Reset() { - *x = RegisterResponse{} - mi := &file_auth_auth_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *RegisterResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RegisterResponse) ProtoMessage() {} - -func (x *RegisterResponse) ProtoReflect() protoreflect.Message { - mi := &file_auth_auth_proto_msgTypes[9] - 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 RegisterResponse.ProtoReflect.Descriptor instead. -func (*RegisterResponse) Descriptor() ([]byte, []int) { - return file_auth_auth_proto_rawDescGZIP(), []int{9} -} - -func (x *RegisterResponse) GetAccessToken() string { - if x != nil { - return x.AccessToken - } - return "" -} - -func (x *RegisterResponse) GetRefreshToken() string { - if x != nil { - return x.RefreshToken - } - return "" -} - -var File_auth_auth_proto protoreflect.FileDescriptor - -const file_auth_auth_proto_rawDesc = "" + - "\n" + - "\x0fauth/auth.proto\x12\x04auth\"o\n" + - "\fLoginRequest\x12\x14\n" + - "\x05email\x18\x01 \x01(\tR\x05email\x12\x1a\n" + - "\bpassword\x18\x02 \x01(\tR\bpassword\x12\x0e\n" + - "\x02ip\x18\x03 \x01(\tR\x02ip\x12\x1d\n" + - "\n" + - "user_agent\x18\x04 \x01(\tR\tuserAgent\"W\n" + - "\rLoginResponse\x12!\n" + - "\faccess_token\x18\x01 \x01(\tR\vaccessToken\x12#\n" + - "\rrefresh_token\x18\x02 \x01(\tR\frefreshToken\"d\n" + - "\x0eRefreshRequest\x12#\n" + - "\rrefresh_token\x18\x01 \x01(\tR\frefreshToken\x12\x0e\n" + - "\x02ip\x18\x02 \x01(\tR\x02ip\x12\x1d\n" + - "\n" + - "user_agent\x18\x03 \x01(\tR\tuserAgent\"Y\n" + - "\x0fRefreshResponse\x12!\n" + - "\faccess_token\x18\x01 \x01(\tR\vaccessToken\x12#\n" + - "\rrefresh_token\x18\x02 \x01(\tR\frefreshToken\"4\n" + - "\x0fValidateRequest\x12!\n" + - "\faccess_token\x18\x01 \x01(\tR\vaccessToken\"A\n" + - "\x10ValidateResponse\x12\x14\n" + - "\x05valid\x18\x01 \x01(\bR\x05valid\x12\x17\n" + - "\auser_id\x18\x02 \x01(\x03R\x06userId\"2\n" + - "\rLogoutRequest\x12!\n" + - "\faccess_token\x18\x01 \x01(\tR\vaccessToken\"*\n" + - "\x0eLogoutResponse\x12\x18\n" + - "\asuccess\x18\x01 \x01(\bR\asuccess\"\xbd\x01\n" + - "\x0fRegisterRequest\x12\x14\n" + - "\x05email\x18\x01 \x01(\tR\x05email\x12\x1a\n" + - "\bpassword\x18\x02 \x01(\tR\bpassword\x12\x12\n" + - "\x04name\x18\x03 \x01(\tR\x04name\x12\x14\n" + - "\x05phone\x18\x04 \x01(\tR\x05phone\x12\x1f\n" + - "\vinvite_code\x18\x05 \x01(\x03R\n" + - "inviteCode\x12\x0e\n" + - "\x02ip\x18\x06 \x01(\tR\x02ip\x12\x1d\n" + - "\n" + - "user_agent\x18\a \x01(\tR\tuserAgent\"Z\n" + - "\x10RegisterResponse\x12!\n" + - "\faccess_token\x18\x01 \x01(\tR\vaccessToken\x12#\n" + - "\rrefresh_token\x18\x02 \x01(\tR\frefreshToken2\xa2\x02\n" + - "\vAuthService\x129\n" + - "\bRegister\x12\x15.auth.RegisterRequest\x1a\x16.auth.RegisterResponse\x120\n" + - "\x05Login\x12\x12.auth.LoginRequest\x1a\x13.auth.LoginResponse\x126\n" + - "\aRefresh\x12\x14.auth.RefreshRequest\x1a\x15.auth.RefreshResponse\x129\n" + - "\bValidate\x12\x15.auth.ValidateRequest\x1a\x16.auth.ValidateResponse\x123\n" + - "\x06Logout\x12\x13.auth.LogoutRequest\x1a\x14.auth.LogoutResponseB auth.RegisterRequest - 0, // 1: auth.AuthService.Login:input_type -> auth.LoginRequest - 2, // 2: auth.AuthService.Refresh:input_type -> auth.RefreshRequest - 4, // 3: auth.AuthService.Validate:input_type -> auth.ValidateRequest - 6, // 4: auth.AuthService.Logout:input_type -> auth.LogoutRequest - 9, // 5: auth.AuthService.Register:output_type -> auth.RegisterResponse - 1, // 6: auth.AuthService.Login:output_type -> auth.LoginResponse - 3, // 7: auth.AuthService.Refresh:output_type -> auth.RefreshResponse - 5, // 8: auth.AuthService.Validate:output_type -> auth.ValidateResponse - 7, // 9: auth.AuthService.Logout:output_type -> auth.LogoutResponse - 5, // [5:10] is the sub-list for method output_type - 0, // [0:5] 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_auth_auth_proto_init() } -func file_auth_auth_proto_init() { - if File_auth_auth_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_auth_auth_proto_rawDesc), len(file_auth_auth_proto_rawDesc)), - NumEnums: 0, - NumMessages: 10, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_auth_auth_proto_goTypes, - DependencyIndexes: file_auth_auth_proto_depIdxs, - MessageInfos: file_auth_auth_proto_msgTypes, - }.Build() - File_auth_auth_proto = out.File - file_auth_auth_proto_goTypes = nil - file_auth_auth_proto_depIdxs = nil -} diff --git a/pkg/pb/auth/auth_grpc.pb.go b/pkg/pb/auth/auth_grpc.pb.go deleted file mode 100644 index 6a92b4a..0000000 --- a/pkg/pb/auth/auth_grpc.pb.go +++ /dev/null @@ -1,273 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.5.1 -// - protoc v5.29.3 -// source: auth/auth.proto - -package auth - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - AuthService_Register_FullMethodName = "/auth.AuthService/Register" - AuthService_Login_FullMethodName = "/auth.AuthService/Login" - AuthService_Refresh_FullMethodName = "/auth.AuthService/Refresh" - AuthService_Validate_FullMethodName = "/auth.AuthService/Validate" - AuthService_Logout_FullMethodName = "/auth.AuthService/Logout" -) - -// AuthServiceClient is the client API for AuthService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type AuthServiceClient interface { - Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error) - Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) - Refresh(ctx context.Context, in *RefreshRequest, opts ...grpc.CallOption) (*RefreshResponse, error) - Validate(ctx context.Context, in *ValidateRequest, opts ...grpc.CallOption) (*ValidateResponse, error) - Logout(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*LogoutResponse, error) -} - -type authServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewAuthServiceClient(cc grpc.ClientConnInterface) AuthServiceClient { - return &authServiceClient{cc} -} - -func (c *authServiceClient) Register(ctx context.Context, in *RegisterRequest, opts ...grpc.CallOption) (*RegisterResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(RegisterResponse) - err := c.cc.Invoke(ctx, AuthService_Register_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authServiceClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(LoginResponse) - err := c.cc.Invoke(ctx, AuthService_Login_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authServiceClient) Refresh(ctx context.Context, in *RefreshRequest, opts ...grpc.CallOption) (*RefreshResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(RefreshResponse) - err := c.cc.Invoke(ctx, AuthService_Refresh_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authServiceClient) Validate(ctx context.Context, in *ValidateRequest, opts ...grpc.CallOption) (*ValidateResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ValidateResponse) - err := c.cc.Invoke(ctx, AuthService_Validate_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *authServiceClient) Logout(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*LogoutResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(LogoutResponse) - err := c.cc.Invoke(ctx, AuthService_Logout_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// AuthServiceServer is the server API for AuthService service. -// All implementations must embed UnimplementedAuthServiceServer -// for forward compatibility. -type AuthServiceServer interface { - Register(context.Context, *RegisterRequest) (*RegisterResponse, error) - Login(context.Context, *LoginRequest) (*LoginResponse, error) - Refresh(context.Context, *RefreshRequest) (*RefreshResponse, error) - Validate(context.Context, *ValidateRequest) (*ValidateResponse, error) - Logout(context.Context, *LogoutRequest) (*LogoutResponse, error) - mustEmbedUnimplementedAuthServiceServer() -} - -// UnimplementedAuthServiceServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedAuthServiceServer struct{} - -func (UnimplementedAuthServiceServer) Register(context.Context, *RegisterRequest) (*RegisterResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Register not implemented") -} -func (UnimplementedAuthServiceServer) Login(context.Context, *LoginRequest) (*LoginResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Login not implemented") -} -func (UnimplementedAuthServiceServer) Refresh(context.Context, *RefreshRequest) (*RefreshResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Refresh not implemented") -} -func (UnimplementedAuthServiceServer) Validate(context.Context, *ValidateRequest) (*ValidateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Validate not implemented") -} -func (UnimplementedAuthServiceServer) Logout(context.Context, *LogoutRequest) (*LogoutResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Logout not implemented") -} -func (UnimplementedAuthServiceServer) mustEmbedUnimplementedAuthServiceServer() {} -func (UnimplementedAuthServiceServer) testEmbeddedByValue() {} - -// UnsafeAuthServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to AuthServiceServer will -// result in compilation errors. -type UnsafeAuthServiceServer interface { - mustEmbedUnimplementedAuthServiceServer() -} - -func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer) { - // If the following call pancis, it indicates UnimplementedAuthServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&AuthService_ServiceDesc, srv) -} - -func _AuthService_Register_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RegisterRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServiceServer).Register(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AuthService_Register_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServiceServer).Register(ctx, req.(*RegisterRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AuthService_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(LoginRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServiceServer).Login(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AuthService_Login_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServiceServer).Login(ctx, req.(*LoginRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AuthService_Refresh_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RefreshRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServiceServer).Refresh(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AuthService_Refresh_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServiceServer).Refresh(ctx, req.(*RefreshRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AuthService_Validate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ValidateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServiceServer).Validate(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AuthService_Validate_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServiceServer).Validate(ctx, req.(*ValidateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _AuthService_Logout_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(LogoutRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AuthServiceServer).Logout(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: AuthService_Logout_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AuthServiceServer).Logout(ctx, req.(*LogoutRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// AuthService_ServiceDesc is the grpc.ServiceDesc for AuthService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var AuthService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "auth.AuthService", - HandlerType: (*AuthServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Register", - Handler: _AuthService_Register_Handler, - }, - { - MethodName: "Login", - Handler: _AuthService_Login_Handler, - }, - { - MethodName: "Refresh", - Handler: _AuthService_Refresh_Handler, - }, - { - MethodName: "Validate", - Handler: _AuthService_Validate_Handler, - }, - { - MethodName: "Logout", - Handler: _AuthService_Logout_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "auth/auth.proto", -} diff --git a/pkg/pb/invite/invite.pb.go b/pkg/pb/invite/invite.pb.go deleted file mode 100644 index 7d7b705..0000000 --- a/pkg/pb/invite/invite.pb.go +++ /dev/null @@ -1,359 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.6 -// protoc v5.29.3 -// source: invite/invite.proto - -package invite - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - 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 GenerateRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - TtlDays int32 `protobuf:"varint,2,opt,name=ttl_days,json=ttlDays,proto3" json:"ttl_days,omitempty"` - MaxUses int32 `protobuf:"varint,3,opt,name=max_uses,json=maxUses,proto3" json:"max_uses,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GenerateRequest) Reset() { - *x = GenerateRequest{} - mi := &file_invite_invite_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GenerateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GenerateRequest) ProtoMessage() {} - -func (x *GenerateRequest) ProtoReflect() protoreflect.Message { - mi := &file_invite_invite_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 GenerateRequest.ProtoReflect.Descriptor instead. -func (*GenerateRequest) Descriptor() ([]byte, []int) { - return file_invite_invite_proto_rawDescGZIP(), []int{0} -} - -func (x *GenerateRequest) GetUserId() int64 { - if x != nil { - return x.UserId - } - return 0 -} - -func (x *GenerateRequest) GetTtlDays() int32 { - if x != nil { - return x.TtlDays - } - return 0 -} - -func (x *GenerateRequest) GetMaxUses() int32 { - if x != nil { - return x.MaxUses - } - return 0 -} - -type GenerateResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` - MaxUses int32 `protobuf:"varint,2,opt,name=max_uses,json=maxUses,proto3" json:"max_uses,omitempty"` - ExpiresAt *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GenerateResponse) Reset() { - *x = GenerateResponse{} - mi := &file_invite_invite_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GenerateResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GenerateResponse) ProtoMessage() {} - -func (x *GenerateResponse) ProtoReflect() protoreflect.Message { - mi := &file_invite_invite_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 GenerateResponse.ProtoReflect.Descriptor instead. -func (*GenerateResponse) Descriptor() ([]byte, []int) { - return file_invite_invite_proto_rawDescGZIP(), []int{1} -} - -func (x *GenerateResponse) GetCode() string { - if x != nil { - return x.Code - } - return "" -} - -func (x *GenerateResponse) GetMaxUses() int32 { - if x != nil { - return x.MaxUses - } - return 0 -} - -func (x *GenerateResponse) GetExpiresAt() *timestamppb.Timestamp { - if x != nil { - return x.ExpiresAt - } - return nil -} - -type GetInfoRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetInfoRequest) Reset() { - *x = GetInfoRequest{} - mi := &file_invite_invite_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetInfoRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetInfoRequest) ProtoMessage() {} - -func (x *GetInfoRequest) ProtoReflect() protoreflect.Message { - mi := &file_invite_invite_proto_msgTypes[2] - 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 GetInfoRequest.ProtoReflect.Descriptor instead. -func (*GetInfoRequest) Descriptor() ([]byte, []int) { - return file_invite_invite_proto_rawDescGZIP(), []int{2} -} - -func (x *GetInfoRequest) GetCode() string { - if x != nil { - return x.Code - } - return "" -} - -type GetInfoResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` - UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - CanBeUsedCount int32 `protobuf:"varint,3,opt,name=can_be_used_count,json=canBeUsedCount,proto3" json:"can_be_used_count,omitempty"` - ExpiresAt *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=expires_at,json=expiresAt,proto3" json:"expires_at,omitempty"` - IsActive bool `protobuf:"varint,5,opt,name=is_active,json=isActive,proto3" json:"is_active,omitempty"` - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetInfoResponse) Reset() { - *x = GetInfoResponse{} - mi := &file_invite_invite_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetInfoResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetInfoResponse) ProtoMessage() {} - -func (x *GetInfoResponse) ProtoReflect() protoreflect.Message { - mi := &file_invite_invite_proto_msgTypes[3] - 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 GetInfoResponse.ProtoReflect.Descriptor instead. -func (*GetInfoResponse) Descriptor() ([]byte, []int) { - return file_invite_invite_proto_rawDescGZIP(), []int{3} -} - -func (x *GetInfoResponse) GetCode() string { - if x != nil { - return x.Code - } - return "" -} - -func (x *GetInfoResponse) GetUserId() int64 { - if x != nil { - return x.UserId - } - return 0 -} - -func (x *GetInfoResponse) GetCanBeUsedCount() int32 { - if x != nil { - return x.CanBeUsedCount - } - return 0 -} - -func (x *GetInfoResponse) GetExpiresAt() *timestamppb.Timestamp { - if x != nil { - return x.ExpiresAt - } - return nil -} - -func (x *GetInfoResponse) GetIsActive() bool { - if x != nil { - return x.IsActive - } - return false -} - -func (x *GetInfoResponse) GetCreatedAt() *timestamppb.Timestamp { - if x != nil { - return x.CreatedAt - } - return nil -} - -var File_invite_invite_proto protoreflect.FileDescriptor - -const file_invite_invite_proto_rawDesc = "" + - "\n" + - "\x13invite/invite.proto\x12\x06invite\x1a\x1fgoogle/protobuf/timestamp.proto\"`\n" + - "\x0fGenerateRequest\x12\x17\n" + - "\auser_id\x18\x01 \x01(\x03R\x06userId\x12\x19\n" + - "\bttl_days\x18\x02 \x01(\x05R\attlDays\x12\x19\n" + - "\bmax_uses\x18\x03 \x01(\x05R\amaxUses\"|\n" + - "\x10GenerateResponse\x12\x12\n" + - "\x04code\x18\x01 \x01(\tR\x04code\x12\x19\n" + - "\bmax_uses\x18\x02 \x01(\x05R\amaxUses\x129\n" + - "\n" + - "expires_at\x18\x03 \x01(\v2\x1a.google.protobuf.TimestampR\texpiresAt\"$\n" + - "\x0eGetInfoRequest\x12\x12\n" + - "\x04code\x18\x01 \x01(\tR\x04code\"\xfc\x01\n" + - "\x0fGetInfoResponse\x12\x12\n" + - "\x04code\x18\x01 \x01(\tR\x04code\x12\x17\n" + - "\auser_id\x18\x02 \x01(\x03R\x06userId\x12)\n" + - "\x11can_be_used_count\x18\x03 \x01(\x05R\x0ecanBeUsedCount\x129\n" + - "\n" + - "expires_at\x18\x04 \x01(\v2\x1a.google.protobuf.TimestampR\texpiresAt\x12\x1b\n" + - "\tis_active\x18\x05 \x01(\bR\bisActive\x129\n" + - "\n" + - "created_at\x18\x06 \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt2\x8a\x01\n" + - "\rInviteService\x12=\n" + - "\bGenerate\x12\x17.invite.GenerateRequest\x1a\x18.invite.GenerateResponse\x12:\n" + - "\aGetInfo\x12\x16.invite.GetInfoRequest\x1a\x17.invite.GetInfoResponseB>Z google.protobuf.Timestamp - 4, // 1: invite.GetInfoResponse.expires_at:type_name -> google.protobuf.Timestamp - 4, // 2: invite.GetInfoResponse.created_at:type_name -> google.protobuf.Timestamp - 0, // 3: invite.InviteService.Generate:input_type -> invite.GenerateRequest - 2, // 4: invite.InviteService.GetInfo:input_type -> invite.GetInfoRequest - 1, // 5: invite.InviteService.Generate:output_type -> invite.GenerateResponse - 3, // 6: invite.InviteService.GetInfo:output_type -> invite.GetInfoResponse - 5, // [5:7] is the sub-list for method output_type - 3, // [3:5] 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 -} - -func init() { file_invite_invite_proto_init() } -func file_invite_invite_proto_init() { - if File_invite_invite_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_invite_invite_proto_rawDesc), len(file_invite_invite_proto_rawDesc)), - NumEnums: 0, - NumMessages: 4, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_invite_invite_proto_goTypes, - DependencyIndexes: file_invite_invite_proto_depIdxs, - MessageInfos: file_invite_invite_proto_msgTypes, - }.Build() - File_invite_invite_proto = out.File - file_invite_invite_proto_goTypes = nil - file_invite_invite_proto_depIdxs = nil -} diff --git a/pkg/pb/invite/invite_grpc.pb.go b/pkg/pb/invite/invite_grpc.pb.go deleted file mode 100644 index 0949b3a..0000000 --- a/pkg/pb/invite/invite_grpc.pb.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.5.1 -// - protoc v5.29.3 -// source: invite/invite.proto - -package invite - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - InviteService_Generate_FullMethodName = "/invite.InviteService/Generate" - InviteService_GetInfo_FullMethodName = "/invite.InviteService/GetInfo" -) - -// InviteServiceClient is the client API for InviteService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type InviteServiceClient interface { - Generate(ctx context.Context, in *GenerateRequest, opts ...grpc.CallOption) (*GenerateResponse, error) - GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error) -} - -type inviteServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewInviteServiceClient(cc grpc.ClientConnInterface) InviteServiceClient { - return &inviteServiceClient{cc} -} - -func (c *inviteServiceClient) Generate(ctx context.Context, in *GenerateRequest, opts ...grpc.CallOption) (*GenerateResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GenerateResponse) - err := c.cc.Invoke(ctx, InviteService_Generate_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *inviteServiceClient) GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetInfoResponse) - err := c.cc.Invoke(ctx, InviteService_GetInfo_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// InviteServiceServer is the server API for InviteService service. -// All implementations must embed UnimplementedInviteServiceServer -// for forward compatibility. -type InviteServiceServer interface { - Generate(context.Context, *GenerateRequest) (*GenerateResponse, error) - GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error) - mustEmbedUnimplementedInviteServiceServer() -} - -// UnimplementedInviteServiceServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedInviteServiceServer struct{} - -func (UnimplementedInviteServiceServer) Generate(context.Context, *GenerateRequest) (*GenerateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Generate not implemented") -} -func (UnimplementedInviteServiceServer) GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented") -} -func (UnimplementedInviteServiceServer) mustEmbedUnimplementedInviteServiceServer() {} -func (UnimplementedInviteServiceServer) testEmbeddedByValue() {} - -// UnsafeInviteServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to InviteServiceServer will -// result in compilation errors. -type UnsafeInviteServiceServer interface { - mustEmbedUnimplementedInviteServiceServer() -} - -func RegisterInviteServiceServer(s grpc.ServiceRegistrar, srv InviteServiceServer) { - // If the following call pancis, it indicates UnimplementedInviteServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&InviteService_ServiceDesc, srv) -} - -func _InviteService_Generate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GenerateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(InviteServiceServer).Generate(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: InviteService_Generate_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(InviteServiceServer).Generate(ctx, req.(*GenerateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _InviteService_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetInfoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(InviteServiceServer).GetInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: InviteService_GetInfo_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(InviteServiceServer).GetInfo(ctx, req.(*GetInfoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// InviteService_ServiceDesc is the grpc.ServiceDesc for InviteService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var InviteService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "invite.InviteService", - HandlerType: (*InviteServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Generate", - Handler: _InviteService_Generate_Handler, - }, - { - MethodName: "GetInfo", - Handler: _InviteService_GetInfo_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "invite/invite.proto", -} diff --git a/pkg/pb/request/request.pb.go b/pkg/pb/request/request.pb.go deleted file mode 100644 index f818147..0000000 --- a/pkg/pb/request/request.pb.go +++ /dev/null @@ -1,640 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.6 -// protoc v5.29.3 -// source: request/request.proto - -package request - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - 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 CreateTZRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - RequestTxt string `protobuf:"bytes,2,opt,name=request_txt,json=requestTxt,proto3" json:"request_txt,omitempty"` - FileData []byte `protobuf:"bytes,3,opt,name=file_data,json=fileData,proto3" json:"file_data,omitempty"` - FileName string `protobuf:"bytes,4,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreateTZRequest) Reset() { - *x = CreateTZRequest{} - mi := &file_request_request_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreateTZRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateTZRequest) ProtoMessage() {} - -func (x *CreateTZRequest) ProtoReflect() protoreflect.Message { - mi := &file_request_request_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 CreateTZRequest.ProtoReflect.Descriptor instead. -func (*CreateTZRequest) Descriptor() ([]byte, []int) { - return file_request_request_proto_rawDescGZIP(), []int{0} -} - -func (x *CreateTZRequest) GetUserId() int64 { - if x != nil { - return x.UserId - } - return 0 -} - -func (x *CreateTZRequest) GetRequestTxt() string { - if x != nil { - return x.RequestTxt - } - return "" -} - -func (x *CreateTZRequest) GetFileData() []byte { - if x != nil { - return x.FileData - } - return nil -} - -func (x *CreateTZRequest) GetFileName() string { - if x != nil { - return x.FileName - } - return "" -} - -type CreateTZResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` - TzText string `protobuf:"bytes,2,opt,name=tz_text,json=tzText,proto3" json:"tz_text,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *CreateTZResponse) Reset() { - *x = CreateTZResponse{} - mi := &file_request_request_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *CreateTZResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateTZResponse) ProtoMessage() {} - -func (x *CreateTZResponse) ProtoReflect() protoreflect.Message { - mi := &file_request_request_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 CreateTZResponse.ProtoReflect.Descriptor instead. -func (*CreateTZResponse) Descriptor() ([]byte, []int) { - return file_request_request_proto_rawDescGZIP(), []int{1} -} - -func (x *CreateTZResponse) GetRequestId() string { - if x != nil { - return x.RequestId - } - return "" -} - -func (x *CreateTZResponse) GetTzText() string { - if x != nil { - return x.TzText - } - return "" -} - -type ApproveTZRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` - FinalTz string `protobuf:"bytes,2,opt,name=final_tz,json=finalTz,proto3" json:"final_tz,omitempty"` - UserId int64 `protobuf:"varint,3,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ApproveTZRequest) Reset() { - *x = ApproveTZRequest{} - mi := &file_request_request_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ApproveTZRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ApproveTZRequest) ProtoMessage() {} - -func (x *ApproveTZRequest) ProtoReflect() protoreflect.Message { - mi := &file_request_request_proto_msgTypes[2] - 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 ApproveTZRequest.ProtoReflect.Descriptor instead. -func (*ApproveTZRequest) Descriptor() ([]byte, []int) { - return file_request_request_proto_rawDescGZIP(), []int{2} -} - -func (x *ApproveTZRequest) GetRequestId() string { - if x != nil { - return x.RequestId - } - return "" -} - -func (x *ApproveTZRequest) GetFinalTz() string { - if x != nil { - return x.FinalTz - } - return "" -} - -func (x *ApproveTZRequest) GetUserId() int64 { - if x != nil { - return x.UserId - } - return 0 -} - -type ApproveTZResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` - MailingStatus string `protobuf:"bytes,2,opt,name=mailing_status,json=mailingStatus,proto3" json:"mailing_status,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ApproveTZResponse) Reset() { - *x = ApproveTZResponse{} - mi := &file_request_request_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ApproveTZResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ApproveTZResponse) ProtoMessage() {} - -func (x *ApproveTZResponse) ProtoReflect() protoreflect.Message { - mi := &file_request_request_proto_msgTypes[3] - 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 ApproveTZResponse.ProtoReflect.Descriptor instead. -func (*ApproveTZResponse) Descriptor() ([]byte, []int) { - return file_request_request_proto_rawDescGZIP(), []int{3} -} - -func (x *ApproveTZResponse) GetSuccess() bool { - if x != nil { - return x.Success - } - return false -} - -func (x *ApproveTZResponse) GetMailingStatus() string { - if x != nil { - return x.MailingStatus - } - return "" -} - -type GetMailingListRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetMailingListRequest) Reset() { - *x = GetMailingListRequest{} - mi := &file_request_request_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetMailingListRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetMailingListRequest) ProtoMessage() {} - -func (x *GetMailingListRequest) ProtoReflect() protoreflect.Message { - mi := &file_request_request_proto_msgTypes[4] - 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 GetMailingListRequest.ProtoReflect.Descriptor instead. -func (*GetMailingListRequest) Descriptor() ([]byte, []int) { - return file_request_request_proto_rawDescGZIP(), []int{4} -} - -func (x *GetMailingListRequest) GetUserId() int64 { - if x != nil { - return x.UserId - } - return 0 -} - -type GetMailingListResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Items []*MailingItem `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetMailingListResponse) Reset() { - *x = GetMailingListResponse{} - mi := &file_request_request_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetMailingListResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetMailingListResponse) ProtoMessage() {} - -func (x *GetMailingListResponse) ProtoReflect() protoreflect.Message { - mi := &file_request_request_proto_msgTypes[5] - 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 GetMailingListResponse.ProtoReflect.Descriptor instead. -func (*GetMailingListResponse) Descriptor() ([]byte, []int) { - return file_request_request_proto_rawDescGZIP(), []int{5} -} - -func (x *GetMailingListResponse) GetItems() []*MailingItem { - if x != nil { - return x.Items - } - return nil -} - -type GetMailingListByIDRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` - UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetMailingListByIDRequest) Reset() { - *x = GetMailingListByIDRequest{} - mi := &file_request_request_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetMailingListByIDRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetMailingListByIDRequest) ProtoMessage() {} - -func (x *GetMailingListByIDRequest) ProtoReflect() protoreflect.Message { - mi := &file_request_request_proto_msgTypes[6] - 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 GetMailingListByIDRequest.ProtoReflect.Descriptor instead. -func (*GetMailingListByIDRequest) Descriptor() ([]byte, []int) { - return file_request_request_proto_rawDescGZIP(), []int{6} -} - -func (x *GetMailingListByIDRequest) GetRequestId() string { - if x != nil { - return x.RequestId - } - return "" -} - -func (x *GetMailingListByIDRequest) GetUserId() int64 { - if x != nil { - return x.UserId - } - return 0 -} - -type GetMailingListByIDResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Item *MailingItem `protobuf:"bytes,1,opt,name=item,proto3" json:"item,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetMailingListByIDResponse) Reset() { - *x = GetMailingListByIDResponse{} - mi := &file_request_request_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetMailingListByIDResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetMailingListByIDResponse) ProtoMessage() {} - -func (x *GetMailingListByIDResponse) ProtoReflect() protoreflect.Message { - mi := &file_request_request_proto_msgTypes[7] - 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 GetMailingListByIDResponse.ProtoReflect.Descriptor instead. -func (*GetMailingListByIDResponse) Descriptor() ([]byte, []int) { - return file_request_request_proto_rawDescGZIP(), []int{7} -} - -func (x *GetMailingListByIDResponse) GetItem() *MailingItem { - if x != nil { - return x.Item - } - return nil -} - -type MailingItem struct { - state protoimpl.MessageState `protogen:"open.v1"` - RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` - RequestTxt string `protobuf:"bytes,2,opt,name=request_txt,json=requestTxt,proto3" json:"request_txt,omitempty"` - FinalTz string `protobuf:"bytes,3,opt,name=final_tz,json=finalTz,proto3" json:"final_tz,omitempty"` - MailingStatus string `protobuf:"bytes,4,opt,name=mailing_status,json=mailingStatus,proto3" json:"mailing_status,omitempty"` - CreatedAt *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` - SuppliersFound int32 `protobuf:"varint,6,opt,name=suppliers_found,json=suppliersFound,proto3" json:"suppliers_found,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *MailingItem) Reset() { - *x = MailingItem{} - mi := &file_request_request_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *MailingItem) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MailingItem) ProtoMessage() {} - -func (x *MailingItem) ProtoReflect() protoreflect.Message { - mi := &file_request_request_proto_msgTypes[8] - 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 MailingItem.ProtoReflect.Descriptor instead. -func (*MailingItem) Descriptor() ([]byte, []int) { - return file_request_request_proto_rawDescGZIP(), []int{8} -} - -func (x *MailingItem) GetRequestId() string { - if x != nil { - return x.RequestId - } - return "" -} - -func (x *MailingItem) GetRequestTxt() string { - if x != nil { - return x.RequestTxt - } - return "" -} - -func (x *MailingItem) GetFinalTz() string { - if x != nil { - return x.FinalTz - } - return "" -} - -func (x *MailingItem) GetMailingStatus() string { - if x != nil { - return x.MailingStatus - } - return "" -} - -func (x *MailingItem) GetCreatedAt() *timestamppb.Timestamp { - if x != nil { - return x.CreatedAt - } - return nil -} - -func (x *MailingItem) GetSuppliersFound() int32 { - if x != nil { - return x.SuppliersFound - } - return 0 -} - -var File_request_request_proto protoreflect.FileDescriptor - -const file_request_request_proto_rawDesc = "" + - "\n" + - "\x15request/request.proto\x12\arequest\x1a\x1fgoogle/protobuf/timestamp.proto\"\x85\x01\n" + - "\x0fCreateTZRequest\x12\x17\n" + - "\auser_id\x18\x01 \x01(\x03R\x06userId\x12\x1f\n" + - "\vrequest_txt\x18\x02 \x01(\tR\n" + - "requestTxt\x12\x1b\n" + - "\tfile_data\x18\x03 \x01(\fR\bfileData\x12\x1b\n" + - "\tfile_name\x18\x04 \x01(\tR\bfileName\"J\n" + - "\x10CreateTZResponse\x12\x1d\n" + - "\n" + - "request_id\x18\x01 \x01(\tR\trequestId\x12\x17\n" + - "\atz_text\x18\x02 \x01(\tR\x06tzText\"e\n" + - "\x10ApproveTZRequest\x12\x1d\n" + - "\n" + - "request_id\x18\x01 \x01(\tR\trequestId\x12\x19\n" + - "\bfinal_tz\x18\x02 \x01(\tR\afinalTz\x12\x17\n" + - "\auser_id\x18\x03 \x01(\x03R\x06userId\"T\n" + - "\x11ApproveTZResponse\x12\x18\n" + - "\asuccess\x18\x01 \x01(\bR\asuccess\x12%\n" + - "\x0emailing_status\x18\x02 \x01(\tR\rmailingStatus\"0\n" + - "\x15GetMailingListRequest\x12\x17\n" + - "\auser_id\x18\x01 \x01(\x03R\x06userId\"D\n" + - "\x16GetMailingListResponse\x12*\n" + - "\x05items\x18\x01 \x03(\v2\x14.request.MailingItemR\x05items\"S\n" + - "\x19GetMailingListByIDRequest\x12\x1d\n" + - "\n" + - "request_id\x18\x01 \x01(\tR\trequestId\x12\x17\n" + - "\auser_id\x18\x02 \x01(\x03R\x06userId\"F\n" + - "\x1aGetMailingListByIDResponse\x12(\n" + - "\x04item\x18\x01 \x01(\v2\x14.request.MailingItemR\x04item\"\xf3\x01\n" + - "\vMailingItem\x12\x1d\n" + - "\n" + - "request_id\x18\x01 \x01(\tR\trequestId\x12\x1f\n" + - "\vrequest_txt\x18\x02 \x01(\tR\n" + - "requestTxt\x12\x19\n" + - "\bfinal_tz\x18\x03 \x01(\tR\afinalTz\x12%\n" + - "\x0emailing_status\x18\x04 \x01(\tR\rmailingStatus\x129\n" + - "\n" + - "created_at\x18\x05 \x01(\v2\x1a.google.protobuf.TimestampR\tcreatedAt\x12'\n" + - "\x0fsuppliers_found\x18\x06 \x01(\x05R\x0esuppliersFound2\xc7\x02\n" + - "\x0eRequestService\x12?\n" + - "\bCreateTZ\x12\x18.request.CreateTZRequest\x1a\x19.request.CreateTZResponse\x12B\n" + - "\tApproveTZ\x12\x19.request.ApproveTZRequest\x1a\x1a.request.ApproveTZResponse\x12Q\n" + - "\x0eGetMailingList\x12\x1e.request.GetMailingListRequest\x1a\x1f.request.GetMailingListResponse\x12]\n" + - "\x12GetMailingListByID\x12\".request.GetMailingListByIDRequest\x1a#.request.GetMailingListByIDResponseB?Z=git.techease.ru/Smart-search/smart-search-back/pkg/pb/requestb\x06proto3" - -var ( - file_request_request_proto_rawDescOnce sync.Once - file_request_request_proto_rawDescData []byte -) - -func file_request_request_proto_rawDescGZIP() []byte { - file_request_request_proto_rawDescOnce.Do(func() { - file_request_request_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_request_request_proto_rawDesc), len(file_request_request_proto_rawDesc))) - }) - return file_request_request_proto_rawDescData -} - -var file_request_request_proto_msgTypes = make([]protoimpl.MessageInfo, 9) -var file_request_request_proto_goTypes = []any{ - (*CreateTZRequest)(nil), // 0: request.CreateTZRequest - (*CreateTZResponse)(nil), // 1: request.CreateTZResponse - (*ApproveTZRequest)(nil), // 2: request.ApproveTZRequest - (*ApproveTZResponse)(nil), // 3: request.ApproveTZResponse - (*GetMailingListRequest)(nil), // 4: request.GetMailingListRequest - (*GetMailingListResponse)(nil), // 5: request.GetMailingListResponse - (*GetMailingListByIDRequest)(nil), // 6: request.GetMailingListByIDRequest - (*GetMailingListByIDResponse)(nil), // 7: request.GetMailingListByIDResponse - (*MailingItem)(nil), // 8: request.MailingItem - (*timestamppb.Timestamp)(nil), // 9: google.protobuf.Timestamp -} -var file_request_request_proto_depIdxs = []int32{ - 8, // 0: request.GetMailingListResponse.items:type_name -> request.MailingItem - 8, // 1: request.GetMailingListByIDResponse.item:type_name -> request.MailingItem - 9, // 2: request.MailingItem.created_at:type_name -> google.protobuf.Timestamp - 0, // 3: request.RequestService.CreateTZ:input_type -> request.CreateTZRequest - 2, // 4: request.RequestService.ApproveTZ:input_type -> request.ApproveTZRequest - 4, // 5: request.RequestService.GetMailingList:input_type -> request.GetMailingListRequest - 6, // 6: request.RequestService.GetMailingListByID:input_type -> request.GetMailingListByIDRequest - 1, // 7: request.RequestService.CreateTZ:output_type -> request.CreateTZResponse - 3, // 8: request.RequestService.ApproveTZ:output_type -> request.ApproveTZResponse - 5, // 9: request.RequestService.GetMailingList:output_type -> request.GetMailingListResponse - 7, // 10: request.RequestService.GetMailingListByID:output_type -> request.GetMailingListByIDResponse - 7, // [7:11] is the sub-list for method output_type - 3, // [3:7] 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 -} - -func init() { file_request_request_proto_init() } -func file_request_request_proto_init() { - if File_request_request_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_request_request_proto_rawDesc), len(file_request_request_proto_rawDesc)), - NumEnums: 0, - NumMessages: 9, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_request_request_proto_goTypes, - DependencyIndexes: file_request_request_proto_depIdxs, - MessageInfos: file_request_request_proto_msgTypes, - }.Build() - File_request_request_proto = out.File - file_request_request_proto_goTypes = nil - file_request_request_proto_depIdxs = nil -} diff --git a/pkg/pb/request/request_grpc.pb.go b/pkg/pb/request/request_grpc.pb.go deleted file mode 100644 index c28b720..0000000 --- a/pkg/pb/request/request_grpc.pb.go +++ /dev/null @@ -1,235 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.5.1 -// - protoc v5.29.3 -// source: request/request.proto - -package request - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - RequestService_CreateTZ_FullMethodName = "/request.RequestService/CreateTZ" - RequestService_ApproveTZ_FullMethodName = "/request.RequestService/ApproveTZ" - RequestService_GetMailingList_FullMethodName = "/request.RequestService/GetMailingList" - RequestService_GetMailingListByID_FullMethodName = "/request.RequestService/GetMailingListByID" -) - -// RequestServiceClient is the client API for RequestService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type RequestServiceClient interface { - CreateTZ(ctx context.Context, in *CreateTZRequest, opts ...grpc.CallOption) (*CreateTZResponse, error) - ApproveTZ(ctx context.Context, in *ApproveTZRequest, opts ...grpc.CallOption) (*ApproveTZResponse, error) - GetMailingList(ctx context.Context, in *GetMailingListRequest, opts ...grpc.CallOption) (*GetMailingListResponse, error) - GetMailingListByID(ctx context.Context, in *GetMailingListByIDRequest, opts ...grpc.CallOption) (*GetMailingListByIDResponse, error) -} - -type requestServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewRequestServiceClient(cc grpc.ClientConnInterface) RequestServiceClient { - return &requestServiceClient{cc} -} - -func (c *requestServiceClient) CreateTZ(ctx context.Context, in *CreateTZRequest, opts ...grpc.CallOption) (*CreateTZResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(CreateTZResponse) - err := c.cc.Invoke(ctx, RequestService_CreateTZ_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *requestServiceClient) ApproveTZ(ctx context.Context, in *ApproveTZRequest, opts ...grpc.CallOption) (*ApproveTZResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ApproveTZResponse) - err := c.cc.Invoke(ctx, RequestService_ApproveTZ_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *requestServiceClient) GetMailingList(ctx context.Context, in *GetMailingListRequest, opts ...grpc.CallOption) (*GetMailingListResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetMailingListResponse) - err := c.cc.Invoke(ctx, RequestService_GetMailingList_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *requestServiceClient) GetMailingListByID(ctx context.Context, in *GetMailingListByIDRequest, opts ...grpc.CallOption) (*GetMailingListByIDResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetMailingListByIDResponse) - err := c.cc.Invoke(ctx, RequestService_GetMailingListByID_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// RequestServiceServer is the server API for RequestService service. -// All implementations must embed UnimplementedRequestServiceServer -// for forward compatibility. -type RequestServiceServer interface { - CreateTZ(context.Context, *CreateTZRequest) (*CreateTZResponse, error) - ApproveTZ(context.Context, *ApproveTZRequest) (*ApproveTZResponse, error) - GetMailingList(context.Context, *GetMailingListRequest) (*GetMailingListResponse, error) - GetMailingListByID(context.Context, *GetMailingListByIDRequest) (*GetMailingListByIDResponse, error) - mustEmbedUnimplementedRequestServiceServer() -} - -// UnimplementedRequestServiceServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedRequestServiceServer struct{} - -func (UnimplementedRequestServiceServer) CreateTZ(context.Context, *CreateTZRequest) (*CreateTZResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateTZ not implemented") -} -func (UnimplementedRequestServiceServer) ApproveTZ(context.Context, *ApproveTZRequest) (*ApproveTZResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ApproveTZ not implemented") -} -func (UnimplementedRequestServiceServer) GetMailingList(context.Context, *GetMailingListRequest) (*GetMailingListResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetMailingList not implemented") -} -func (UnimplementedRequestServiceServer) GetMailingListByID(context.Context, *GetMailingListByIDRequest) (*GetMailingListByIDResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetMailingListByID not implemented") -} -func (UnimplementedRequestServiceServer) mustEmbedUnimplementedRequestServiceServer() {} -func (UnimplementedRequestServiceServer) testEmbeddedByValue() {} - -// UnsafeRequestServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to RequestServiceServer will -// result in compilation errors. -type UnsafeRequestServiceServer interface { - mustEmbedUnimplementedRequestServiceServer() -} - -func RegisterRequestServiceServer(s grpc.ServiceRegistrar, srv RequestServiceServer) { - // If the following call pancis, it indicates UnimplementedRequestServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&RequestService_ServiceDesc, srv) -} - -func _RequestService_CreateTZ_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateTZRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RequestServiceServer).CreateTZ(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: RequestService_CreateTZ_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RequestServiceServer).CreateTZ(ctx, req.(*CreateTZRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RequestService_ApproveTZ_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ApproveTZRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RequestServiceServer).ApproveTZ(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: RequestService_ApproveTZ_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RequestServiceServer).ApproveTZ(ctx, req.(*ApproveTZRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RequestService_GetMailingList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetMailingListRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RequestServiceServer).GetMailingList(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: RequestService_GetMailingList_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RequestServiceServer).GetMailingList(ctx, req.(*GetMailingListRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _RequestService_GetMailingListByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetMailingListByIDRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RequestServiceServer).GetMailingListByID(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: RequestService_GetMailingListByID_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RequestServiceServer).GetMailingListByID(ctx, req.(*GetMailingListByIDRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// RequestService_ServiceDesc is the grpc.ServiceDesc for RequestService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var RequestService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "request.RequestService", - HandlerType: (*RequestServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "CreateTZ", - Handler: _RequestService_CreateTZ_Handler, - }, - { - MethodName: "ApproveTZ", - Handler: _RequestService_ApproveTZ_Handler, - }, - { - MethodName: "GetMailingList", - Handler: _RequestService_GetMailingList_Handler, - }, - { - MethodName: "GetMailingListByID", - Handler: _RequestService_GetMailingListByID_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "request/request.proto", -} diff --git a/pkg/pb/supplier/supplier.pb.go b/pkg/pb/supplier/supplier.pb.go deleted file mode 100644 index e9121e5..0000000 --- a/pkg/pb/supplier/supplier.pb.go +++ /dev/null @@ -1,201 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.6 -// protoc v5.29.3 -// source: supplier/supplier.proto - -package supplier - -import ( - 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 ExportExcelRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - RequestId string `protobuf:"bytes,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"` - UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ExportExcelRequest) Reset() { - *x = ExportExcelRequest{} - mi := &file_supplier_supplier_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ExportExcelRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExportExcelRequest) ProtoMessage() {} - -func (x *ExportExcelRequest) ProtoReflect() protoreflect.Message { - mi := &file_supplier_supplier_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 ExportExcelRequest.ProtoReflect.Descriptor instead. -func (*ExportExcelRequest) Descriptor() ([]byte, []int) { - return file_supplier_supplier_proto_rawDescGZIP(), []int{0} -} - -func (x *ExportExcelRequest) GetRequestId() string { - if x != nil { - return x.RequestId - } - return "" -} - -func (x *ExportExcelRequest) GetUserId() int64 { - if x != nil { - return x.UserId - } - return 0 -} - -type ExportExcelResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - FileData []byte `protobuf:"bytes,1,opt,name=file_data,json=fileData,proto3" json:"file_data,omitempty"` - FileName string `protobuf:"bytes,2,opt,name=file_name,json=fileName,proto3" json:"file_name,omitempty"` - MimeType string `protobuf:"bytes,3,opt,name=mime_type,json=mimeType,proto3" json:"mime_type,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *ExportExcelResponse) Reset() { - *x = ExportExcelResponse{} - mi := &file_supplier_supplier_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *ExportExcelResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ExportExcelResponse) ProtoMessage() {} - -func (x *ExportExcelResponse) ProtoReflect() protoreflect.Message { - mi := &file_supplier_supplier_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 ExportExcelResponse.ProtoReflect.Descriptor instead. -func (*ExportExcelResponse) Descriptor() ([]byte, []int) { - return file_supplier_supplier_proto_rawDescGZIP(), []int{1} -} - -func (x *ExportExcelResponse) GetFileData() []byte { - if x != nil { - return x.FileData - } - return nil -} - -func (x *ExportExcelResponse) GetFileName() string { - if x != nil { - return x.FileName - } - return "" -} - -func (x *ExportExcelResponse) GetMimeType() string { - if x != nil { - return x.MimeType - } - return "" -} - -var File_supplier_supplier_proto protoreflect.FileDescriptor - -const file_supplier_supplier_proto_rawDesc = "" + - "\n" + - "\x17supplier/supplier.proto\x12\bsupplier\"L\n" + - "\x12ExportExcelRequest\x12\x1d\n" + - "\n" + - "request_id\x18\x01 \x01(\tR\trequestId\x12\x17\n" + - "\auser_id\x18\x02 \x01(\x03R\x06userId\"l\n" + - "\x13ExportExcelResponse\x12\x1b\n" + - "\tfile_data\x18\x01 \x01(\fR\bfileData\x12\x1b\n" + - "\tfile_name\x18\x02 \x01(\tR\bfileName\x12\x1b\n" + - "\tmime_type\x18\x03 \x01(\tR\bmimeType2]\n" + - "\x0fSupplierService\x12J\n" + - "\vExportExcel\x12\x1c.supplier.ExportExcelRequest\x1a\x1d.supplier.ExportExcelResponseB@Z>git.techease.ru/Smart-search/smart-search-back/pkg/pb/supplierb\x06proto3" - -var ( - file_supplier_supplier_proto_rawDescOnce sync.Once - file_supplier_supplier_proto_rawDescData []byte -) - -func file_supplier_supplier_proto_rawDescGZIP() []byte { - file_supplier_supplier_proto_rawDescOnce.Do(func() { - file_supplier_supplier_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_supplier_supplier_proto_rawDesc), len(file_supplier_supplier_proto_rawDesc))) - }) - return file_supplier_supplier_proto_rawDescData -} - -var file_supplier_supplier_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_supplier_supplier_proto_goTypes = []any{ - (*ExportExcelRequest)(nil), // 0: supplier.ExportExcelRequest - (*ExportExcelResponse)(nil), // 1: supplier.ExportExcelResponse -} -var file_supplier_supplier_proto_depIdxs = []int32{ - 0, // 0: supplier.SupplierService.ExportExcel:input_type -> supplier.ExportExcelRequest - 1, // 1: supplier.SupplierService.ExportExcel:output_type -> supplier.ExportExcelResponse - 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_supplier_supplier_proto_init() } -func file_supplier_supplier_proto_init() { - if File_supplier_supplier_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_supplier_supplier_proto_rawDesc), len(file_supplier_supplier_proto_rawDesc)), - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_supplier_supplier_proto_goTypes, - DependencyIndexes: file_supplier_supplier_proto_depIdxs, - MessageInfos: file_supplier_supplier_proto_msgTypes, - }.Build() - File_supplier_supplier_proto = out.File - file_supplier_supplier_proto_goTypes = nil - file_supplier_supplier_proto_depIdxs = nil -} diff --git a/pkg/pb/supplier/supplier_grpc.pb.go b/pkg/pb/supplier/supplier_grpc.pb.go deleted file mode 100644 index 02bff7e..0000000 --- a/pkg/pb/supplier/supplier_grpc.pb.go +++ /dev/null @@ -1,121 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.5.1 -// - protoc v5.29.3 -// source: supplier/supplier.proto - -package supplier - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - SupplierService_ExportExcel_FullMethodName = "/supplier.SupplierService/ExportExcel" -) - -// SupplierServiceClient is the client API for SupplierService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type SupplierServiceClient interface { - ExportExcel(ctx context.Context, in *ExportExcelRequest, opts ...grpc.CallOption) (*ExportExcelResponse, error) -} - -type supplierServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewSupplierServiceClient(cc grpc.ClientConnInterface) SupplierServiceClient { - return &supplierServiceClient{cc} -} - -func (c *supplierServiceClient) ExportExcel(ctx context.Context, in *ExportExcelRequest, opts ...grpc.CallOption) (*ExportExcelResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(ExportExcelResponse) - err := c.cc.Invoke(ctx, SupplierService_ExportExcel_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// SupplierServiceServer is the server API for SupplierService service. -// All implementations must embed UnimplementedSupplierServiceServer -// for forward compatibility. -type SupplierServiceServer interface { - ExportExcel(context.Context, *ExportExcelRequest) (*ExportExcelResponse, error) - mustEmbedUnimplementedSupplierServiceServer() -} - -// UnimplementedSupplierServiceServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedSupplierServiceServer struct{} - -func (UnimplementedSupplierServiceServer) ExportExcel(context.Context, *ExportExcelRequest) (*ExportExcelResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ExportExcel not implemented") -} -func (UnimplementedSupplierServiceServer) mustEmbedUnimplementedSupplierServiceServer() {} -func (UnimplementedSupplierServiceServer) testEmbeddedByValue() {} - -// UnsafeSupplierServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to SupplierServiceServer will -// result in compilation errors. -type UnsafeSupplierServiceServer interface { - mustEmbedUnimplementedSupplierServiceServer() -} - -func RegisterSupplierServiceServer(s grpc.ServiceRegistrar, srv SupplierServiceServer) { - // If the following call pancis, it indicates UnimplementedSupplierServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&SupplierService_ServiceDesc, srv) -} - -func _SupplierService_ExportExcel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ExportExcelRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(SupplierServiceServer).ExportExcel(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: SupplierService_ExportExcel_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(SupplierServiceServer).ExportExcel(ctx, req.(*ExportExcelRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// SupplierService_ServiceDesc is the grpc.ServiceDesc for SupplierService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var SupplierService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "supplier.SupplierService", - HandlerType: (*SupplierServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ExportExcel", - Handler: _SupplierService_ExportExcel_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "supplier/supplier.proto", -} diff --git a/pkg/pb/user/user.pb.go b/pkg/pb/user/user.pb.go deleted file mode 100644 index 7b7c764..0000000 --- a/pkg/pb/user/user.pb.go +++ /dev/null @@ -1,604 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.36.6 -// protoc v5.29.3 -// source: user/user.proto - -package user - -import ( - 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 GetInfoRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetInfoRequest) Reset() { - *x = GetInfoRequest{} - mi := &file_user_user_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetInfoRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetInfoRequest) ProtoMessage() {} - -func (x *GetInfoRequest) ProtoReflect() protoreflect.Message { - mi := &file_user_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 GetInfoRequest.ProtoReflect.Descriptor instead. -func (*GetInfoRequest) Descriptor() ([]byte, []int) { - return file_user_user_proto_rawDescGZIP(), []int{0} -} - -func (x *GetInfoRequest) GetUserId() int64 { - if x != nil { - return x.UserId - } - return 0 -} - -type GetInfoResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Phone string `protobuf:"bytes,3,opt,name=phone,proto3" json:"phone,omitempty"` - CompanyName string `protobuf:"bytes,4,opt,name=company_name,json=companyName,proto3" json:"company_name,omitempty"` - PaymentStatus string `protobuf:"bytes,5,opt,name=payment_status,json=paymentStatus,proto3" json:"payment_status,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetInfoResponse) Reset() { - *x = GetInfoResponse{} - mi := &file_user_user_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetInfoResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetInfoResponse) ProtoMessage() {} - -func (x *GetInfoResponse) ProtoReflect() protoreflect.Message { - mi := &file_user_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 GetInfoResponse.ProtoReflect.Descriptor instead. -func (*GetInfoResponse) Descriptor() ([]byte, []int) { - return file_user_user_proto_rawDescGZIP(), []int{1} -} - -func (x *GetInfoResponse) GetEmail() string { - if x != nil { - return x.Email - } - return "" -} - -func (x *GetInfoResponse) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *GetInfoResponse) GetPhone() string { - if x != nil { - return x.Phone - } - return "" -} - -func (x *GetInfoResponse) GetCompanyName() string { - if x != nil { - return x.CompanyName - } - return "" -} - -func (x *GetInfoResponse) GetPaymentStatus() string { - if x != nil { - return x.PaymentStatus - } - return "" -} - -type GetBalanceRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetBalanceRequest) Reset() { - *x = GetBalanceRequest{} - mi := &file_user_user_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetBalanceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetBalanceRequest) ProtoMessage() {} - -func (x *GetBalanceRequest) ProtoReflect() protoreflect.Message { - mi := &file_user_user_proto_msgTypes[2] - 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 GetBalanceRequest.ProtoReflect.Descriptor instead. -func (*GetBalanceRequest) Descriptor() ([]byte, []int) { - return file_user_user_proto_rawDescGZIP(), []int{2} -} - -func (x *GetBalanceRequest) GetUserId() int64 { - if x != nil { - return x.UserId - } - return 0 -} - -type GetBalanceResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - Balance float64 `protobuf:"fixed64,1,opt,name=balance,proto3" json:"balance,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetBalanceResponse) Reset() { - *x = GetBalanceResponse{} - mi := &file_user_user_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetBalanceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetBalanceResponse) ProtoMessage() {} - -func (x *GetBalanceResponse) ProtoReflect() protoreflect.Message { - mi := &file_user_user_proto_msgTypes[3] - 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 GetBalanceResponse.ProtoReflect.Descriptor instead. -func (*GetBalanceResponse) Descriptor() ([]byte, []int) { - return file_user_user_proto_rawDescGZIP(), []int{3} -} - -func (x *GetBalanceResponse) GetBalance() float64 { - if x != nil { - return x.Balance - } - return 0 -} - -type GetStatisticsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetStatisticsRequest) Reset() { - *x = GetStatisticsRequest{} - mi := &file_user_user_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetStatisticsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetStatisticsRequest) ProtoMessage() {} - -func (x *GetStatisticsRequest) ProtoReflect() protoreflect.Message { - mi := &file_user_user_proto_msgTypes[4] - 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 GetStatisticsRequest.ProtoReflect.Descriptor instead. -func (*GetStatisticsRequest) Descriptor() ([]byte, []int) { - return file_user_user_proto_rawDescGZIP(), []int{4} -} - -func (x *GetStatisticsRequest) GetUserId() int64 { - if x != nil { - return x.UserId - } - return 0 -} - -type GetStatisticsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - TotalRequests int32 `protobuf:"varint,1,opt,name=total_requests,json=totalRequests,proto3" json:"total_requests,omitempty"` - SuccessfulRequests int32 `protobuf:"varint,2,opt,name=successful_requests,json=successfulRequests,proto3" json:"successful_requests,omitempty"` - FailedRequests int32 `protobuf:"varint,3,opt,name=failed_requests,json=failedRequests,proto3" json:"failed_requests,omitempty"` - TotalSpent float64 `protobuf:"fixed64,4,opt,name=total_spent,json=totalSpent,proto3" json:"total_spent,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetStatisticsResponse) Reset() { - *x = GetStatisticsResponse{} - mi := &file_user_user_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetStatisticsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetStatisticsResponse) ProtoMessage() {} - -func (x *GetStatisticsResponse) ProtoReflect() protoreflect.Message { - mi := &file_user_user_proto_msgTypes[5] - 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 GetStatisticsResponse.ProtoReflect.Descriptor instead. -func (*GetStatisticsResponse) Descriptor() ([]byte, []int) { - return file_user_user_proto_rawDescGZIP(), []int{5} -} - -func (x *GetStatisticsResponse) GetTotalRequests() int32 { - if x != nil { - return x.TotalRequests - } - return 0 -} - -func (x *GetStatisticsResponse) GetSuccessfulRequests() int32 { - if x != nil { - return x.SuccessfulRequests - } - return 0 -} - -func (x *GetStatisticsResponse) GetFailedRequests() int32 { - if x != nil { - return x.FailedRequests - } - return 0 -} - -func (x *GetStatisticsResponse) GetTotalSpent() float64 { - if x != nil { - return x.TotalSpent - } - return 0 -} - -type GetBalanceStatisticsRequest struct { - state protoimpl.MessageState `protogen:"open.v1"` - UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetBalanceStatisticsRequest) Reset() { - *x = GetBalanceStatisticsRequest{} - mi := &file_user_user_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetBalanceStatisticsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetBalanceStatisticsRequest) ProtoMessage() {} - -func (x *GetBalanceStatisticsRequest) ProtoReflect() protoreflect.Message { - mi := &file_user_user_proto_msgTypes[6] - 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 GetBalanceStatisticsRequest.ProtoReflect.Descriptor instead. -func (*GetBalanceStatisticsRequest) Descriptor() ([]byte, []int) { - return file_user_user_proto_rawDescGZIP(), []int{6} -} - -func (x *GetBalanceStatisticsRequest) GetUserId() int64 { - if x != nil { - return x.UserId - } - return 0 -} - -type WriteOffHistoryItem struct { - state protoimpl.MessageState `protogen:"open.v1"` - OperationId string `protobuf:"bytes,1,opt,name=operation_id,json=operationId,proto3" json:"operation_id,omitempty"` - Data string `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` - Amount float64 `protobuf:"fixed64,3,opt,name=amount,proto3" json:"amount,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *WriteOffHistoryItem) Reset() { - *x = WriteOffHistoryItem{} - mi := &file_user_user_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *WriteOffHistoryItem) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*WriteOffHistoryItem) ProtoMessage() {} - -func (x *WriteOffHistoryItem) ProtoReflect() protoreflect.Message { - mi := &file_user_user_proto_msgTypes[7] - 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 WriteOffHistoryItem.ProtoReflect.Descriptor instead. -func (*WriteOffHistoryItem) Descriptor() ([]byte, []int) { - return file_user_user_proto_rawDescGZIP(), []int{7} -} - -func (x *WriteOffHistoryItem) GetOperationId() string { - if x != nil { - return x.OperationId - } - return "" -} - -func (x *WriteOffHistoryItem) GetData() string { - if x != nil { - return x.Data - } - return "" -} - -func (x *WriteOffHistoryItem) GetAmount() float64 { - if x != nil { - return x.Amount - } - return 0 -} - -type GetBalanceStatisticsResponse struct { - state protoimpl.MessageState `protogen:"open.v1"` - AverageCost float64 `protobuf:"fixed64,1,opt,name=average_cost,json=averageCost,proto3" json:"average_cost,omitempty"` - WriteOffHistory []*WriteOffHistoryItem `protobuf:"bytes,2,rep,name=write_off_history,json=writeOffHistory,proto3" json:"write_off_history,omitempty"` - unknownFields protoimpl.UnknownFields - sizeCache protoimpl.SizeCache -} - -func (x *GetBalanceStatisticsResponse) Reset() { - *x = GetBalanceStatisticsResponse{} - mi := &file_user_user_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) -} - -func (x *GetBalanceStatisticsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetBalanceStatisticsResponse) ProtoMessage() {} - -func (x *GetBalanceStatisticsResponse) ProtoReflect() protoreflect.Message { - mi := &file_user_user_proto_msgTypes[8] - 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 GetBalanceStatisticsResponse.ProtoReflect.Descriptor instead. -func (*GetBalanceStatisticsResponse) Descriptor() ([]byte, []int) { - return file_user_user_proto_rawDescGZIP(), []int{8} -} - -func (x *GetBalanceStatisticsResponse) GetAverageCost() float64 { - if x != nil { - return x.AverageCost - } - return 0 -} - -func (x *GetBalanceStatisticsResponse) GetWriteOffHistory() []*WriteOffHistoryItem { - if x != nil { - return x.WriteOffHistory - } - return nil -} - -var File_user_user_proto protoreflect.FileDescriptor - -const file_user_user_proto_rawDesc = "" + - "\n" + - "\x0fuser/user.proto\x12\x04user\")\n" + - "\x0eGetInfoRequest\x12\x17\n" + - "\auser_id\x18\x01 \x01(\x03R\x06userId\"\x9b\x01\n" + - "\x0fGetInfoResponse\x12\x14\n" + - "\x05email\x18\x01 \x01(\tR\x05email\x12\x12\n" + - "\x04name\x18\x02 \x01(\tR\x04name\x12\x14\n" + - "\x05phone\x18\x03 \x01(\tR\x05phone\x12!\n" + - "\fcompany_name\x18\x04 \x01(\tR\vcompanyName\x12%\n" + - "\x0epayment_status\x18\x05 \x01(\tR\rpaymentStatus\",\n" + - "\x11GetBalanceRequest\x12\x17\n" + - "\auser_id\x18\x01 \x01(\x03R\x06userId\".\n" + - "\x12GetBalanceResponse\x12\x18\n" + - "\abalance\x18\x01 \x01(\x01R\abalance\"/\n" + - "\x14GetStatisticsRequest\x12\x17\n" + - "\auser_id\x18\x01 \x01(\x03R\x06userId\"\xb9\x01\n" + - "\x15GetStatisticsResponse\x12%\n" + - "\x0etotal_requests\x18\x01 \x01(\x05R\rtotalRequests\x12/\n" + - "\x13successful_requests\x18\x02 \x01(\x05R\x12successfulRequests\x12'\n" + - "\x0ffailed_requests\x18\x03 \x01(\x05R\x0efailedRequests\x12\x1f\n" + - "\vtotal_spent\x18\x04 \x01(\x01R\n" + - "totalSpent\"6\n" + - "\x1bGetBalanceStatisticsRequest\x12\x17\n" + - "\auser_id\x18\x01 \x01(\x03R\x06userId\"d\n" + - "\x13WriteOffHistoryItem\x12!\n" + - "\foperation_id\x18\x01 \x01(\tR\voperationId\x12\x12\n" + - "\x04data\x18\x02 \x01(\tR\x04data\x12\x16\n" + - "\x06amount\x18\x03 \x01(\x01R\x06amount\"\x88\x01\n" + - "\x1cGetBalanceStatisticsResponse\x12!\n" + - "\faverage_cost\x18\x01 \x01(\x01R\vaverageCost\x12E\n" + - "\x11write_off_history\x18\x02 \x03(\v2\x19.user.WriteOffHistoryItemR\x0fwriteOffHistory2\xaf\x02\n" + - "\vUserService\x126\n" + - "\aGetInfo\x12\x14.user.GetInfoRequest\x1a\x15.user.GetInfoResponse\x12?\n" + - "\n" + - "GetBalance\x12\x17.user.GetBalanceRequest\x1a\x18.user.GetBalanceResponse\x12H\n" + - "\rGetStatistics\x12\x1a.user.GetStatisticsRequest\x1a\x1b.user.GetStatisticsResponse\x12]\n" + - "\x14GetBalanceStatistics\x12!.user.GetBalanceStatisticsRequest\x1a\".user.GetBalanceStatisticsResponseB user.WriteOffHistoryItem - 0, // 1: user.UserService.GetInfo:input_type -> user.GetInfoRequest - 2, // 2: user.UserService.GetBalance:input_type -> user.GetBalanceRequest - 4, // 3: user.UserService.GetStatistics:input_type -> user.GetStatisticsRequest - 6, // 4: user.UserService.GetBalanceStatistics:input_type -> user.GetBalanceStatisticsRequest - 1, // 5: user.UserService.GetInfo:output_type -> user.GetInfoResponse - 3, // 6: user.UserService.GetBalance:output_type -> user.GetBalanceResponse - 5, // 7: user.UserService.GetStatistics:output_type -> user.GetStatisticsResponse - 8, // 8: user.UserService.GetBalanceStatistics:output_type -> user.GetBalanceStatisticsResponse - 5, // [5:9] is the sub-list for method output_type - 1, // [1:5] 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_user_user_proto_init() } -func file_user_user_proto_init() { - if File_user_user_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: unsafe.Slice(unsafe.StringData(file_user_user_proto_rawDesc), len(file_user_user_proto_rawDesc)), - NumEnums: 0, - NumMessages: 9, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_user_user_proto_goTypes, - DependencyIndexes: file_user_user_proto_depIdxs, - MessageInfos: file_user_user_proto_msgTypes, - }.Build() - File_user_user_proto = out.File - file_user_user_proto_goTypes = nil - file_user_user_proto_depIdxs = nil -} diff --git a/pkg/pb/user/user_grpc.pb.go b/pkg/pb/user/user_grpc.pb.go deleted file mode 100644 index 3ad2eb5..0000000 --- a/pkg/pb/user/user_grpc.pb.go +++ /dev/null @@ -1,235 +0,0 @@ -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.5.1 -// - protoc v5.29.3 -// source: user/user.proto - -package user - -import ( - context "context" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.64.0 or later. -const _ = grpc.SupportPackageIsVersion9 - -const ( - UserService_GetInfo_FullMethodName = "/user.UserService/GetInfo" - UserService_GetBalance_FullMethodName = "/user.UserService/GetBalance" - UserService_GetStatistics_FullMethodName = "/user.UserService/GetStatistics" - UserService_GetBalanceStatistics_FullMethodName = "/user.UserService/GetBalanceStatistics" -) - -// UserServiceClient is the client API for UserService service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. -type UserServiceClient interface { - GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error) - GetBalance(ctx context.Context, in *GetBalanceRequest, opts ...grpc.CallOption) (*GetBalanceResponse, error) - GetStatistics(ctx context.Context, in *GetStatisticsRequest, opts ...grpc.CallOption) (*GetStatisticsResponse, error) - GetBalanceStatistics(ctx context.Context, in *GetBalanceStatisticsRequest, opts ...grpc.CallOption) (*GetBalanceStatisticsResponse, error) -} - -type userServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient { - return &userServiceClient{cc} -} - -func (c *userServiceClient) GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetInfoResponse) - err := c.cc.Invoke(ctx, UserService_GetInfo_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *userServiceClient) GetBalance(ctx context.Context, in *GetBalanceRequest, opts ...grpc.CallOption) (*GetBalanceResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetBalanceResponse) - err := c.cc.Invoke(ctx, UserService_GetBalance_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *userServiceClient) GetStatistics(ctx context.Context, in *GetStatisticsRequest, opts ...grpc.CallOption) (*GetStatisticsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetStatisticsResponse) - err := c.cc.Invoke(ctx, UserService_GetStatistics_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *userServiceClient) GetBalanceStatistics(ctx context.Context, in *GetBalanceStatisticsRequest, opts ...grpc.CallOption) (*GetBalanceStatisticsResponse, error) { - cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) - out := new(GetBalanceStatisticsResponse) - err := c.cc.Invoke(ctx, UserService_GetBalanceStatistics_FullMethodName, in, out, cOpts...) - if err != nil { - return nil, err - } - return out, nil -} - -// UserServiceServer is the server API for UserService service. -// All implementations must embed UnimplementedUserServiceServer -// for forward compatibility. -type UserServiceServer interface { - GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error) - GetBalance(context.Context, *GetBalanceRequest) (*GetBalanceResponse, error) - GetStatistics(context.Context, *GetStatisticsRequest) (*GetStatisticsResponse, error) - GetBalanceStatistics(context.Context, *GetBalanceStatisticsRequest) (*GetBalanceStatisticsResponse, error) - mustEmbedUnimplementedUserServiceServer() -} - -// UnimplementedUserServiceServer must be embedded to have -// forward compatible implementations. -// -// NOTE: this should be embedded by value instead of pointer to avoid a nil -// pointer dereference when methods are called. -type UnimplementedUserServiceServer struct{} - -func (UnimplementedUserServiceServer) GetInfo(context.Context, *GetInfoRequest) (*GetInfoResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetInfo not implemented") -} -func (UnimplementedUserServiceServer) GetBalance(context.Context, *GetBalanceRequest) (*GetBalanceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetBalance not implemented") -} -func (UnimplementedUserServiceServer) GetStatistics(context.Context, *GetStatisticsRequest) (*GetStatisticsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetStatistics not implemented") -} -func (UnimplementedUserServiceServer) GetBalanceStatistics(context.Context, *GetBalanceStatisticsRequest) (*GetBalanceStatisticsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetBalanceStatistics not implemented") -} -func (UnimplementedUserServiceServer) mustEmbedUnimplementedUserServiceServer() {} -func (UnimplementedUserServiceServer) testEmbeddedByValue() {} - -// UnsafeUserServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to UserServiceServer will -// result in compilation errors. -type UnsafeUserServiceServer interface { - mustEmbedUnimplementedUserServiceServer() -} - -func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer) { - // If the following call pancis, it indicates UnimplementedUserServiceServer was - // embedded by pointer and is nil. This will cause panics if an - // unimplemented method is ever invoked, so we test this at initialization - // time to prevent it from happening at runtime later due to I/O. - if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { - t.testEmbeddedByValue() - } - s.RegisterService(&UserService_ServiceDesc, srv) -} - -func _UserService_GetInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetInfoRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(UserServiceServer).GetInfo(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: UserService_GetInfo_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UserServiceServer).GetInfo(ctx, req.(*GetInfoRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _UserService_GetBalance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetBalanceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(UserServiceServer).GetBalance(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: UserService_GetBalance_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UserServiceServer).GetBalance(ctx, req.(*GetBalanceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _UserService_GetStatistics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetStatisticsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(UserServiceServer).GetStatistics(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: UserService_GetStatistics_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UserServiceServer).GetStatistics(ctx, req.(*GetStatisticsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _UserService_GetBalanceStatistics_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetBalanceStatisticsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(UserServiceServer).GetBalanceStatistics(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: UserService_GetBalanceStatistics_FullMethodName, - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UserServiceServer).GetBalanceStatistics(ctx, req.(*GetBalanceStatisticsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// UserService_ServiceDesc is the grpc.ServiceDesc for UserService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var UserService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "user.UserService", - HandlerType: (*UserServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "GetInfo", - Handler: _UserService_GetInfo_Handler, - }, - { - MethodName: "GetBalance", - Handler: _UserService_GetBalance_Handler, - }, - { - MethodName: "GetStatistics", - Handler: _UserService_GetStatistics_Handler, - }, - { - MethodName: "GetBalanceStatistics", - Handler: _UserService_GetBalanceStatistics_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "user/user.proto", -} diff --git a/tests/full_flow_test.go b/tests/full_flow_test.go index 5d486de..c9d9ec7 100644 --- a/tests/full_flow_test.go +++ b/tests/full_flow_test.go @@ -119,7 +119,7 @@ func (s *IntegrationSuite) TestFullFlow_CompleteRequestLifecycle() { statisticsResp, err := s.userClient.GetStatistics(ctx, getStatisticsReq) s.NoError(err) - s.GreaterOrEqual(statisticsResp.TotalRequests, int32(0)) + s.NotEmpty(statisticsResp.RequestsCount) logoutReq := &authpb.LogoutRequest{ AccessToken: loginResp.AccessToken, diff --git a/tests/user_handler_test.go b/tests/user_handler_test.go index 4dae08f..a1dea52 100644 --- a/tests/user_handler_test.go +++ b/tests/user_handler_test.go @@ -54,7 +54,7 @@ func (s *IntegrationSuite) TestUserHandler_GetStatisticsWithNonExistentUser() { } s.NotNil(resp) - s.Equal(int32(0), resp.TotalRequests) + s.Equal("0", resp.RequestsCount) } func (s *IntegrationSuite) TestUserHandler_GetBalanceStatistics() { @@ -166,8 +166,7 @@ func (s *IntegrationSuite) TestUserHandler_GetStatisticsWithValidUser() { resp, err := s.userClient.GetStatistics(ctx, req) s.NoError(err) s.NotNil(resp) - s.GreaterOrEqual(resp.TotalRequests, int32(0)) - s.GreaterOrEqual(resp.SuccessfulRequests, int32(0)) - s.GreaterOrEqual(resp.FailedRequests, int32(0)) - s.GreaterOrEqual(resp.TotalSpent, 0.0) + s.NotEmpty(resp.SuppliersCount) + s.NotEmpty(resp.RequestsCount) + s.NotEmpty(resp.CreatedTz) }