home.js 381 B

1234567891011121314151617
  1. 'use strict';
  2. const Controller = require('egg').Controller;
  3. const { BusinessError, ErrorCode } = require('naf-core').Error;
  4. class HomeController extends Controller {
  5. async index() {
  6. const { ctx } = this;
  7. ctx.body = 'hi, egg';
  8. }
  9. async util() {
  10. const res = await this.ctx.model.Position.deleteMany();
  11. this.ctx.ok(res);
  12. }
  13. }
  14. module.exports = HomeController;