diff --git a/gen/admin/admin-account.ts b/gen/admin/admin-account.ts index c65fe75..3587cc6 100644 --- a/gen/admin/admin-account.ts +++ b/gen/admin/admin-account.ts @@ -215,8 +215,6 @@ export interface ModifyPermissionAdminResponse { export interface GrafanaAlertRequest { payload: string; - userId: string; - sessionId: string; } /** Успешно ли обработан алерт */ diff --git a/gen/go/admin/admin-account.pb.go b/gen/go/admin/admin-account.pb.go index 248eeef..d074481 100644 --- a/gen/go/admin/admin-account.pb.go +++ b/gen/go/admin/admin-account.pb.go @@ -2040,8 +2040,6 @@ func (x *ModifyPermissionAdminResponse) GetMessage() string { type GrafanaAlertRequest struct { state protoimpl.MessageState `protogen:"open.v1"` Payload string `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` - UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - SessionId string `protobuf:"bytes,3,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -2083,20 +2081,6 @@ func (x *GrafanaAlertRequest) GetPayload() string { return "" } -func (x *GrafanaAlertRequest) GetUserId() string { - if x != nil { - return x.UserId - } - return "" -} - -func (x *GrafanaAlertRequest) GetSessionId() string { - if x != nil { - return x.SessionId - } - return "" -} - // Успешно ли обработан алерт type GrafanaAlertResponse struct { state protoimpl.MessageState `protogen:"open.v1"` @@ -2296,12 +2280,9 @@ const file_admin_admin_account_proto_rawDesc = "" + "\brole_ids\x18\x02 \x03(\tR\aroleIds\"S\n" + "\x1dModifyPermissionAdminResponse\x12\x18\n" + "\asuccess\x18\x01 \x01(\bR\asuccess\x12\x18\n" + - "\amessage\x18\x02 \x01(\tR\amessage\"g\n" + + "\amessage\x18\x02 \x01(\tR\amessage\"/\n" + "\x13GrafanaAlertRequest\x12\x18\n" + - "\apayload\x18\x01 \x01(\tR\apayload\x12\x17\n" + - "\auser_id\x18\x02 \x01(\tR\x06userId\x12\x1d\n" + - "\n" + - "session_id\x18\x03 \x01(\tR\tsessionId\"0\n" + + "\apayload\x18\x01 \x01(\tR\apayload\"0\n" + "\x14GrafanaAlertResponse\x12\x18\n" + "\asuccess\x18\x01 \x01(\bR\asuccess2\xa8\f\n" + "\fAdminService\x12G\n" + diff --git a/gen/go/sso/auth.pb.go b/gen/go/sso/auth.pb.go index 79e594b..c859e4e 100644 --- a/gen/go/sso/auth.pb.go +++ b/gen/go/sso/auth.pb.go @@ -1497,6 +1497,170 @@ func (x *SystemUnblockIpResponse) GetSuccess() bool { return false } +type SystemGetAllAccountsRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + Limit int32 `protobuf:"varint,1,opt,name=limit,proto3" json:"limit,omitempty"` + Offset int32 `protobuf:"varint,2,opt,name=offset,proto3" json:"offset,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SystemGetAllAccountsRequest) Reset() { + *x = SystemGetAllAccountsRequest{} + mi := &file_sso_auth_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SystemGetAllAccountsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SystemGetAllAccountsRequest) ProtoMessage() {} + +func (x *SystemGetAllAccountsRequest) ProtoReflect() protoreflect.Message { + mi := &file_sso_auth_proto_msgTypes[27] + 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 SystemGetAllAccountsRequest.ProtoReflect.Descriptor instead. +func (*SystemGetAllAccountsRequest) Descriptor() ([]byte, []int) { + return file_sso_auth_proto_rawDescGZIP(), []int{27} +} + +func (x *SystemGetAllAccountsRequest) GetLimit() int32 { + if x != nil { + return x.Limit + } + return 0 +} + +func (x *SystemGetAllAccountsRequest) GetOffset() int32 { + if x != nil { + return x.Offset + } + return 0 +} + +type AccountBasicItem struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` + Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *AccountBasicItem) Reset() { + *x = AccountBasicItem{} + mi := &file_sso_auth_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *AccountBasicItem) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AccountBasicItem) ProtoMessage() {} + +func (x *AccountBasicItem) ProtoReflect() protoreflect.Message { + mi := &file_sso_auth_proto_msgTypes[28] + 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 AccountBasicItem.ProtoReflect.Descriptor instead. +func (*AccountBasicItem) Descriptor() ([]byte, []int) { + return file_sso_auth_proto_rawDescGZIP(), []int{28} +} + +func (x *AccountBasicItem) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *AccountBasicItem) GetUsername() string { + if x != nil { + return x.Username + } + return "" +} + +func (x *AccountBasicItem) GetStatus() string { + if x != nil { + return x.Status + } + return "" +} + +type SystemGetAllAccountsResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Accounts []*AccountBasicItem `protobuf:"bytes,1,rep,name=accounts,proto3" json:"accounts,omitempty"` + Total int32 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SystemGetAllAccountsResponse) Reset() { + *x = SystemGetAllAccountsResponse{} + mi := &file_sso_auth_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SystemGetAllAccountsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SystemGetAllAccountsResponse) ProtoMessage() {} + +func (x *SystemGetAllAccountsResponse) ProtoReflect() protoreflect.Message { + mi := &file_sso_auth_proto_msgTypes[29] + 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 SystemGetAllAccountsResponse.ProtoReflect.Descriptor instead. +func (*SystemGetAllAccountsResponse) Descriptor() ([]byte, []int) { + return file_sso_auth_proto_rawDescGZIP(), []int{29} +} + +func (x *SystemGetAllAccountsResponse) GetAccounts() []*AccountBasicItem { + if x != nil { + return x.Accounts + } + return nil +} + +func (x *SystemGetAllAccountsResponse) GetTotal() int32 { + if x != nil { + return x.Total + } + return 0 +} + var File_sso_auth_proto protoreflect.FileDescriptor const file_sso_auth_proto_rawDesc = "" + @@ -1623,7 +1787,17 @@ const file_sso_auth_proto_rawDesc = "" + "\n" + "ip_address\x18\x01 \x01(\tR\tipAddress\"3\n" + "\x17SystemUnblockIpResponse\x12\x18\n" + - "\asuccess\x18\x02 \x01(\bR\asuccess2\xee\b\n" + + "\asuccess\x18\x02 \x01(\bR\asuccess\"K\n" + + "\x1bSystemGetAllAccountsRequest\x12\x14\n" + + "\x05limit\x18\x01 \x01(\x05R\x05limit\x12\x16\n" + + "\x06offset\x18\x02 \x01(\x05R\x06offset\"V\n" + + "\x10AccountBasicItem\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x1a\n" + + "\busername\x18\x02 \x01(\tR\busername\x12\x16\n" + + "\x06status\x18\x03 \x01(\tR\x06status\"k\n" + + "\x1cSystemGetAllAccountsResponse\x125\n" + + "\baccounts\x18\x01 \x03(\v2\x19.auth.v1.AccountBasicItemR\baccounts\x12\x14\n" + + "\x05total\x18\x02 \x01(\x05R\x05total2\xd3\t\n" + "\vAuthService\x126\n" + "\x05Login\x12\x15.auth.v1.LoginRequest\x1a\x16.auth.v1.LoginResponse\x12<\n" + "\aRefresh\x12\x17.auth.v1.RefreshRequest\x1a\x18.auth.v1.RefreshResponse\x12H\n" + @@ -1638,7 +1812,8 @@ const file_sso_auth_proto_rawDesc = "" + "\x14SystemUpdatePassword\x12$.auth.v1.SystemUpdatePasswordRequest\x1a%.auth.v1.SystemUpdatePasswordResponse\x12T\n" + "\x0fSystemUpdatePin\x12\x1f.auth.v1.SystemUpdatePinRequest\x1a .auth.v1.SystemUpdatePinResponse\x12N\n" + "\rSystemBlockIp\x12\x1d.auth.v1.SystemBlockIpRequest\x1a\x1e.auth.v1.SystemBlockIpResponse\x12T\n" + - "\x0fSystemUnblockIp\x12\x1f.auth.v1.SystemUnblockIpRequest\x1a .auth.v1.SystemUnblockIpResponseB*Z(git.lendry.ru/lendry-erp/proto.git/go;pbb\x06proto3" + "\x0fSystemUnblockIp\x12\x1f.auth.v1.SystemUnblockIpRequest\x1a .auth.v1.SystemUnblockIpResponse\x12c\n" + + "\x14SystemGetAllAccounts\x12$.auth.v1.SystemGetAllAccountsRequest\x1a%.auth.v1.SystemGetAllAccountsResponseB*Z(git.lendry.ru/lendry-erp/proto.git/go;pbb\x06proto3" var ( file_sso_auth_proto_rawDescOnce sync.Once @@ -1652,7 +1827,7 @@ func file_sso_auth_proto_rawDescGZIP() []byte { return file_sso_auth_proto_rawDescData } -var file_sso_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 27) +var file_sso_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 30) var file_sso_auth_proto_goTypes = []any{ (*LoginRequest)(nil), // 0: auth.v1.LoginRequest (*LoginResponse)(nil), // 1: auth.v1.LoginResponse @@ -1681,42 +1856,48 @@ var file_sso_auth_proto_goTypes = []any{ (*SystemBlockIpResponse)(nil), // 24: auth.v1.SystemBlockIpResponse (*SystemUnblockIpRequest)(nil), // 25: auth.v1.SystemUnblockIpRequest (*SystemUnblockIpResponse)(nil), // 26: auth.v1.SystemUnblockIpResponse + (*SystemGetAllAccountsRequest)(nil), // 27: auth.v1.SystemGetAllAccountsRequest + (*AccountBasicItem)(nil), // 28: auth.v1.AccountBasicItem + (*SystemGetAllAccountsResponse)(nil), // 29: auth.v1.SystemGetAllAccountsResponse } var file_sso_auth_proto_depIdxs = []int32{ 11, // 0: auth.v1.GetSessionsResponse.sessions:type_name -> auth.v1.SessionItem - 0, // 1: auth.v1.AuthService.Login:input_type -> auth.v1.LoginRequest - 2, // 2: auth.v1.AuthService.Refresh:input_type -> auth.v1.RefreshRequest - 6, // 3: auth.v1.AuthService.VerifyToken:input_type -> auth.v1.VerifyTokenRequest - 8, // 4: auth.v1.AuthService.GetAccountRoleLevel:input_type -> auth.v1.GetAccountRoleLevelRequest - 4, // 5: auth.v1.AuthService.Logout:input_type -> auth.v1.LogoutRequest - 4, // 6: auth.v1.AuthService.LogoutOther:input_type -> auth.v1.LogoutRequest - 10, // 7: auth.v1.AuthService.GetSessions:input_type -> auth.v1.GetSessionRequest - 13, // 8: auth.v1.AuthService.TerminateSession:input_type -> auth.v1.TerminateSessionRequest - 15, // 9: auth.v1.AuthService.SystemCreateAccount:input_type -> auth.v1.SystemCreateAccountRequest - 17, // 10: auth.v1.AuthService.SystemChangeStatus:input_type -> auth.v1.SystemChangeStatusRequest - 19, // 11: auth.v1.AuthService.SystemUpdatePassword:input_type -> auth.v1.SystemUpdatePasswordRequest - 21, // 12: auth.v1.AuthService.SystemUpdatePin:input_type -> auth.v1.SystemUpdatePinRequest - 23, // 13: auth.v1.AuthService.SystemBlockIp:input_type -> auth.v1.SystemBlockIpRequest - 25, // 14: auth.v1.AuthService.SystemUnblockIp:input_type -> auth.v1.SystemUnblockIpRequest - 1, // 15: auth.v1.AuthService.Login:output_type -> auth.v1.LoginResponse - 3, // 16: auth.v1.AuthService.Refresh:output_type -> auth.v1.RefreshResponse - 7, // 17: auth.v1.AuthService.VerifyToken:output_type -> auth.v1.VerifyTokenResponse - 9, // 18: auth.v1.AuthService.GetAccountRoleLevel:output_type -> auth.v1.GetAccountRoleLevelResponse - 5, // 19: auth.v1.AuthService.Logout:output_type -> auth.v1.LogoutResponse - 5, // 20: auth.v1.AuthService.LogoutOther:output_type -> auth.v1.LogoutResponse - 12, // 21: auth.v1.AuthService.GetSessions:output_type -> auth.v1.GetSessionsResponse - 14, // 22: auth.v1.AuthService.TerminateSession:output_type -> auth.v1.TerminateSessionResponse - 16, // 23: auth.v1.AuthService.SystemCreateAccount:output_type -> auth.v1.SystemCreateAccountResponse - 18, // 24: auth.v1.AuthService.SystemChangeStatus:output_type -> auth.v1.SystemChangeStatusResponse - 20, // 25: auth.v1.AuthService.SystemUpdatePassword:output_type -> auth.v1.SystemUpdatePasswordResponse - 22, // 26: auth.v1.AuthService.SystemUpdatePin:output_type -> auth.v1.SystemUpdatePinResponse - 24, // 27: auth.v1.AuthService.SystemBlockIp:output_type -> auth.v1.SystemBlockIpResponse - 26, // 28: auth.v1.AuthService.SystemUnblockIp:output_type -> auth.v1.SystemUnblockIpResponse - 15, // [15:29] is the sub-list for method output_type - 1, // [1:15] 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 + 28, // 1: auth.v1.SystemGetAllAccountsResponse.accounts:type_name -> auth.v1.AccountBasicItem + 0, // 2: auth.v1.AuthService.Login:input_type -> auth.v1.LoginRequest + 2, // 3: auth.v1.AuthService.Refresh:input_type -> auth.v1.RefreshRequest + 6, // 4: auth.v1.AuthService.VerifyToken:input_type -> auth.v1.VerifyTokenRequest + 8, // 5: auth.v1.AuthService.GetAccountRoleLevel:input_type -> auth.v1.GetAccountRoleLevelRequest + 4, // 6: auth.v1.AuthService.Logout:input_type -> auth.v1.LogoutRequest + 4, // 7: auth.v1.AuthService.LogoutOther:input_type -> auth.v1.LogoutRequest + 10, // 8: auth.v1.AuthService.GetSessions:input_type -> auth.v1.GetSessionRequest + 13, // 9: auth.v1.AuthService.TerminateSession:input_type -> auth.v1.TerminateSessionRequest + 15, // 10: auth.v1.AuthService.SystemCreateAccount:input_type -> auth.v1.SystemCreateAccountRequest + 17, // 11: auth.v1.AuthService.SystemChangeStatus:input_type -> auth.v1.SystemChangeStatusRequest + 19, // 12: auth.v1.AuthService.SystemUpdatePassword:input_type -> auth.v1.SystemUpdatePasswordRequest + 21, // 13: auth.v1.AuthService.SystemUpdatePin:input_type -> auth.v1.SystemUpdatePinRequest + 23, // 14: auth.v1.AuthService.SystemBlockIp:input_type -> auth.v1.SystemBlockIpRequest + 25, // 15: auth.v1.AuthService.SystemUnblockIp:input_type -> auth.v1.SystemUnblockIpRequest + 27, // 16: auth.v1.AuthService.SystemGetAllAccounts:input_type -> auth.v1.SystemGetAllAccountsRequest + 1, // 17: auth.v1.AuthService.Login:output_type -> auth.v1.LoginResponse + 3, // 18: auth.v1.AuthService.Refresh:output_type -> auth.v1.RefreshResponse + 7, // 19: auth.v1.AuthService.VerifyToken:output_type -> auth.v1.VerifyTokenResponse + 9, // 20: auth.v1.AuthService.GetAccountRoleLevel:output_type -> auth.v1.GetAccountRoleLevelResponse + 5, // 21: auth.v1.AuthService.Logout:output_type -> auth.v1.LogoutResponse + 5, // 22: auth.v1.AuthService.LogoutOther:output_type -> auth.v1.LogoutResponse + 12, // 23: auth.v1.AuthService.GetSessions:output_type -> auth.v1.GetSessionsResponse + 14, // 24: auth.v1.AuthService.TerminateSession:output_type -> auth.v1.TerminateSessionResponse + 16, // 25: auth.v1.AuthService.SystemCreateAccount:output_type -> auth.v1.SystemCreateAccountResponse + 18, // 26: auth.v1.AuthService.SystemChangeStatus:output_type -> auth.v1.SystemChangeStatusResponse + 20, // 27: auth.v1.AuthService.SystemUpdatePassword:output_type -> auth.v1.SystemUpdatePasswordResponse + 22, // 28: auth.v1.AuthService.SystemUpdatePin:output_type -> auth.v1.SystemUpdatePinResponse + 24, // 29: auth.v1.AuthService.SystemBlockIp:output_type -> auth.v1.SystemBlockIpResponse + 26, // 30: auth.v1.AuthService.SystemUnblockIp:output_type -> auth.v1.SystemUnblockIpResponse + 29, // 31: auth.v1.AuthService.SystemGetAllAccounts:output_type -> auth.v1.SystemGetAllAccountsResponse + 17, // [17:32] is the sub-list for method output_type + 2, // [2:17] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name } func init() { file_sso_auth_proto_init() } @@ -1734,7 +1915,7 @@ func file_sso_auth_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_sso_auth_proto_rawDesc), len(file_sso_auth_proto_rawDesc)), NumEnums: 0, - NumMessages: 27, + NumMessages: 30, NumExtensions: 0, NumServices: 1, }, diff --git a/gen/go/sso/auth_grpc.pb.go b/gen/go/sso/auth_grpc.pb.go index fd180f4..ba2beb2 100644 --- a/gen/go/sso/auth_grpc.pb.go +++ b/gen/go/sso/auth_grpc.pb.go @@ -33,6 +33,7 @@ const ( AuthService_SystemUpdatePin_FullMethodName = "/auth.v1.AuthService/SystemUpdatePin" AuthService_SystemBlockIp_FullMethodName = "/auth.v1.AuthService/SystemBlockIp" AuthService_SystemUnblockIp_FullMethodName = "/auth.v1.AuthService/SystemUnblockIp" + AuthService_SystemGetAllAccounts_FullMethodName = "/auth.v1.AuthService/SystemGetAllAccounts" ) // AuthServiceClient is the client API for AuthService service. @@ -54,6 +55,7 @@ type AuthServiceClient interface { SystemUpdatePin(ctx context.Context, in *SystemUpdatePinRequest, opts ...grpc.CallOption) (*SystemUpdatePinResponse, error) SystemBlockIp(ctx context.Context, in *SystemBlockIpRequest, opts ...grpc.CallOption) (*SystemBlockIpResponse, error) SystemUnblockIp(ctx context.Context, in *SystemUnblockIpRequest, opts ...grpc.CallOption) (*SystemUnblockIpResponse, error) + SystemGetAllAccounts(ctx context.Context, in *SystemGetAllAccountsRequest, opts ...grpc.CallOption) (*SystemGetAllAccountsResponse, error) } type authServiceClient struct { @@ -204,6 +206,16 @@ func (c *authServiceClient) SystemUnblockIp(ctx context.Context, in *SystemUnblo return out, nil } +func (c *authServiceClient) SystemGetAllAccounts(ctx context.Context, in *SystemGetAllAccountsRequest, opts ...grpc.CallOption) (*SystemGetAllAccountsResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(SystemGetAllAccountsResponse) + err := c.cc.Invoke(ctx, AuthService_SystemGetAllAccounts_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. @@ -223,6 +235,7 @@ type AuthServiceServer interface { SystemUpdatePin(context.Context, *SystemUpdatePinRequest) (*SystemUpdatePinResponse, error) SystemBlockIp(context.Context, *SystemBlockIpRequest) (*SystemBlockIpResponse, error) SystemUnblockIp(context.Context, *SystemUnblockIpRequest) (*SystemUnblockIpResponse, error) + SystemGetAllAccounts(context.Context, *SystemGetAllAccountsRequest) (*SystemGetAllAccountsResponse, error) mustEmbedUnimplementedAuthServiceServer() } @@ -275,6 +288,9 @@ func (UnimplementedAuthServiceServer) SystemBlockIp(context.Context, *SystemBloc func (UnimplementedAuthServiceServer) SystemUnblockIp(context.Context, *SystemUnblockIpRequest) (*SystemUnblockIpResponse, error) { return nil, status.Error(codes.Unimplemented, "method SystemUnblockIp not implemented") } +func (UnimplementedAuthServiceServer) SystemGetAllAccounts(context.Context, *SystemGetAllAccountsRequest) (*SystemGetAllAccountsResponse, error) { + return nil, status.Error(codes.Unimplemented, "method SystemGetAllAccounts not implemented") +} func (UnimplementedAuthServiceServer) mustEmbedUnimplementedAuthServiceServer() {} func (UnimplementedAuthServiceServer) testEmbeddedByValue() {} @@ -548,6 +564,24 @@ func _AuthService_SystemUnblockIp_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +func _AuthService_SystemGetAllAccounts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SystemGetAllAccountsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AuthServiceServer).SystemGetAllAccounts(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: AuthService_SystemGetAllAccounts_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AuthServiceServer).SystemGetAllAccounts(ctx, req.(*SystemGetAllAccountsRequest)) + } + 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) @@ -611,6 +645,10 @@ var AuthService_ServiceDesc = grpc.ServiceDesc{ MethodName: "SystemUnblockIp", Handler: _AuthService_SystemUnblockIp_Handler, }, + { + MethodName: "SystemGetAllAccounts", + Handler: _AuthService_SystemGetAllAccounts_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "sso/auth.proto", diff --git a/gen/go/users/users.pb.go b/gen/go/users/users.pb.go index faa0cbb..fa7337c 100644 --- a/gen/go/users/users.pb.go +++ b/gen/go/users/users.pb.go @@ -1298,6 +1298,170 @@ func (x *GetBlockedUsersResponse) GetBlockedUsers() []*BlockedUserItem { return nil } +type SystemGetProfileBatchRequest struct { + state protoimpl.MessageState `protogen:"open.v1"` + UserIds []string `protobuf:"bytes,1,rep,name=user_ids,json=userIds,proto3" json:"user_ids,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SystemGetProfileBatchRequest) Reset() { + *x = SystemGetProfileBatchRequest{} + mi := &file_users_users_proto_msgTypes[21] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SystemGetProfileBatchRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SystemGetProfileBatchRequest) ProtoMessage() {} + +func (x *SystemGetProfileBatchRequest) ProtoReflect() protoreflect.Message { + mi := &file_users_users_proto_msgTypes[21] + 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 SystemGetProfileBatchRequest.ProtoReflect.Descriptor instead. +func (*SystemGetProfileBatchRequest) Descriptor() ([]byte, []int) { + return file_users_users_proto_rawDescGZIP(), []int{21} +} + +func (x *SystemGetProfileBatchRequest) GetUserIds() []string { + if x != nil { + return x.UserIds + } + return nil +} + +type ProfileBasicItem struct { + state protoimpl.MessageState `protogen:"open.v1"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Email *string `protobuf:"bytes,2,opt,name=email,proto3,oneof" json:"email,omitempty"` + Phone *string `protobuf:"bytes,3,opt,name=phone,proto3,oneof" json:"phone,omitempty"` + FullName *string `protobuf:"bytes,4,opt,name=full_name,json=fullName,proto3,oneof" json:"full_name,omitempty"` + IsPublic bool `protobuf:"varint,5,opt,name=is_public,json=isPublic,proto3" json:"is_public,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ProfileBasicItem) Reset() { + *x = ProfileBasicItem{} + mi := &file_users_users_proto_msgTypes[22] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ProfileBasicItem) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProfileBasicItem) ProtoMessage() {} + +func (x *ProfileBasicItem) ProtoReflect() protoreflect.Message { + mi := &file_users_users_proto_msgTypes[22] + 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 ProfileBasicItem.ProtoReflect.Descriptor instead. +func (*ProfileBasicItem) Descriptor() ([]byte, []int) { + return file_users_users_proto_rawDescGZIP(), []int{22} +} + +func (x *ProfileBasicItem) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *ProfileBasicItem) GetEmail() string { + if x != nil && x.Email != nil { + return *x.Email + } + return "" +} + +func (x *ProfileBasicItem) GetPhone() string { + if x != nil && x.Phone != nil { + return *x.Phone + } + return "" +} + +func (x *ProfileBasicItem) GetFullName() string { + if x != nil && x.FullName != nil { + return *x.FullName + } + return "" +} + +func (x *ProfileBasicItem) GetIsPublic() bool { + if x != nil { + return x.IsPublic + } + return false +} + +type SystemGetProfileBatchResponse struct { + state protoimpl.MessageState `protogen:"open.v1"` + Profiles []*ProfileBasicItem `protobuf:"bytes,1,rep,name=profiles,proto3" json:"profiles,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *SystemGetProfileBatchResponse) Reset() { + *x = SystemGetProfileBatchResponse{} + mi := &file_users_users_proto_msgTypes[23] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *SystemGetProfileBatchResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SystemGetProfileBatchResponse) ProtoMessage() {} + +func (x *SystemGetProfileBatchResponse) ProtoReflect() protoreflect.Message { + mi := &file_users_users_proto_msgTypes[23] + 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 SystemGetProfileBatchResponse.ProtoReflect.Descriptor instead. +func (*SystemGetProfileBatchResponse) Descriptor() ([]byte, []int) { + return file_users_users_proto_rawDescGZIP(), []int{23} +} + +func (x *SystemGetProfileBatchResponse) GetProfiles() []*ProfileBasicItem { + if x != nil { + return x.Profiles + } + return nil +} + var File_users_users_proto protoreflect.FileDescriptor const file_users_users_proto_rawDesc = "" + @@ -1447,7 +1611,21 @@ const file_users_users_proto_rawDesc = "" + "\n" + "blocker_id\x18\x01 \x01(\tR\tblockerId\"Y\n" + "\x17GetBlockedUsersResponse\x12>\n" + - "\rblocked_users\x18\x01 \x03(\v2\x19.users.v1.BlockedUserItemR\fblockedUsers2\xd8\x05\n" + + "\rblocked_users\x18\x01 \x03(\v2\x19.users.v1.BlockedUserItemR\fblockedUsers\"9\n" + + "\x1cSystemGetProfileBatchRequest\x12\x19\n" + + "\buser_ids\x18\x01 \x03(\tR\auserIds\"\xb9\x01\n" + + "\x10ProfileBasicItem\x12\x0e\n" + + "\x02id\x18\x01 \x01(\tR\x02id\x12\x19\n" + + "\x05email\x18\x02 \x01(\tH\x00R\x05email\x88\x01\x01\x12\x19\n" + + "\x05phone\x18\x03 \x01(\tH\x01R\x05phone\x88\x01\x01\x12 \n" + + "\tfull_name\x18\x04 \x01(\tH\x02R\bfullName\x88\x01\x01\x12\x1b\n" + + "\tis_public\x18\x05 \x01(\bR\bisPublicB\b\n" + + "\x06_emailB\b\n" + + "\x06_phoneB\f\n" + + "\n" + + "_full_name\"W\n" + + "\x1dSystemGetProfileBatchResponse\x126\n" + + "\bprofiles\x18\x01 \x03(\v2\x1a.users.v1.ProfileBasicItemR\bprofiles2\xc2\x06\n" + "\fUsersService\x12G\n" + "\n" + "GetProfile\x12\x1b.users.v1.GetProfileRequest\x1a\x1c.users.v1.GetProfileResponse\x12P\n" + @@ -1459,7 +1637,8 @@ const file_users_users_proto_rawDesc = "" + "\x0fGetBlockedUsers\x12 .users.v1.GetBlockedUsersRequest\x1a!.users.v1.GetBlockedUsersResponse\x12G\n" + "\n" + "AddContact\x12\x1b.users.v1.AddContactRequest\x1a\x1c.users.v1.AddContactResponse\x12J\n" + - "\vGetContacts\x12\x1c.users.v1.GetContactsRequest\x1a\x1d.users.v1.GetContactsResponseB*Z(git.lendry.ru/lendry-erp/proto.git/go;pbb\x06proto3" + "\vGetContacts\x12\x1c.users.v1.GetContactsRequest\x1a\x1d.users.v1.GetContactsResponse\x12h\n" + + "\x15SystemGetProfileBatch\x12&.users.v1.SystemGetProfileBatchRequest\x1a'.users.v1.SystemGetProfileBatchResponseB*Z(git.lendry.ru/lendry-erp/proto.git/go;pbb\x06proto3" var ( file_users_users_proto_rawDescOnce sync.Once @@ -1473,58 +1652,64 @@ func file_users_users_proto_rawDescGZIP() []byte { return file_users_users_proto_rawDescData } -var file_users_users_proto_msgTypes = make([]protoimpl.MessageInfo, 21) +var file_users_users_proto_msgTypes = make([]protoimpl.MessageInfo, 24) var file_users_users_proto_goTypes = []any{ - (*UserSettingsMessage)(nil), // 0: users.v1.UserSettingsMessage - (*GetProfileRequest)(nil), // 1: users.v1.GetProfileRequest - (*GetProfileResponse)(nil), // 2: users.v1.GetProfileResponse - (*UpdateProfileRequest)(nil), // 3: users.v1.UpdateProfileRequest - (*UpdateProfileResponse)(nil), // 4: users.v1.UpdateProfileResponse - (*CreateProfileRequest)(nil), // 5: users.v1.CreateProfileRequest - (*CreateProfileResponse)(nil), // 6: users.v1.CreateProfileResponse - (*SoftDeleteProfileRequest)(nil), // 7: users.v1.SoftDeleteProfileRequest - (*SoftDeleteProfileResponse)(nil), // 8: users.v1.SoftDeleteProfileResponse - (*ContactItem)(nil), // 9: users.v1.ContactItem - (*AddContactRequest)(nil), // 10: users.v1.AddContactRequest - (*AddContactResponse)(nil), // 11: users.v1.AddContactResponse - (*GetContactsRequest)(nil), // 12: users.v1.GetContactsRequest - (*GetContactsResponse)(nil), // 13: users.v1.GetContactsResponse - (*BlockedUserItem)(nil), // 14: users.v1.BlockedUserItem - (*BlockUserRequest)(nil), // 15: users.v1.BlockUserRequest - (*BlockUserResponse)(nil), // 16: users.v1.BlockUserResponse - (*UnblockUserRequest)(nil), // 17: users.v1.UnblockUserRequest - (*UnblockUserResponse)(nil), // 18: users.v1.UnblockUserResponse - (*GetBlockedUsersRequest)(nil), // 19: users.v1.GetBlockedUsersRequest - (*GetBlockedUsersResponse)(nil), // 20: users.v1.GetBlockedUsersResponse + (*UserSettingsMessage)(nil), // 0: users.v1.UserSettingsMessage + (*GetProfileRequest)(nil), // 1: users.v1.GetProfileRequest + (*GetProfileResponse)(nil), // 2: users.v1.GetProfileResponse + (*UpdateProfileRequest)(nil), // 3: users.v1.UpdateProfileRequest + (*UpdateProfileResponse)(nil), // 4: users.v1.UpdateProfileResponse + (*CreateProfileRequest)(nil), // 5: users.v1.CreateProfileRequest + (*CreateProfileResponse)(nil), // 6: users.v1.CreateProfileResponse + (*SoftDeleteProfileRequest)(nil), // 7: users.v1.SoftDeleteProfileRequest + (*SoftDeleteProfileResponse)(nil), // 8: users.v1.SoftDeleteProfileResponse + (*ContactItem)(nil), // 9: users.v1.ContactItem + (*AddContactRequest)(nil), // 10: users.v1.AddContactRequest + (*AddContactResponse)(nil), // 11: users.v1.AddContactResponse + (*GetContactsRequest)(nil), // 12: users.v1.GetContactsRequest + (*GetContactsResponse)(nil), // 13: users.v1.GetContactsResponse + (*BlockedUserItem)(nil), // 14: users.v1.BlockedUserItem + (*BlockUserRequest)(nil), // 15: users.v1.BlockUserRequest + (*BlockUserResponse)(nil), // 16: users.v1.BlockUserResponse + (*UnblockUserRequest)(nil), // 17: users.v1.UnblockUserRequest + (*UnblockUserResponse)(nil), // 18: users.v1.UnblockUserResponse + (*GetBlockedUsersRequest)(nil), // 19: users.v1.GetBlockedUsersRequest + (*GetBlockedUsersResponse)(nil), // 20: users.v1.GetBlockedUsersResponse + (*SystemGetProfileBatchRequest)(nil), // 21: users.v1.SystemGetProfileBatchRequest + (*ProfileBasicItem)(nil), // 22: users.v1.ProfileBasicItem + (*SystemGetProfileBatchResponse)(nil), // 23: users.v1.SystemGetProfileBatchResponse } var file_users_users_proto_depIdxs = []int32{ 0, // 0: users.v1.GetProfileResponse.settings:type_name -> users.v1.UserSettingsMessage 0, // 1: users.v1.UpdateProfileRequest.settings:type_name -> users.v1.UserSettingsMessage 9, // 2: users.v1.GetContactsResponse.contacts:type_name -> users.v1.ContactItem 14, // 3: users.v1.GetBlockedUsersResponse.blocked_users:type_name -> users.v1.BlockedUserItem - 1, // 4: users.v1.UsersService.GetProfile:input_type -> users.v1.GetProfileRequest - 3, // 5: users.v1.UsersService.UpdateProfile:input_type -> users.v1.UpdateProfileRequest - 5, // 6: users.v1.UsersService.CreateProfile:input_type -> users.v1.CreateProfileRequest - 7, // 7: users.v1.UsersService.SoftDeleteProfile:input_type -> users.v1.SoftDeleteProfileRequest - 15, // 8: users.v1.UsersService.BlockUser:input_type -> users.v1.BlockUserRequest - 17, // 9: users.v1.UsersService.UnblockUser:input_type -> users.v1.UnblockUserRequest - 19, // 10: users.v1.UsersService.GetBlockedUsers:input_type -> users.v1.GetBlockedUsersRequest - 10, // 11: users.v1.UsersService.AddContact:input_type -> users.v1.AddContactRequest - 12, // 12: users.v1.UsersService.GetContacts:input_type -> users.v1.GetContactsRequest - 2, // 13: users.v1.UsersService.GetProfile:output_type -> users.v1.GetProfileResponse - 4, // 14: users.v1.UsersService.UpdateProfile:output_type -> users.v1.UpdateProfileResponse - 6, // 15: users.v1.UsersService.CreateProfile:output_type -> users.v1.CreateProfileResponse - 8, // 16: users.v1.UsersService.SoftDeleteProfile:output_type -> users.v1.SoftDeleteProfileResponse - 16, // 17: users.v1.UsersService.BlockUser:output_type -> users.v1.BlockUserResponse - 18, // 18: users.v1.UsersService.UnblockUser:output_type -> users.v1.UnblockUserResponse - 20, // 19: users.v1.UsersService.GetBlockedUsers:output_type -> users.v1.GetBlockedUsersResponse - 11, // 20: users.v1.UsersService.AddContact:output_type -> users.v1.AddContactResponse - 13, // 21: users.v1.UsersService.GetContacts:output_type -> users.v1.GetContactsResponse - 13, // [13:22] is the sub-list for method output_type - 4, // [4:13] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 22, // 4: users.v1.SystemGetProfileBatchResponse.profiles:type_name -> users.v1.ProfileBasicItem + 1, // 5: users.v1.UsersService.GetProfile:input_type -> users.v1.GetProfileRequest + 3, // 6: users.v1.UsersService.UpdateProfile:input_type -> users.v1.UpdateProfileRequest + 5, // 7: users.v1.UsersService.CreateProfile:input_type -> users.v1.CreateProfileRequest + 7, // 8: users.v1.UsersService.SoftDeleteProfile:input_type -> users.v1.SoftDeleteProfileRequest + 15, // 9: users.v1.UsersService.BlockUser:input_type -> users.v1.BlockUserRequest + 17, // 10: users.v1.UsersService.UnblockUser:input_type -> users.v1.UnblockUserRequest + 19, // 11: users.v1.UsersService.GetBlockedUsers:input_type -> users.v1.GetBlockedUsersRequest + 10, // 12: users.v1.UsersService.AddContact:input_type -> users.v1.AddContactRequest + 12, // 13: users.v1.UsersService.GetContacts:input_type -> users.v1.GetContactsRequest + 21, // 14: users.v1.UsersService.SystemGetProfileBatch:input_type -> users.v1.SystemGetProfileBatchRequest + 2, // 15: users.v1.UsersService.GetProfile:output_type -> users.v1.GetProfileResponse + 4, // 16: users.v1.UsersService.UpdateProfile:output_type -> users.v1.UpdateProfileResponse + 6, // 17: users.v1.UsersService.CreateProfile:output_type -> users.v1.CreateProfileResponse + 8, // 18: users.v1.UsersService.SoftDeleteProfile:output_type -> users.v1.SoftDeleteProfileResponse + 16, // 19: users.v1.UsersService.BlockUser:output_type -> users.v1.BlockUserResponse + 18, // 20: users.v1.UsersService.UnblockUser:output_type -> users.v1.UnblockUserResponse + 20, // 21: users.v1.UsersService.GetBlockedUsers:output_type -> users.v1.GetBlockedUsersResponse + 11, // 22: users.v1.UsersService.AddContact:output_type -> users.v1.AddContactResponse + 13, // 23: users.v1.UsersService.GetContacts:output_type -> users.v1.GetContactsResponse + 23, // 24: users.v1.UsersService.SystemGetProfileBatch:output_type -> users.v1.SystemGetProfileBatchResponse + 15, // [15:25] is the sub-list for method output_type + 5, // [5:15] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_users_users_proto_init() } @@ -1538,13 +1723,14 @@ func file_users_users_proto_init() { file_users_users_proto_msgTypes[5].OneofWrappers = []any{} file_users_users_proto_msgTypes[9].OneofWrappers = []any{} file_users_users_proto_msgTypes[10].OneofWrappers = []any{} + file_users_users_proto_msgTypes[22].OneofWrappers = []any{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_users_users_proto_rawDesc), len(file_users_users_proto_rawDesc)), NumEnums: 0, - NumMessages: 21, + NumMessages: 24, NumExtensions: 0, NumServices: 1, }, diff --git a/gen/go/users/users_grpc.pb.go b/gen/go/users/users_grpc.pb.go index 71d9c73..b82db05 100644 --- a/gen/go/users/users_grpc.pb.go +++ b/gen/go/users/users_grpc.pb.go @@ -19,15 +19,16 @@ import ( const _ = grpc.SupportPackageIsVersion9 const ( - UsersService_GetProfile_FullMethodName = "/users.v1.UsersService/GetProfile" - UsersService_UpdateProfile_FullMethodName = "/users.v1.UsersService/UpdateProfile" - UsersService_CreateProfile_FullMethodName = "/users.v1.UsersService/CreateProfile" - UsersService_SoftDeleteProfile_FullMethodName = "/users.v1.UsersService/SoftDeleteProfile" - UsersService_BlockUser_FullMethodName = "/users.v1.UsersService/BlockUser" - UsersService_UnblockUser_FullMethodName = "/users.v1.UsersService/UnblockUser" - UsersService_GetBlockedUsers_FullMethodName = "/users.v1.UsersService/GetBlockedUsers" - UsersService_AddContact_FullMethodName = "/users.v1.UsersService/AddContact" - UsersService_GetContacts_FullMethodName = "/users.v1.UsersService/GetContacts" + UsersService_GetProfile_FullMethodName = "/users.v1.UsersService/GetProfile" + UsersService_UpdateProfile_FullMethodName = "/users.v1.UsersService/UpdateProfile" + UsersService_CreateProfile_FullMethodName = "/users.v1.UsersService/CreateProfile" + UsersService_SoftDeleteProfile_FullMethodName = "/users.v1.UsersService/SoftDeleteProfile" + UsersService_BlockUser_FullMethodName = "/users.v1.UsersService/BlockUser" + UsersService_UnblockUser_FullMethodName = "/users.v1.UsersService/UnblockUser" + UsersService_GetBlockedUsers_FullMethodName = "/users.v1.UsersService/GetBlockedUsers" + UsersService_AddContact_FullMethodName = "/users.v1.UsersService/AddContact" + UsersService_GetContacts_FullMethodName = "/users.v1.UsersService/GetContacts" + UsersService_SystemGetProfileBatch_FullMethodName = "/users.v1.UsersService/SystemGetProfileBatch" ) // UsersServiceClient is the client API for UsersService service. @@ -45,6 +46,7 @@ type UsersServiceClient interface { GetBlockedUsers(ctx context.Context, in *GetBlockedUsersRequest, opts ...grpc.CallOption) (*GetBlockedUsersResponse, error) AddContact(ctx context.Context, in *AddContactRequest, opts ...grpc.CallOption) (*AddContactResponse, error) GetContacts(ctx context.Context, in *GetContactsRequest, opts ...grpc.CallOption) (*GetContactsResponse, error) + SystemGetProfileBatch(ctx context.Context, in *SystemGetProfileBatchRequest, opts ...grpc.CallOption) (*SystemGetProfileBatchResponse, error) } type usersServiceClient struct { @@ -145,6 +147,16 @@ func (c *usersServiceClient) GetContacts(ctx context.Context, in *GetContactsReq return out, nil } +func (c *usersServiceClient) SystemGetProfileBatch(ctx context.Context, in *SystemGetProfileBatchRequest, opts ...grpc.CallOption) (*SystemGetProfileBatchResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(SystemGetProfileBatchResponse) + err := c.cc.Invoke(ctx, UsersService_SystemGetProfileBatch_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + // UsersServiceServer is the server API for UsersService service. // All implementations must embed UnimplementedUsersServiceServer // for forward compatibility. @@ -160,6 +172,7 @@ type UsersServiceServer interface { GetBlockedUsers(context.Context, *GetBlockedUsersRequest) (*GetBlockedUsersResponse, error) AddContact(context.Context, *AddContactRequest) (*AddContactResponse, error) GetContacts(context.Context, *GetContactsRequest) (*GetContactsResponse, error) + SystemGetProfileBatch(context.Context, *SystemGetProfileBatchRequest) (*SystemGetProfileBatchResponse, error) mustEmbedUnimplementedUsersServiceServer() } @@ -197,6 +210,9 @@ func (UnimplementedUsersServiceServer) AddContact(context.Context, *AddContactRe func (UnimplementedUsersServiceServer) GetContacts(context.Context, *GetContactsRequest) (*GetContactsResponse, error) { return nil, status.Error(codes.Unimplemented, "method GetContacts not implemented") } +func (UnimplementedUsersServiceServer) SystemGetProfileBatch(context.Context, *SystemGetProfileBatchRequest) (*SystemGetProfileBatchResponse, error) { + return nil, status.Error(codes.Unimplemented, "method SystemGetProfileBatch not implemented") +} func (UnimplementedUsersServiceServer) mustEmbedUnimplementedUsersServiceServer() {} func (UnimplementedUsersServiceServer) testEmbeddedByValue() {} @@ -380,6 +396,24 @@ func _UsersService_GetContacts_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _UsersService_SystemGetProfileBatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SystemGetProfileBatchRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UsersServiceServer).SystemGetProfileBatch(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UsersService_SystemGetProfileBatch_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UsersServiceServer).SystemGetProfileBatch(ctx, req.(*SystemGetProfileBatchRequest)) + } + return interceptor(ctx, in, info, handler) +} + // UsersService_ServiceDesc is the grpc.ServiceDesc for UsersService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -423,6 +457,10 @@ var UsersService_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetContacts", Handler: _UsersService_GetContacts_Handler, }, + { + MethodName: "SystemGetProfileBatch", + Handler: _UsersService_SystemGetProfileBatch_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "users/users.proto", diff --git a/gen/sso/auth.ts b/gen/sso/auth.ts index a1e9bbc..c17c3af 100644 --- a/gen/sso/auth.ts +++ b/gen/sso/auth.ts @@ -164,6 +164,22 @@ export interface SystemUnblockIpResponse { success: boolean; } +export interface SystemGetAllAccountsRequest { + limit: number; + offset: number; +} + +export interface AccountBasicItem { + id: string; + username: string; + status: string; +} + +export interface SystemGetAllAccountsResponse { + accounts: AccountBasicItem[]; + total: number; +} + export const AUTH_V1_PACKAGE_NAME = "auth.v1"; export interface AuthServiceClient { @@ -205,6 +221,11 @@ export interface AuthServiceClient { systemBlockIp(request: SystemBlockIpRequest, metadata?: Metadata): Observable; systemUnblockIp(request: SystemUnblockIpRequest, metadata?: Metadata): Observable; + + systemGetAllAccounts( + request: SystemGetAllAccountsRequest, + metadata?: Metadata, + ): Observable; } export interface AuthServiceController { @@ -276,6 +297,11 @@ export interface AuthServiceController { request: SystemUnblockIpRequest, metadata?: Metadata, ): Promise | Observable | SystemUnblockIpResponse; + + systemGetAllAccounts( + request: SystemGetAllAccountsRequest, + metadata?: Metadata, + ): Promise | Observable | SystemGetAllAccountsResponse; } export function AuthServiceControllerMethods() { @@ -295,6 +321,7 @@ export function AuthServiceControllerMethods() { "systemUpdatePin", "systemBlockIp", "systemUnblockIp", + "systemGetAllAccounts", ]; for (const method of grpcMethods) { const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); diff --git a/gen/users/users.ts b/gen/users/users.ts index acf625b..2c1d595 100644 --- a/gen/users/users.ts +++ b/gen/users/users.ts @@ -142,6 +142,22 @@ export interface GetBlockedUsersResponse { blockedUsers: BlockedUserItem[]; } +export interface SystemGetProfileBatchRequest { + userIds: string[]; +} + +export interface ProfileBasicItem { + id: string; + email?: string | undefined; + phone?: string | undefined; + fullName?: string | undefined; + isPublic: boolean; +} + +export interface SystemGetProfileBatchResponse { + profiles: ProfileBasicItem[]; +} + export const USERS_V1_PACKAGE_NAME = "users.v1"; export interface UsersServiceClient { @@ -166,6 +182,11 @@ export interface UsersServiceClient { addContact(request: AddContactRequest, metadata?: Metadata): Observable; getContacts(request: GetContactsRequest, metadata?: Metadata): Observable; + + systemGetProfileBatch( + request: SystemGetProfileBatchRequest, + metadata?: Metadata, + ): Observable; } export interface UsersServiceController { @@ -217,6 +238,11 @@ export interface UsersServiceController { request: GetContactsRequest, metadata?: Metadata, ): Promise | Observable | GetContactsResponse; + + systemGetProfileBatch( + request: SystemGetProfileBatchRequest, + metadata?: Metadata, + ): Promise | Observable | SystemGetProfileBatchResponse; } export function UsersServiceControllerMethods() { @@ -231,6 +257,7 @@ export function UsersServiceControllerMethods() { "getBlockedUsers", "addContact", "getContacts", + "systemGetProfileBatch", ]; for (const method of grpcMethods) { const descriptor: any = Reflect.getOwnPropertyDescriptor(constructor.prototype, method); diff --git a/package.json b/package.json index 40b3b2c..43d5ea0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lendry-erp/contracts", - "version": "1.2.34", + "version": "1.2.35", "description": "Protobuf definitions and generated TypeScript types", "type": "commonjs", "main": "./dist/index.js", diff --git a/proto/sso/auth.proto b/proto/sso/auth.proto index fef47c0..5beefdc 100644 --- a/proto/sso/auth.proto +++ b/proto/sso/auth.proto @@ -25,6 +25,7 @@ service AuthService { rpc SystemUpdatePin (SystemUpdatePinRequest) returns (SystemUpdatePinResponse); rpc SystemBlockIp(SystemBlockIpRequest) returns (SystemBlockIpResponse); rpc SystemUnblockIp(SystemUnblockIpRequest) returns (SystemUnblockIpResponse); + rpc SystemGetAllAccounts (SystemGetAllAccountsRequest) returns (SystemGetAllAccountsResponse); } message LoginRequest { @@ -182,4 +183,20 @@ message SystemUnblockIpRequest { message SystemUnblockIpResponse { bool success = 2; +} + +message SystemGetAllAccountsRequest { + int32 limit = 1; + int32 offset = 2; +} + +message AccountBasicItem { + string id = 1; + string username = 2; + string status = 3; +} + +message SystemGetAllAccountsResponse { + repeated AccountBasicItem accounts = 1; + int32 total = 2; } \ No newline at end of file diff --git a/proto/users/users.proto b/proto/users/users.proto index 18dfa5a..1b2b92e 100644 --- a/proto/users/users.proto +++ b/proto/users/users.proto @@ -17,6 +17,8 @@ service UsersService { rpc GetBlockedUsers (GetBlockedUsersRequest) returns (GetBlockedUsersResponse); rpc AddContact (AddContactRequest) returns (AddContactResponse); rpc GetContacts (GetContactsRequest) returns (GetContactsResponse); + + rpc SystemGetProfileBatch(SystemGetProfileBatchRequest) returns (SystemGetProfileBatchResponse); } message UserSettingsMessage { @@ -129,4 +131,20 @@ message GetBlockedUsersRequest { } message GetBlockedUsersResponse { repeated BlockedUserItem blocked_users = 1; +} + +message SystemGetProfileBatchRequest { + repeated string user_ids = 1; +} + +message ProfileBasicItem { + string id = 1; + optional string email = 2; + optional string phone = 3; + optional string full_name = 4; + bool is_public = 5; +} + +message SystemGetProfileBatchResponse { + repeated ProfileBasicItem profiles = 1; } \ No newline at end of file