mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-10-25 08:27:54 +00:00
finished refactor devices module
This commit is contained in:
@@ -10,16 +10,8 @@ export class AddDeviceDto {
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
public deviceTuyaUuid: string;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'userUuid',
|
||||
required: true,
|
||||
})
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
public userUuid: string;
|
||||
}
|
||||
export class UpdateDeviceInSpaceDto {
|
||||
export class AssignDeviceToSpaceDto {
|
||||
@ApiProperty({
|
||||
description: 'deviceUuid',
|
||||
required: true,
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
import { BatchDeviceTypeEnum } from '@app/common/constants/batch-device.enum';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsArray, IsNotEmpty, IsOptional, IsString } from 'class-validator';
|
||||
import {
|
||||
IsArray,
|
||||
IsEnum,
|
||||
IsNotEmpty,
|
||||
IsOptional,
|
||||
IsString,
|
||||
} from 'class-validator';
|
||||
|
||||
export class ControlDeviceDto {
|
||||
@ApiProperty({
|
||||
@@ -17,6 +24,15 @@ export class ControlDeviceDto {
|
||||
public value: any;
|
||||
}
|
||||
export class BatchControlDevicesDto {
|
||||
@ApiProperty({
|
||||
description: 'Operation type',
|
||||
enum: BatchDeviceTypeEnum,
|
||||
required: true,
|
||||
})
|
||||
@IsEnum(BatchDeviceTypeEnum)
|
||||
@IsNotEmpty()
|
||||
public operationType: BatchDeviceTypeEnum;
|
||||
|
||||
@ApiProperty({
|
||||
description: 'devicesUuid',
|
||||
required: true,
|
||||
|
||||
Reference in New Issue
Block a user