fix: harden real backend admin workflows and ui
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Body, Controller, Delete, Get, Param, Post, Query } from '@nestjs/common';
|
||||
import { Body, Controller, Delete, Get, Param, Post, Put, Query } from '@nestjs/common';
|
||||
import { ApiTags } from '@nestjs/swagger';
|
||||
import { ReviewDto, SmsConfigService, StatusChangeDto } from './sms-config.service';
|
||||
import { CreateSmsApplicationDto, CreateSmsSignatureDto, CreateSmsTemplateDto, ReplaceApplicationRouteRulesDto, ReviewDto, SmsConfigService, StatusChangeDto, UpdateSmsApplicationDto, UpdateSmsSignatureDto, UpdateSmsTemplateDto } from './sms-config.service';
|
||||
|
||||
@ApiTags('admin-sms-config')
|
||||
@Controller('admin')
|
||||
@@ -12,6 +12,26 @@ export class AdminSmsConfigController {
|
||||
return this.smsConfig.listApplications({ tenantId, keyword, includeConnections: true });
|
||||
}
|
||||
|
||||
@Get('enterprise-applications/:id')
|
||||
getApplication(@Param('id') applicationId: string) {
|
||||
return this.smsConfig.getApplication(applicationId);
|
||||
}
|
||||
|
||||
@Post('enterprise-applications')
|
||||
createApplication(@Body() body: CreateSmsApplicationDto) {
|
||||
return this.smsConfig.createApplication(body);
|
||||
}
|
||||
|
||||
@Put('enterprise-applications/:id')
|
||||
updateApplication(@Param('id') applicationId: string, @Body() body: UpdateSmsApplicationDto) {
|
||||
return this.smsConfig.updateApplication(applicationId, body);
|
||||
}
|
||||
|
||||
@Put('enterprise-applications/:id/route-rules')
|
||||
replaceApplicationRouteRules(@Param('id') applicationId: string, @Body() body: ReplaceApplicationRouteRulesDto) {
|
||||
return this.smsConfig.replaceApplicationRouteRules(applicationId, body);
|
||||
}
|
||||
|
||||
@Get('enterprise-applications/:id/connections')
|
||||
listApplicationConnections(@Param('id') applicationId: string) {
|
||||
return this.smsConfig.listApplicationConnections(applicationId);
|
||||
@@ -33,8 +53,18 @@ export class AdminSmsConfigController {
|
||||
}
|
||||
|
||||
@Get('enterprise-signatures')
|
||||
listSignatures(@Query('tenantId') tenantId?: string) {
|
||||
return this.smsConfig.listSignatures(tenantId);
|
||||
listSignatures(@Query('tenantId') tenantId?: string, @Query('keyword') keyword?: string, @Query('status') status?: string) {
|
||||
return this.smsConfig.listSignatures({ tenantId, keyword, status });
|
||||
}
|
||||
|
||||
@Post('enterprise-signatures')
|
||||
createSignature(@Body() body: CreateSmsSignatureDto) {
|
||||
return this.smsConfig.createSignature(body);
|
||||
}
|
||||
|
||||
@Put('enterprise-signatures/:id')
|
||||
updateSignature(@Param('id') signatureId: string, @Body() body: UpdateSmsSignatureDto) {
|
||||
return this.smsConfig.updateSignature(signatureId, body);
|
||||
}
|
||||
|
||||
@Get('enterprise-templates')
|
||||
@@ -42,6 +72,16 @@ export class AdminSmsConfigController {
|
||||
return this.smsConfig.listTemplates({ tenantId, status, keyword });
|
||||
}
|
||||
|
||||
@Post('enterprise-templates')
|
||||
createTemplate(@Body() body: CreateSmsTemplateDto) {
|
||||
return this.smsConfig.createTemplate(body);
|
||||
}
|
||||
|
||||
@Put('enterprise-templates/:id')
|
||||
updateTemplate(@Param('id') templateId: string, @Body() body: UpdateSmsTemplateDto) {
|
||||
return this.smsConfig.updateTemplate(templateId, body);
|
||||
}
|
||||
|
||||
@Get('audit-records')
|
||||
listAuditRecords(@Query('targetType') targetType?: string, @Query('targetId') targetId?: string) {
|
||||
return this.smsConfig.listAuditRecords(targetType, targetId);
|
||||
|
||||
Reference in New Issue
Block a user