1234567891011121314151617181920212223242526272829303132333435363738394041 |
- import { OrderEntity } from '../../entity/order';
- import { Inject, Post, Provide, Body } from '@midwayjs/decorator';
- import { CoolController, BaseController } from '@cool-midway/core';
- import { OrderService } from '../../service/order';
- @Provide()
- @CoolController({
- api: ['update', 'info', 'page'],
- entity: OrderEntity,
- service: OrderService,
- })
- export class OrdertController extends BaseController {
- @Inject()
- orderService: OrderService;
- @Post('/summary', { summary: '统计' })
- async summary() {
- const { body } = this.baseCtx.request;
- return this.ok(await this.orderService.summary(body));
- }
- @Post('/query', { summary: '查单' })
- async query(@Body('id') id) {
- return this.ok(await this.orderService.queryByApi(id));
- }
- @Post('/notify', { summary: '通知' })
- async notify(@Body('id') id) {
- return this.ok(await this.orderService.notify(id));
- }
- @Post('/code', { summary: '获取订单通道编码' })
- async code(@Body('id') id) {
- return this.ok(id);
- }
- @Post('/mch', { summary: '获取订单商户编码' })
- async mch(@Body('id') id) {
- return this.ok(id);
- }
- }
|