mirror of
https://github.com/immich-app/immich.git
synced 2025-12-25 09:14:58 +03:00
feat: endpoint descriptions (#23813)
This commit is contained in:
@@ -1,21 +1,25 @@
|
||||
import { Body, Controller, Get, HttpCode, HttpStatus, Post } from '@nestjs/common';
|
||||
import { ApiTags } from '@nestjs/swagger';
|
||||
import { ApiOperation, ApiTags } from '@nestjs/swagger';
|
||||
import {
|
||||
AdminOnboardingUpdateDto,
|
||||
ReverseGeocodingStateResponseDto,
|
||||
VersionCheckStateResponseDto,
|
||||
} from 'src/dtos/system-metadata.dto';
|
||||
import { Permission } from 'src/enum';
|
||||
import { ApiTag, Permission } from 'src/enum';
|
||||
import { Authenticated } from 'src/middleware/auth.guard';
|
||||
import { SystemMetadataService } from 'src/services/system-metadata.service';
|
||||
|
||||
@ApiTags('System Metadata')
|
||||
@ApiTags(ApiTag.SystemMetadata)
|
||||
@Controller('system-metadata')
|
||||
export class SystemMetadataController {
|
||||
constructor(private service: SystemMetadataService) {}
|
||||
|
||||
@Get('admin-onboarding')
|
||||
@Authenticated({ permission: Permission.SystemMetadataRead, admin: true })
|
||||
@ApiOperation({
|
||||
summary: 'Retrieve admin onboarding',
|
||||
description: 'Retrieve the current admin onboarding status.',
|
||||
})
|
||||
getAdminOnboarding(): Promise<AdminOnboardingUpdateDto> {
|
||||
return this.service.getAdminOnboarding();
|
||||
}
|
||||
@@ -23,18 +27,30 @@ export class SystemMetadataController {
|
||||
@Post('admin-onboarding')
|
||||
@Authenticated({ permission: Permission.SystemMetadataUpdate, admin: true })
|
||||
@HttpCode(HttpStatus.NO_CONTENT)
|
||||
@ApiOperation({
|
||||
summary: 'Update admin onboarding',
|
||||
description: 'Update the admin onboarding status.',
|
||||
})
|
||||
updateAdminOnboarding(@Body() dto: AdminOnboardingUpdateDto): Promise<void> {
|
||||
return this.service.updateAdminOnboarding(dto);
|
||||
}
|
||||
|
||||
@Get('reverse-geocoding-state')
|
||||
@Authenticated({ permission: Permission.SystemMetadataRead, admin: true })
|
||||
@ApiOperation({
|
||||
summary: 'Retrieve reverse geocoding state',
|
||||
description: 'Retrieve the current state of the reverse geocoding import.',
|
||||
})
|
||||
getReverseGeocodingState(): Promise<ReverseGeocodingStateResponseDto> {
|
||||
return this.service.getReverseGeocodingState();
|
||||
}
|
||||
|
||||
@Get('version-check-state')
|
||||
@Authenticated({ permission: Permission.SystemMetadataRead, admin: true })
|
||||
@ApiOperation({
|
||||
summary: 'Retrieve version check state',
|
||||
description: 'Retrieve the current state of the version check process.',
|
||||
})
|
||||
getVersionCheckState(): Promise<VersionCheckStateResponseDto> {
|
||||
return this.service.getVersionCheckState();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user