mirror of
https://github.com/immich-app/immich.git
synced 2025-12-26 01:11:47 +03:00
feat: endpoint descriptions (#23813)
This commit is contained in:
@@ -1,23 +1,32 @@
|
||||
import { Controller, Get, Query } from '@nestjs/common';
|
||||
import { ApiTags } from '@nestjs/swagger';
|
||||
import { ApiOperation, ApiTags } from '@nestjs/swagger';
|
||||
import { AssetResponseDto } from 'src/dtos/asset-response.dto';
|
||||
import { AuthDto } from 'src/dtos/auth.dto';
|
||||
import { ApiTag } from 'src/enum';
|
||||
import { Auth, Authenticated } from 'src/middleware/auth.guard';
|
||||
import { ViewService } from 'src/services/view.service';
|
||||
|
||||
@ApiTags('View')
|
||||
@ApiTags(ApiTag.Views)
|
||||
@Controller('view')
|
||||
export class ViewController {
|
||||
constructor(private service: ViewService) {}
|
||||
|
||||
@Get('folder/unique-paths')
|
||||
@Authenticated()
|
||||
@ApiOperation({
|
||||
summary: 'Retrieve unique paths',
|
||||
description: 'Retrieve a list of unique folder paths from asset original paths.',
|
||||
})
|
||||
getUniqueOriginalPaths(@Auth() auth: AuthDto): Promise<string[]> {
|
||||
return this.service.getUniqueOriginalPaths(auth);
|
||||
}
|
||||
|
||||
@Get('folder')
|
||||
@Authenticated()
|
||||
@ApiOperation({
|
||||
summary: 'Retrieve assets by original path',
|
||||
description: 'Retrieve assets that are children of a specific folder.',
|
||||
})
|
||||
getAssetsByOriginalPath(@Auth() auth: AuthDto, @Query('path') path: string): Promise<AssetResponseDto[]> {
|
||||
return this.service.getAssetsByOriginalPath(auth, path);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user