bill.js 547 B

1234567891011121314151617181920
  1. 'use strict';
  2. const Controller = require('egg').Controller;
  3. const { CrudController } = require('naf-framework-mongoose-free/lib/controller');
  4. //
  5. class BillController extends Controller {
  6. constructor(ctx) {
  7. super(ctx);
  8. this.service = this.ctx.service.statistics.bill;
  9. }
  10. async getBill() {
  11. const data = await this.service.getBill(this.ctx.query);
  12. this.ctx.ok({ data });
  13. }
  14. async outBill() {
  15. await this.service.outBill(this.ctx.request.body);
  16. this.ctx.ok();
  17. }
  18. }
  19. module.exports = CrudController(BillController, {});