mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-15 10:25:23 +00:00
43 lines
625 B
TypeScript
43 lines
625 B
TypeScript
import {
|
|
IsString,
|
|
IsArray,
|
|
ValidateNested,
|
|
IsNotEmpty,
|
|
IsOptional,
|
|
} from 'class-validator';
|
|
import { Type } from 'class-transformer';
|
|
|
|
class StatusDto {
|
|
@IsString()
|
|
code: string;
|
|
|
|
@IsNotEmpty()
|
|
value: any;
|
|
t?: string | number | Date;
|
|
}
|
|
|
|
export class AddDeviceStatusDto {
|
|
@IsString()
|
|
@IsOptional()
|
|
deviceUuid?: string;
|
|
|
|
@IsString()
|
|
deviceTuyaUuid: string;
|
|
|
|
@IsString()
|
|
@IsOptional()
|
|
productUuid?: string;
|
|
|
|
@IsString()
|
|
@IsOptional()
|
|
productType?: string;
|
|
|
|
@IsArray()
|
|
@ValidateNested({ each: true })
|
|
@Type(() => StatusDto)
|
|
status: StatusDto[];
|
|
|
|
@IsOptional()
|
|
log?: any;
|
|
}
|