diff --git a/backend/services/authorization-service/src/api/dto/request/query-authorizations.dto.ts b/backend/services/authorization-service/src/api/dto/request/query-authorizations.dto.ts index 4c6ca1cb..850507fd 100644 --- a/backend/services/authorization-service/src/api/dto/request/query-authorizations.dto.ts +++ b/backend/services/authorization-service/src/api/dto/request/query-authorizations.dto.ts @@ -1,6 +1,6 @@ -import { IsOptional, IsString, IsEnum, IsInt, Min, Max } from 'class-validator' +import { IsOptional, IsString, IsEnum, IsInt, Min, Max, IsBoolean } from 'class-validator' import { ApiPropertyOptional } from '@nestjs/swagger' -import { Type } from 'class-transformer' +import { Type, Transform } from 'class-transformer' import { RoleType } from '@/domain/enums' export class QueryAuthorizationsDto { @@ -16,6 +16,8 @@ export class QueryAuthorizationsDto { @ApiPropertyOptional({ description: '是否包含已撤销的授权', default: false }) @IsOptional() + @Transform(({ value }) => value === 'true' || value === true) + @IsBoolean() includeRevoked?: boolean @ApiPropertyOptional({ description: '页码', default: 1 })