'use strict'; // const _ = require('lodash'); const meta = require('./.order.js'); const Controller = require('egg').Controller; const { CrudController } = require('naf-framework-mongoose/lib/controller'); // 订单 class OrderController extends Controller { constructor(ctx) { super(ctx); this.service = this.ctx.service.order.order; this.bill_service = this.ctx.service.order.bill; this.split_service = this.ctx.service.order.split; } /** * 修改收入 */ async inBill() { await this.bill_service.inBill(this.ctx.request.body); this.ctx.ok(); } /** * 拆分货物 */ async splitGoods() { await this.split_service.splitGoods(this.ctx.request.body); this.ctx.ok(); } /** * 修改支出 */ async outBill() { await this.bill_service.outBill(this.ctx.request.body); this.ctx.ok(); } /** * 修改订单负责人 */ async principalChange() { await this.service.principalChange(this.ctx.request.body); this.ctx.ok(); } } module.exports = CrudController(OrderController, meta);