mirror of
https://github.com/immich-app/immich.git
synced 2025-06-03 05:34:32 -04:00
24 lines
761 B
TypeScript
24 lines
761 B
TypeScript
import { AllJobStatusResponseDto, JobCommandDto, JobIdParamDto, JobService, JobStatusDto } from '@app/domain';
|
|
import { Body, Controller, Get, Param, Put } from '@nestjs/common';
|
|
import { ApiTags } from '@nestjs/swagger';
|
|
import { Authenticated } from '../app.guard';
|
|
import { UseValidation } from '../app.utils';
|
|
|
|
@ApiTags('Job')
|
|
@Controller('jobs')
|
|
@Authenticated({ admin: true })
|
|
@UseValidation()
|
|
export class JobController {
|
|
constructor(private service: JobService) {}
|
|
|
|
@Get()
|
|
getAllJobsStatus(): Promise<AllJobStatusResponseDto> {
|
|
return this.service.getAllJobsStatus();
|
|
}
|
|
|
|
@Put(':id')
|
|
sendJobCommand(@Param() { id }: JobIdParamDto, @Body() dto: JobCommandDto): Promise<JobStatusDto> {
|
|
return this.service.handleCommand(id, dto);
|
|
}
|
|
}
|