fix: track live downstream cmpp connections

This commit is contained in:
hectorzhao
2026-07-11 19:16:52 +08:00
parent 76e0417ccf
commit 2fea15ef25
21 changed files with 477 additions and 141 deletions
@@ -11,11 +11,15 @@ import {
GatewayUplinkEventDto,
SendChainService,
} from './send-chain.service';
import { GatewayDownstreamConnectionEventDto, SmsConfigService } from '../sms-config/sms-config.service';
@ApiTags('gateway-events')
@Controller('gateway/events')
export class GatewayEventsController {
constructor(private readonly sendChain: SendChainService) {}
constructor(
private readonly sendChain: SendChainService,
private readonly smsConfig: SmsConfigService,
) {}
@Post('submit-result')
submitResult(@Body() body: GatewaySubmitResultDto) {
@@ -47,6 +51,11 @@ export class GatewayEventsController {
return this.sendChain.submitInboundMessage(body);
}
@Post('inbound/connection')
inboundConnection(@Body() body: GatewayDownstreamConnectionEventDto) {
return this.smsConfig.recordDownstreamConnectionEvent(body);
}
@Post('downstream/pending')
pendingDownstream(@Body() body: GatewayPendingDeliveryQueryDto) {
return this.sendChain.listPendingDownstreamDeliveries(body);
+2 -2
View File
@@ -2,16 +2,16 @@ import { Module } from '@nestjs/common';
import { BillingModule } from '../billing/billing.module';
import { PrismaModule } from '../prisma/prisma.module';
import { RiskReviewModule } from '../risk-review/risk-review.module';
import { SmsConfigModule } from '../sms-config/sms-config.module';
import { AdminSendChainController } from './admin-send-chain.controller';
import { ClientSendChainController } from './client-send-chain.controller';
import { GatewayEventsController } from './gateway-events.controller';
import { SendChainService } from './send-chain.service';
@Module({
imports: [PrismaModule, BillingModule, RiskReviewModule],
imports: [PrismaModule, BillingModule, RiskReviewModule, SmsConfigModule],
controllers: [AdminSendChainController, ClientSendChainController, GatewayEventsController],
providers: [SendChainService],
exports: [SendChainService],
})
export class SendChainModule {}