home.js 634 B

12345678910111213141516171819202122232425
  1. 'use strict';
  2. const Controller = require('egg').Controller;
  3. class HomeController extends Controller {
  4. async index() {
  5. const { ctx } = this;
  6. ctx.body = 'hi, egg';
  7. }
  8. async utilMethod() {
  9. const data = await this.ctx.service.util.util.utilMethod(this.ctx.query, this.ctx.request.body);
  10. this.ctx.ok({ data });
  11. }
  12. async indexQuery() {
  13. const data = await this.ctx.service.users.product.indexQuery();
  14. this.ctx.ok({ data });
  15. }
  16. async spm() {
  17. const data = await this.ctx.service.util.spm.index(this.ctx.query, this.ctx.request.body);
  18. this.ctx.ok({ data });
  19. }
  20. }
  21. module.exports = HomeController;