Files
mudita-center/libs/core/device/controllers/device.controller.ts
Michał Kurczewski c345fb5248 [CP-2785] I want to confirm the start of data migration (#1903)
Co-authored-by: Łukasz Kowalczyk <freelancer.lukasz.kowalczyk@gmail.com>
Co-authored-by: Łukasz Kowalczyk <37898730+lkowalczyk87@users.noreply.github.com>
Co-authored-by: patrycja-paczkowska <88655668+patrycja-paczkowska@users.noreply.github.com>
Co-authored-by: Tomasz Malecki <135224481+tomaszmaleckimudita@users.noreply.github.com>
Co-authored-by: Daniel Karski <daniel.karski5q@gmail.com>
2024-06-04 14:06:15 +02:00

41 lines
1.1 KiB
TypeScript

/**
* Copyright (c) Mudita sp. z o.o. All rights reserved.
* For licensing, see https://github.com/mudita/mudita-center/blob/master/LICENSE.md
*/
import { IpcEvent } from "Core/core/decorators"
import { ResultObject } from "Core/core/builder"
import { DeviceService } from "Core/device/services"
import { PhoneLockTime } from "Core/device/dto"
import { IpcDeviceEvent } from "Core/device/constants"
import { DeviceId } from "Core/device/constants/device-id"
export class DeviceController {
constructor(private deviceService: DeviceService) {}
@IpcEvent(IpcDeviceEvent.Unlock)
public async unlockDevice({
code,
deviceId,
}: {
code: string
deviceId?: DeviceId
}): Promise<ResultObject<boolean>> {
return this.deviceService.unlock(code, deviceId)
}
@IpcEvent(IpcDeviceEvent.UnlockStatus)
public async unlockDeviceStatus(
deviceId?: DeviceId
): Promise<ResultObject<unknown>> {
return this.deviceService.unlockStatus(deviceId)
}
@IpcEvent(IpcDeviceEvent.LockTime)
public async deviceLockTime(
deviceId?: DeviceId
): Promise<ResultObject<PhoneLockTime>> {
return this.deviceService.unlockTime(deviceId)
}
}