mirror of
https://github.com/immich-app/immich.git
synced 2025-11-19 20:22:34 +09:00
chore: move controllers and middleware (#8119)
This commit is contained in:
22
server/src/controllers/job.controller.ts
Normal file
22
server/src/controllers/job.controller.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { Body, Controller, Get, Param, Put } from '@nestjs/common';
|
||||
import { ApiTags } from '@nestjs/swagger';
|
||||
import { AllJobStatusResponseDto, JobCommandDto, JobIdParamDto, JobStatusDto } from 'src/domain/job/job.dto';
|
||||
import { JobService } from 'src/domain/job/job.service';
|
||||
import { Authenticated } from 'src/middleware/auth.guard';
|
||||
|
||||
@ApiTags('Job')
|
||||
@Controller('jobs')
|
||||
@Authenticated({ admin: true })
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user