任务详情添加日志列表,更新依赖

This commit is contained in:
whyour
2022-03-05 01:24:52 +08:00
parent 912b4ddb76
commit 810c6ca76c
10 changed files with 235 additions and 11790 deletions
+20
View File
@@ -333,4 +333,24 @@ export default (app: Router) => {
}
},
);
route.get(
'/:id/logs',
celebrate({
params: Joi.object({
id: Joi.number().required(),
}),
}),
async (req: Request, res: Response, next: NextFunction) => {
const logger: Logger = Container.get('logger');
try {
const cronService = Container.get(CronService);
const data = await cronService.logs(parseInt(req.params.id));
return res.send({ code: 200, data });
} catch (e) {
logger.error('🔥 error: %o', e);
return next(e);
}
},
);
};