mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-10-27 05:57:55 +00:00
finshed get devices by room id
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsNotEmpty, IsString, IsNumberString } from 'class-validator';
|
||||
|
||||
export class AddDeviceDto {
|
||||
@ApiProperty({
|
||||
description: 'deviceName',
|
||||
required: true,
|
||||
})
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
public deviceName: string;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'homeId',
|
||||
required: true,
|
||||
})
|
||||
@IsNumberString()
|
||||
@IsNotEmpty()
|
||||
public homeId: string;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'productId',
|
||||
required: true,
|
||||
})
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
public productId: string;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'The list of up to 20 device IDs, separated with commas (,)',
|
||||
required: true,
|
||||
})
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
public deviceIds: string;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsNotEmpty, IsObject, IsNumberString } from 'class-validator';
|
||||
|
||||
export class ControlDeviceDto {
|
||||
@ApiProperty({
|
||||
description: 'deviceId',
|
||||
required: true,
|
||||
})
|
||||
@IsNumberString()
|
||||
@IsNotEmpty()
|
||||
public deviceId: string;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'example {"switch_1":true,"add_ele":300}',
|
||||
required: true,
|
||||
})
|
||||
@IsObject()
|
||||
@IsNotEmpty()
|
||||
public properties: object;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsNotEmpty, IsNumberString } from 'class-validator';
|
||||
|
||||
export class GetDeviceDto {
|
||||
@ApiProperty({
|
||||
description: 'roomId',
|
||||
required: true,
|
||||
})
|
||||
@IsNumberString()
|
||||
@IsNotEmpty()
|
||||
public roomId: string;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'pageSize',
|
||||
required: true,
|
||||
})
|
||||
@IsNumberString()
|
||||
@IsNotEmpty()
|
||||
public pageSize: number;
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
export * from './add.device.dto';
|
||||
export * from './control.device.dto';
|
||||
export * from './get.device.dto';
|
||||
export * from './rename.device.dto copy';
|
||||
@@ -0,0 +1,20 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsNotEmpty, IsString, IsNumberString } from 'class-validator';
|
||||
|
||||
export class RenameDeviceDto {
|
||||
@ApiProperty({
|
||||
description: 'deviceId',
|
||||
required: true,
|
||||
})
|
||||
@IsNumberString()
|
||||
@IsNotEmpty()
|
||||
public deviceId: string;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'deviceName',
|
||||
required: true,
|
||||
})
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
public deviceName: string;
|
||||
}
|
||||
Reference in New Issue
Block a user