mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
Transfer repository from Gitlab
This commit is contained in:
31
server/src/api-v1/asset/dto/create-asset.dto.ts
Normal file
31
server/src/api-v1/asset/dto/create-asset.dto.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
import { IsNotEmpty, IsOptional } from 'class-validator';
|
||||
import { AssetType } from '../entities/asset.entity';
|
||||
|
||||
export class CreateAssetDto {
|
||||
@IsNotEmpty()
|
||||
deviceAssetId: string;
|
||||
|
||||
@IsNotEmpty()
|
||||
deviceId: string;
|
||||
|
||||
@IsNotEmpty()
|
||||
assetType: AssetType;
|
||||
|
||||
@IsNotEmpty()
|
||||
createdAt: string;
|
||||
|
||||
@IsNotEmpty()
|
||||
modifiedAt: string;
|
||||
|
||||
@IsNotEmpty()
|
||||
isFavorite: boolean;
|
||||
|
||||
@IsNotEmpty()
|
||||
fileExtension: string;
|
||||
|
||||
@IsOptional()
|
||||
lat: string;
|
||||
|
||||
@IsOptional()
|
||||
lon: string;
|
||||
}
|
||||
6
server/src/api-v1/asset/dto/get-all-asset-query.dto.ts
Normal file
6
server/src/api-v1/asset/dto/get-all-asset-query.dto.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { IsNotEmpty, IsOptional } from 'class-validator';
|
||||
|
||||
export class GetAllAssetQueryDto {
|
||||
@IsOptional()
|
||||
nextPageKey: string;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import { AssetEntity } from '../entities/asset.entity';
|
||||
|
||||
export class GetAllAssetReponseDto {
|
||||
data: Array<{ date: string; assets: Array<AssetEntity> }>;
|
||||
count: number;
|
||||
nextPageKey: string;
|
||||
}
|
||||
6
server/src/api-v1/asset/dto/get-asset.dto.ts
Normal file
6
server/src/api-v1/asset/dto/get-asset.dto.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { IsNotEmpty } from 'class-validator';
|
||||
|
||||
class GetAssetDto {
|
||||
@IsNotEmpty()
|
||||
deviceId: string;
|
||||
}
|
||||
16
server/src/api-v1/asset/dto/serve-file.dto.ts
Normal file
16
server/src/api-v1/asset/dto/serve-file.dto.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { Transform } from 'class-transformer';
|
||||
import { IsBoolean, IsBooleanString, IsNotEmpty, IsOptional } from 'class-validator';
|
||||
|
||||
export class ServeFileDto {
|
||||
//assetId
|
||||
@IsNotEmpty()
|
||||
aid: string;
|
||||
|
||||
//deviceId
|
||||
@IsNotEmpty()
|
||||
did: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsBooleanString()
|
||||
isThumb: string;
|
||||
}
|
||||
4
server/src/api-v1/asset/dto/update-asset.dto.ts
Normal file
4
server/src/api-v1/asset/dto/update-asset.dto.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import { PartialType } from '@nestjs/mapped-types';
|
||||
import { CreateAssetDto } from './create-asset.dto';
|
||||
|
||||
export class UpdateAssetDto extends PartialType(CreateAssetDto) {}
|
||||
Reference in New Issue
Block a user