fix idp on started
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Controller, UseFilters } from '@nestjs/common';
|
||||
import { BadRequestException, Controller, UseFilters } from '@nestjs/common';
|
||||
import { GrpcMethod } from '@nestjs/microservices';
|
||||
import { GrpcExceptionFilter } from '../infra/grpc-exception.filter';
|
||||
import { AdminService } from './admin.service';
|
||||
@@ -20,6 +20,7 @@ import { FamilyService } from './family.service';
|
||||
import { MediaService } from './media.service';
|
||||
import { NotificationsService } from './notifications.service';
|
||||
import { ChatService } from './chat.service';
|
||||
import { MessagingService } from '../infra/messaging.service';
|
||||
|
||||
@Controller()
|
||||
@UseFilters(new GrpcExceptionFilter())
|
||||
@@ -41,7 +42,8 @@ export class AuthGrpcController {
|
||||
private readonly family: FamilyService,
|
||||
private readonly media: MediaService,
|
||||
private readonly notifications: NotificationsService,
|
||||
private readonly chat: ChatService
|
||||
private readonly chat: ChatService,
|
||||
private readonly messaging: MessagingService
|
||||
) {}
|
||||
|
||||
@GrpcMethod('AuthService', 'Register')
|
||||
@@ -437,6 +439,15 @@ export class AuthGrpcController {
|
||||
return this.settings.deleteSocialProvider(command.providerName);
|
||||
}
|
||||
|
||||
@GrpcMethod('SettingsService', 'TestMessagingDelivery')
|
||||
async testMessagingDelivery(command: { channel: string; target: string }) {
|
||||
const channel = command.channel === 'sms' ? 'sms' : 'email';
|
||||
if (!command.target?.trim()) {
|
||||
throw new BadRequestException('Укажите email или номер телефона для тестовой отправки');
|
||||
}
|
||||
return this.messaging.sendTestDelivery(channel, command.target.trim());
|
||||
}
|
||||
|
||||
@GrpcMethod('ProfileService', 'GetProfile')
|
||||
getProfile(command: { userId: string }) {
|
||||
return this.profile.getProfile(command.userId);
|
||||
|
||||
Reference in New Issue
Block a user