mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 21:54:54 +00:00
added controller
This commit is contained in:
@ -138,6 +138,7 @@ export class DeviceController {
|
||||
async getAllDevices() {
|
||||
return await this.deviceService.getAllDevices();
|
||||
}
|
||||
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get('report-logs/:deviceUuid')
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
export interface GetDeviceDetailsInterface {
|
||||
activeTime: number;
|
||||
assetId: string;
|
||||
assetId?: string;
|
||||
category: string;
|
||||
categoryName: string;
|
||||
createTime: number;
|
||||
@ -13,6 +13,7 @@ export interface GetDeviceDetailsInterface {
|
||||
lon: string;
|
||||
model: string;
|
||||
name: string;
|
||||
battery?: number;
|
||||
nodeId: string;
|
||||
online: boolean;
|
||||
productId?: string;
|
||||
@ -23,6 +24,18 @@ export interface GetDeviceDetailsInterface {
|
||||
uuid: string;
|
||||
productType: string;
|
||||
productUuid: string;
|
||||
spaces?: SpaceInterface[];
|
||||
community?: CommunityInterface;
|
||||
}
|
||||
|
||||
export interface SpaceInterface {
|
||||
uuid: string;
|
||||
spaceName: string;
|
||||
}
|
||||
|
||||
export interface CommunityInterface {
|
||||
uuid: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface addDeviceInRoomInterface {
|
||||
|
||||
@ -614,12 +614,12 @@ export class DeviceService {
|
||||
}
|
||||
}
|
||||
async getDevicesInstructionStatus(deviceUuid: string) {
|
||||
const deviceDetails = await this.getDeviceByDeviceUuid(deviceUuid);
|
||||
|
||||
if (!deviceDetails) {
|
||||
throw new NotFoundException('Device Not Found');
|
||||
}
|
||||
try {
|
||||
const deviceDetails = await this.getDeviceByDeviceUuid(deviceUuid);
|
||||
|
||||
if (!deviceDetails) {
|
||||
throw new NotFoundException('Device Not Found');
|
||||
}
|
||||
const deviceStatus = await this.getDevicesInstructionStatusTuya(
|
||||
deviceDetails.deviceTuyaUuid,
|
||||
);
|
||||
@ -902,12 +902,12 @@ export class DeviceService {
|
||||
name: device.spaceDevice.community.name,
|
||||
},
|
||||
// permissionType: device.permission[0].permissionType.type,
|
||||
/* ...(await this.getDeviceDetailsByDeviceIdTuya(
|
||||
...(await this.getDeviceDetailsByDeviceIdTuya(
|
||||
device.deviceTuyaUuid,
|
||||
)),*/
|
||||
)),
|
||||
uuid: device.uuid,
|
||||
...(battery && { battery }),
|
||||
};
|
||||
} as GetDeviceDetailsInterface;
|
||||
}),
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user