fix(admin-service): 定价DTO添加class-validator装饰器,修复400错误
与auth-service支付密码DTO同样的问题:ValidationPipe的 forbidNonWhitelisted:true 导致无装饰器的DTO属性被拒绝。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
81ea35b712
commit
83ba9b7d54
|
|
@ -9,32 +9,48 @@ import {
|
|||
HttpStatus,
|
||||
} from '@nestjs/common';
|
||||
import { ApiTags, ApiOperation, ApiResponse } from '@nestjs/swagger';
|
||||
import { IsNumber, IsString, IsBoolean, IsOptional } from 'class-validator';
|
||||
import { TreePricingService } from './tree-pricing.service';
|
||||
|
||||
// ======================== DTO ========================
|
||||
|
||||
class UpdateSupplementDto {
|
||||
/** 新的加价金额(整数 USDT) */
|
||||
@IsNumber()
|
||||
newSupplement: number;
|
||||
/** 变更原因 */
|
||||
@IsString()
|
||||
reason: string;
|
||||
/** 操作人ID */
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
operatorId?: string;
|
||||
}
|
||||
|
||||
class UpdateAutoIncreaseDto {
|
||||
/** 是否启用自动涨价 */
|
||||
@IsBoolean()
|
||||
enabled: boolean;
|
||||
/** 每次自动涨价金额(整数 USDT) */
|
||||
@IsOptional()
|
||||
@IsNumber()
|
||||
amount?: number;
|
||||
/** 自动涨价间隔天数 */
|
||||
@IsOptional()
|
||||
@IsNumber()
|
||||
intervalDays?: number;
|
||||
/** 操作人ID */
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
operatorId?: string;
|
||||
}
|
||||
|
||||
class ChangeLogQueryDto {
|
||||
@IsOptional()
|
||||
@IsNumber()
|
||||
page?: number;
|
||||
@IsOptional()
|
||||
@IsNumber()
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue