12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- import { Inject, Post, Provide, Body, ALL } from '@midwayjs/decorator';
- import { CoolController, BaseController } from '@cool-midway/core';
- import { OrderService } from '../../service/order';
- import { BaseSysConfService } from '../../../base/service/sys/conf';
- import { CurrencyService } from '../../service/currency';
- import { MerchantService } from '../../service/merchant';
- import { PayTypeService } from '../../service/payType';
- import { ChannelService } from '../../service/channel';
- @Provide()
- @CoolController()
- export class OrdertController extends BaseController {
- @Inject()
- orderService: OrderService;
- @Inject()
- currencyService: CurrencyService;
- @Inject()
- merchantService: MerchantService;
-
- @Inject()
- payTypeService: PayTypeService;
-
- @Inject()
- channelService: ChannelService;
- @Inject()
- baseSysConfService: BaseSysConfService;
- @Post('/dashboard', { summary: '统计' })
- async dashboard(@Body(ALL) payload: any) {
- return this.ok(await this.orderService.dashboard(payload));
- }
- @Post('/chartData', { summary: '报表' })
- async chartData(@Body(ALL) payload: any) {
- return this.ok(await this.orderService.chartData(payload));
- }
- @Post('/getCurrency', { summary: '货币列表' })
- async getCurrency() {
- return this.ok(await this.currencyService.getCurrencyList());
- }
- @Post('/getMerchants', { summary: '商户列表' })
- async getMerchants() {
- return this.ok(await this.merchantService.getMerchantList());
- }
- @Post('/getPayTypes', { summary: '支付类型列表' })
- async getPayTypes(@Body('type') type) {
- return this.ok(await this.payTypeService.getPayTypeList(type));
- }
- @Post('/getChannels', { summary: '支付通道列表' })
- async getChannels() {
- return this.ok(await this.channelService.getChannelList());
- }
- }
|