1
0
mirror of https://github.com/immich-app/immich.git synced 2024-12-26 10:50:29 +02:00

refactor(server): person dto (#3058)

This commit is contained in:
Jason Rasmussen 2023-06-30 21:52:40 -04:00 committed by GitHub
parent 399312ead3
commit 49f1f6cad7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 11 additions and 15 deletions

View File

@ -1,6 +1,6 @@
import { AssetEntity, AssetType } from '@app/infra/entities'; import { AssetEntity, AssetType } from '@app/infra/entities';
import { ApiProperty } from '@nestjs/swagger'; import { ApiProperty } from '@nestjs/swagger';
import { mapFace, PersonResponseDto } from '../../person'; import { mapFace, PersonResponseDto } from '../../person/person.dto';
import { mapTag, TagResponseDto } from '../../tag'; import { mapTag, TagResponseDto } from '../../tag';
import { ExifResponseDto, mapExif } from './exif-response.dto'; import { ExifResponseDto, mapExif } from './exif-response.dto';
import { mapSmartInfo, SmartInfoResponseDto } from './smart-info-response.dto'; import { mapSmartInfo, SmartInfoResponseDto } from './smart-info-response.dto';

View File

@ -1 +0,0 @@
export * from './person-update.dto';

View File

@ -1,7 +0,0 @@
import { IsNotEmpty, IsString } from 'class-validator';
export class PersonUpdateDto {
@IsNotEmpty()
@IsString()
name!: string;
}

View File

@ -1,4 +1,3 @@
export * from './dto'; export * from './person.dto';
export * from './person.repository'; export * from './person.repository';
export * from './person.service'; export * from './person.service';
export * from './response-dto';

View File

@ -1,4 +1,11 @@
import { AssetFaceEntity, PersonEntity } from '@app/infra/entities'; import { AssetFaceEntity, PersonEntity } from '@app/infra/entities';
import { IsNotEmpty, IsString } from 'class-validator';
export class PersonUpdateDto {
@IsNotEmpty()
@IsString()
name!: string;
}
export class PersonResponseDto { export class PersonResponseDto {
id!: string; id!: string;

View File

@ -9,9 +9,9 @@ import {
} from '@test'; } from '@test';
import { IJobRepository, JobName } from '..'; import { IJobRepository, JobName } from '..';
import { IStorageRepository } from '../storage'; import { IStorageRepository } from '../storage';
import { PersonResponseDto } from './person.dto';
import { IPersonRepository } from './person.repository'; import { IPersonRepository } from './person.repository';
import { PersonService } from './person.service'; import { PersonService } from './person.service';
import { PersonResponseDto } from './response-dto';
const responseDto: PersonResponseDto = { const responseDto: PersonResponseDto = {
id: 'person-1', id: 'person-1',

View File

@ -3,9 +3,8 @@ import { AssetResponseDto, mapAsset } from '../asset';
import { AuthUserDto } from '../auth'; import { AuthUserDto } from '../auth';
import { IJobRepository, JobName } from '../job'; import { IJobRepository, JobName } from '../job';
import { ImmichReadStream, IStorageRepository } from '../storage'; import { ImmichReadStream, IStorageRepository } from '../storage';
import { PersonUpdateDto } from './dto'; import { mapPerson, PersonResponseDto, PersonUpdateDto } from './person.dto';
import { IPersonRepository } from './person.repository'; import { IPersonRepository } from './person.repository';
import { mapPerson, PersonResponseDto } from './response-dto';
@Injectable() @Injectable()
export class PersonService { export class PersonService {

View File

@ -1 +0,0 @@
export * from './person-response.dto';