feat: complete cmpp platform phases 0-5
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
import { Body, Controller, Get, Post } from '@nestjs/common';
|
||||
import { ApiTags } from '@nestjs/swagger';
|
||||
import { TenantId } from '../common/tenant-id.decorator';
|
||||
import {
|
||||
CreateBlacklistDto,
|
||||
CreateDrainageFieldDto,
|
||||
CreatePhoneSegmentDto,
|
||||
CreateSensitiveWordDto,
|
||||
DictionariesService,
|
||||
} from './dictionaries.service';
|
||||
|
||||
@ApiTags('dictionaries')
|
||||
@Controller('admin/dictionaries')
|
||||
export class DictionariesController {
|
||||
constructor(private readonly dictionaries: DictionariesService) {}
|
||||
|
||||
@Get('phone-segments')
|
||||
listPhoneSegments() {
|
||||
return this.dictionaries.listPhoneSegments();
|
||||
}
|
||||
|
||||
@Post('phone-segments')
|
||||
createPhoneSegment(@Body() body: CreatePhoneSegmentDto) {
|
||||
return this.dictionaries.createPhoneSegment(body);
|
||||
}
|
||||
|
||||
@Get('sensitive-words')
|
||||
listSensitiveWords() {
|
||||
return this.dictionaries.listSensitiveWords();
|
||||
}
|
||||
|
||||
@Post('sensitive-words')
|
||||
createSensitiveWord(@Body() body: CreateSensitiveWordDto) {
|
||||
return this.dictionaries.createSensitiveWord(body);
|
||||
}
|
||||
|
||||
@Get('blacklists/global')
|
||||
listGlobalBlacklist() {
|
||||
return this.dictionaries.listGlobalBlacklist();
|
||||
}
|
||||
|
||||
@Post('blacklists/global')
|
||||
createGlobalBlacklist(@Body() body: CreateBlacklistDto) {
|
||||
return this.dictionaries.createGlobalBlacklist(body);
|
||||
}
|
||||
|
||||
@Get('blacklists/enterprise')
|
||||
listEnterpriseBlacklist(@TenantId() tenantId?: string) {
|
||||
return this.dictionaries.listEnterpriseBlacklist(tenantId);
|
||||
}
|
||||
|
||||
@Post('blacklists/enterprise')
|
||||
createEnterpriseBlacklist(@Body() body: CreateBlacklistDto) {
|
||||
return this.dictionaries.createEnterpriseBlacklist(body);
|
||||
}
|
||||
|
||||
@Get('drainage-fields')
|
||||
listDrainageFields() {
|
||||
return this.dictionaries.listDrainageFields();
|
||||
}
|
||||
|
||||
@Post('drainage-fields')
|
||||
createDrainageField(@Body() body: CreateDrainageFieldDto) {
|
||||
return this.dictionaries.createDrainageField(body);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user