mirror of
				https://github.com/immich-app/immich.git
				synced 2025-11-02 18:47:07 -05:00 
			
		
		
		
	refactor(server): person dto (#3058)
This commit is contained in:
		
							parent
							
								
									399312ead3
								
							
						
					
					
						commit
						49f1f6cad7
					
				@ -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';
 | 
				
			||||||
 | 
				
			|||||||
@ -1 +0,0 @@
 | 
				
			|||||||
export * from './person-update.dto';
 | 
					 | 
				
			||||||
@ -1,7 +0,0 @@
 | 
				
			|||||||
import { IsNotEmpty, IsString } from 'class-validator';
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
export class PersonUpdateDto {
 | 
					 | 
				
			||||||
  @IsNotEmpty()
 | 
					 | 
				
			||||||
  @IsString()
 | 
					 | 
				
			||||||
  name!: string;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
@ -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';
 | 
					 | 
				
			||||||
 | 
				
			|||||||
@ -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;
 | 
				
			||||||
@ -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',
 | 
				
			||||||
 | 
				
			|||||||
@ -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 {
 | 
				
			||||||
 | 
				
			|||||||
@ -1 +0,0 @@
 | 
				
			|||||||
export * from './person-response.dto';
 | 
					 | 
				
			||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user