schedule.js 497 B

123456789101112131415161718192021
  1. 'use strict';
  2. // const _ = require('lodash');
  3. const meta = require('./.schedule.js');
  4. const Controller = require('egg').Controller;
  5. const { CrudController } = require('naf-framework-mongoose/lib/controller');
  6. // 定时任务
  7. class ScheduleController extends Controller {
  8. constructor(ctx) {
  9. super(ctx);
  10. this.service = this.ctx.service.system.schedule;
  11. }
  12. async check() {
  13. this.service.check();
  14. this.ctx.ok();
  15. }
  16. }
  17. module.exports = CrudController(ScheduleController, meta);