util.js 361 B

123456789101112131415
  1. 'use strict';
  2. const Controller = require('egg').Controller;
  3. class UtilController extends Controller {
  4. constructor(ctx) {
  5. super(ctx);
  6. this.service = this.ctx.service.util;
  7. }
  8. async utilMethod() {
  9. const res = await this.service.utilMethod(this.ctx.query, this.ctx.request.body);
  10. this.ctx.ok({ res });
  11. }
  12. }
  13. module.exports = UtilController;