35 lines
1023 B
JavaScript
35 lines
1023 B
JavaScript
const { Controller } = require('egg');
|
|
|
|
class dgjController extends Controller {
|
|
async Print(){
|
|
const { ctx } = this;
|
|
const parmas = ctx.request.body;
|
|
if('orders' in parmas && 'expressName' in parmas){
|
|
ctx.body = await ctx.service.dgj.Print(parmas.orders,parmas.expressName);
|
|
}
|
|
}
|
|
async Print1(){
|
|
const { ctx } = this;
|
|
const parmas = ctx.request.body;
|
|
if('orders' in parmas && 'expressName' in parmas){
|
|
ctx.body = await ctx.service.dgj.Print1(parmas.orders,parmas.expressName);
|
|
}
|
|
}
|
|
async Print2(){
|
|
const { ctx } = this;
|
|
const parmas = ctx.request.body;
|
|
if('orders' in parmas && 'expressName' in parmas){
|
|
ctx.body = await ctx.service.dgj.Print2(parmas.orders,parmas.expressName);
|
|
}
|
|
}
|
|
async CreateOrder(){
|
|
const {ctx} = this;
|
|
const parmas = ctx.request.body;
|
|
if('orders' in parmas){
|
|
ctx.body = await ctx.service.dgj.CreateOrder(parmas.orders);
|
|
}else{
|
|
ctx.body = 0;
|
|
}
|
|
}
|
|
}
|
|
module.exports = dgjController; |