feat: scope blacklists and paginate phone segments

This commit is contained in:
hectorzhao
2026-07-10 13:42:39 +08:00
parent ff0756ff9c
commit d5e668a2e6
18 changed files with 322 additions and 86 deletions
@@ -1,6 +1,5 @@
import { Body, Controller, Delete, Get, Param, Post, Query } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { TenantId } from '../common/tenant-id.decorator';
import {
CreateBlacklistDto,
CreateDrainageFieldDto,
@@ -17,8 +16,12 @@ export class DictionariesController {
constructor(private readonly dictionaries: DictionariesService) {}
@Get('phone-segments')
listPhoneSegments() {
return this.dictionaries.listPhoneSegments();
listPhoneSegments(
@Query('keyword') keyword?: string,
@Query('cursor') cursor?: string,
@Query('pageSize') pageSize?: string,
) {
return this.dictionaries.listPhoneSegments({ keyword, cursor, pageSize: Number(pageSize) || undefined });
}
@Post('phone-segments')
@@ -77,8 +80,8 @@ export class DictionariesController {
}
@Get('blacklists/enterprise')
listEnterpriseBlacklist(@TenantId() tenantId?: string, @Query('keyword') keyword?: string, @Query('status') status?: string) {
return this.dictionaries.listEnterpriseBlacklist({ tenantId, keyword, status });
listEnterpriseBlacklist(@Query('tenantId') tenantId?: string, @Query('applicationId') applicationId?: string, @Query('keyword') keyword?: string, @Query('status') status?: string) {
return this.dictionaries.listEnterpriseBlacklist({ tenantId, applicationId, keyword, status });
}
@Post('blacklists/enterprise')