1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00
pigallery2/common/entities/DirectoryDTO.ts

30 lines
633 B
TypeScript
Raw Normal View History

2016-12-28 03:55:51 +08:00
import {PhotoDTO} from "./PhotoDTO";
export interface DirectoryDTO {
id: number;
name: string;
path: string;
2017-07-20 02:47:09 +08:00
lastModified: number;
lastScanned: number;
parent: DirectoryDTO;
directories: Array<DirectoryDTO>;
photos: Array<PhotoDTO>;
}
2017-07-08 06:18:24 +08:00
2017-07-20 02:47:09 +08:00
export interface NotModifiedDirectoryDTO {
notModified: boolean;
}
2017-07-09 18:03:17 +08:00
export module DirectoryDTO {
export const addReferences = (dir: DirectoryDTO): void => {
2017-07-08 06:18:24 +08:00
dir.photos.forEach((photo: PhotoDTO) => {
photo.directory = dir;
});
dir.directories.forEach((directory: DirectoryDTO) => {
addReferences(directory);
directory.parent = dir;
});
}
}