mirror of
https://github.com/immich-app/immich.git
synced 2026-05-24 16:42:30 -04:00
feat: endpoint descriptions (#23813)
This commit is contained in:
@@ -1,18 +1,19 @@
|
||||
import { Controller, Get, Header, Query } from '@nestjs/common';
|
||||
import { ApiOkResponse, ApiTags } from '@nestjs/swagger';
|
||||
import { ApiOkResponse, ApiOperation, ApiTags } from '@nestjs/swagger';
|
||||
import { AuthDto } from 'src/dtos/auth.dto';
|
||||
import { TimeBucketAssetDto, TimeBucketAssetResponseDto, TimeBucketDto } from 'src/dtos/time-bucket.dto';
|
||||
import { Permission } from 'src/enum';
|
||||
import { ApiTag, Permission } from 'src/enum';
|
||||
import { Auth, Authenticated } from 'src/middleware/auth.guard';
|
||||
import { TimelineService } from 'src/services/timeline.service';
|
||||
|
||||
@ApiTags('Timeline')
|
||||
@ApiTags(ApiTag.Timeline)
|
||||
@Controller('timeline')
|
||||
export class TimelineController {
|
||||
constructor(private service: TimelineService) {}
|
||||
|
||||
@Get('buckets')
|
||||
@Authenticated({ permission: Permission.AssetRead, sharedLink: true })
|
||||
@ApiOperation({ summary: 'Get time buckets', description: 'Retrieve a list of all minimal time buckets.' })
|
||||
getTimeBuckets(@Auth() auth: AuthDto, @Query() dto: TimeBucketDto) {
|
||||
return this.service.getTimeBuckets(auth, dto);
|
||||
}
|
||||
@@ -21,6 +22,10 @@ export class TimelineController {
|
||||
@Authenticated({ permission: Permission.AssetRead, sharedLink: true })
|
||||
@ApiOkResponse({ type: TimeBucketAssetResponseDto })
|
||||
@Header('Content-Type', 'application/json')
|
||||
@ApiOperation({
|
||||
summary: 'Get time bucket',
|
||||
description: 'Retrieve a string of all asset ids in a given time bucket.',
|
||||
})
|
||||
getTimeBucket(@Auth() auth: AuthDto, @Query() dto: TimeBucketAssetDto) {
|
||||
return this.service.getTimeBucket(auth, dto);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user