mirror of
https://github.com/immich-app/immich.git
synced 2025-11-14 04:42:42 +09:00
chore: move controllers and middleware (#8119)
This commit is contained in:
40
server/src/controllers/system-config.controller.ts
Normal file
40
server/src/controllers/system-config.controller.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import { Body, Controller, Get, Put, Query } from '@nestjs/common';
|
||||
import { ApiTags } from '@nestjs/swagger';
|
||||
import { SystemConfigDto } from 'src/domain/system-config/dto/system-config.dto';
|
||||
import { SystemConfigTemplateStorageOptionDto } from 'src/domain/system-config/response-dto/system-config-template-storage-option.dto';
|
||||
import { MapThemeDto } from 'src/domain/system-config/system-config-map-theme.dto';
|
||||
import { SystemConfigService } from 'src/domain/system-config/system-config.service';
|
||||
import { AdminRoute, Authenticated } from 'src/middleware/auth.guard';
|
||||
|
||||
@ApiTags('System Config')
|
||||
@Controller('system-config')
|
||||
@Authenticated({ admin: true })
|
||||
export class SystemConfigController {
|
||||
constructor(private readonly service: SystemConfigService) {}
|
||||
|
||||
@Get()
|
||||
getConfig(): Promise<SystemConfigDto> {
|
||||
return this.service.getConfig();
|
||||
}
|
||||
|
||||
@Get('defaults')
|
||||
getConfigDefaults(): SystemConfigDto {
|
||||
return this.service.getDefaults();
|
||||
}
|
||||
|
||||
@Put()
|
||||
updateConfig(@Body() dto: SystemConfigDto): Promise<SystemConfigDto> {
|
||||
return this.service.updateConfig(dto);
|
||||
}
|
||||
|
||||
@Get('storage-template-options')
|
||||
getStorageTemplateOptions(): SystemConfigTemplateStorageOptionDto {
|
||||
return this.service.getStorageTemplateOptions();
|
||||
}
|
||||
|
||||
@AdminRoute(false)
|
||||
@Get('map/style.json')
|
||||
getMapStyle(@Query() dto: MapThemeDto) {
|
||||
return this.service.getMapStyle(dto.theme);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user