|
|
|
@ -153,6 +153,7 @@ export class GatewayController { |
|
|
|
|
|
|
|
@ApiOperation({ summary: 'Update SMS status' }) |
|
|
|
@UseGuards(AuthGuard, CanModifyDevice) |
|
|
|
@HttpCode(HttpStatus.OK) |
|
|
|
@Patch('/devices/:id/sms-status') |
|
|
|
async updateSMSStatus( |
|
|
|
@Param('id') deviceId: string, |
|
|
|
@ -161,4 +162,26 @@ export class GatewayController { |
|
|
|
const data = await this.gatewayService.updateSMSStatus(deviceId, dto); |
|
|
|
return { data }; |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation({ summary: 'Get a single SMS by ID' }) |
|
|
|
@UseGuards(AuthGuard, CanModifyDevice) |
|
|
|
@Get('/devices/:id/sms/:smsId') |
|
|
|
async getSMSById( |
|
|
|
@Param('id') deviceId: string, |
|
|
|
@Param('smsId') smsId: string, |
|
|
|
) { |
|
|
|
const data = await this.gatewayService.getSMSById(deviceId, smsId); |
|
|
|
return { data }; |
|
|
|
} |
|
|
|
|
|
|
|
@ApiOperation({ summary: 'Get an SMS batch by ID with all its SMS messages' }) |
|
|
|
@UseGuards(AuthGuard, CanModifyDevice) |
|
|
|
@Get('/devices/:id/sms-batch/:smsBatchId') |
|
|
|
async getSmsBatchById( |
|
|
|
@Param('id') deviceId: string, |
|
|
|
@Param('smsBatchId') smsBatchId: string, |
|
|
|
) { |
|
|
|
const data = await this.gatewayService.getSmsBatchById(deviceId, smsBatchId); |
|
|
|
return { data }; |
|
|
|
} |
|
|
|
} |