mirror of
https://github.com/KevinMidboe/immich.git
synced 2026-01-22 00:55:52 +00:00
refactor(server): device info (#1490)
* refactor(server): device info * fix: export device service --------- Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import { DeviceInfoEntity, DeviceType } from '@app/infra/db/entities';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
|
||||
export class DeviceInfoResponseDto {
|
||||
@ApiProperty({ type: 'integer' })
|
||||
id!: number;
|
||||
userId!: string;
|
||||
deviceId!: string;
|
||||
|
||||
@ApiProperty({ enumName: 'DeviceTypeEnum', enum: DeviceType })
|
||||
deviceType!: DeviceType;
|
||||
|
||||
createdAt!: string;
|
||||
isAutoBackup!: boolean;
|
||||
}
|
||||
|
||||
export function mapDeviceInfoResponse(entity: DeviceInfoEntity): DeviceInfoResponseDto {
|
||||
return {
|
||||
id: entity.id,
|
||||
userId: entity.userId,
|
||||
deviceId: entity.deviceId,
|
||||
deviceType: entity.deviceType,
|
||||
createdAt: entity.createdAt,
|
||||
isAutoBackup: entity.isAutoBackup,
|
||||
};
|
||||
}
|
||||
1
server/libs/domain/src/device-info/response-dto/index.ts
Normal file
1
server/libs/domain/src/device-info/response-dto/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from './device-info-response.dto';
|
||||
Reference in New Issue
Block a user