integral.js 898 B

12345678910111213141516171819202122232425262728293031
  1. 'use strict';
  2. const Controller = require('egg').Controller;
  3. class IntegralController extends Controller {
  4. async create() {
  5. const res = await this.ctx.service.integral.create(this.ctx.request.body);
  6. this.ctx.body = res;
  7. }
  8. async update() {
  9. const res = await this.ctx.service.integral.update(this.ctx.request.body);
  10. this.ctx.body = res;
  11. }
  12. async delete() {
  13. const res = await this.ctx.service.integral.delete(this.ctx.params);
  14. this.ctx.body = res;
  15. }
  16. async query() {
  17. const res = await this.ctx.service.integral.query(this.ctx.query);
  18. this.ctx.body = res;
  19. }
  20. async increase() {
  21. const res = await this.ctx.service.integral.increase(this.ctx.request.body);
  22. this.ctx.body = res;
  23. }
  24. async reduce() {
  25. const res = await this.ctx.service.integral.reduce(this.ctx.request.body);
  26. this.ctx.body = res;
  27. }
  28. }
  29. module.exports = IntegralController;