task_log.ts 918 B

123456789101112131415161718192021222324252627282930313233
  1. import { AdminRoute } from '../../../decorator/router_register';
  2. import BaseController from '../../base';
  3. import { PageGetDto } from '../../../dto/comm';
  4. /**
  5. * 任务日志控制器
  6. */
  7. export default class SysTaskLogController extends BaseController {
  8. /**
  9. * @api {get} /admin/sys/task-log/page 获取任务日志列表
  10. * @apiGroup 任务调度
  11. * @apiUse Auth
  12. * @apiUse BaseRes
  13. * @apiUse Page
  14. * @apiSuccess {SysTaskLog[]} data.list 任务日志列表
  15. */
  16. @AdminRoute('/sys/task-log/page', 'get')
  17. async page() {
  18. const dto = await this.ctx.validate<PageGetDto>(PageGetDto, this.getQuery());
  19. this.res({
  20. data: {
  21. list: await this.service.admin.sys.taskLog.page(dto.current - 1, dto.pageSize),
  22. pagination: {
  23. page: dto.current,
  24. size: dto.pageSize,
  25. total: await this.service.admin.sys.taskLog.count(),
  26. },
  27. },
  28. });
  29. }
  30. }