chore: move controllers and middleware (#8119)

This commit is contained in:
Jason Rasmussen 2024-03-20 15:15:01 -05:00 committed by GitHub
parent 81f0265095
commit 40e079a247
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 55 additions and 60 deletions

View 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);
}
}