Freigabe #4
@@ -60,19 +60,19 @@ export class LabelPrintAgentController {
|
||||
|
||||
// Agent: nächsten Job abholen (Polling)
|
||||
@Get('jobs/next')
|
||||
async getNextJob(@Query('agentId') agentId: string, @Res({ passthrough: true }) res: Response) {
|
||||
async getNextJob(@Query('agentId') agentId: string, @Res() res: Response) {
|
||||
const job = await this.service.claimNextJob(agentId ?? 'unknown');
|
||||
if (!job) {
|
||||
res.status(HttpStatus.NO_CONTENT).send();
|
||||
return;
|
||||
}
|
||||
return {
|
||||
res.status(HttpStatus.OK).json({
|
||||
jobId: String(job.Id),
|
||||
labelImageBase64: job.LabelImageData ? job.LabelImageData.toString('base64') : null,
|
||||
labelImageContentType: 'image/png',
|
||||
labelWidthMm: job.LabelWidthMm,
|
||||
labelHeightMm: job.LabelHeightMm,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
// Agent: Bild separat abrufen
|
||||
|
||||
Reference in New Issue
Block a user