comm.ts 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import { Inject, Post, Provide, Body, ALL } from '@midwayjs/decorator';
  2. import { CoolController, BaseController } from '@cool-midway/core';
  3. import { OrderService } from '../../service/order';
  4. import { BaseSysConfService } from '../../../base/service/sys/conf';
  5. import { CurrencyService } from '../../service/currency';
  6. import { MerchantService } from '../../service/merchant';
  7. import { PayTypeService } from '../../service/payType';
  8. import { ChannelService } from '../../service/channel';
  9. @Provide()
  10. @CoolController()
  11. export class OrdertController extends BaseController {
  12. @Inject()
  13. orderService: OrderService;
  14. @Inject()
  15. currencyService: CurrencyService;
  16. @Inject()
  17. merchantService: MerchantService;
  18. @Inject()
  19. payTypeService: PayTypeService;
  20. @Inject()
  21. channelService: ChannelService;
  22. @Inject()
  23. baseSysConfService: BaseSysConfService;
  24. @Post('/dashboard', { summary: '统计' })
  25. async dashboard(@Body(ALL) payload: any) {
  26. return this.ok(await this.orderService.dashboard(payload));
  27. }
  28. @Post('/chartData', { summary: '报表' })
  29. async chartData(@Body(ALL) payload: any) {
  30. return this.ok(await this.orderService.chartData(payload));
  31. }
  32. @Post('/getCurrency', { summary: '货币列表' })
  33. async getCurrency() {
  34. return this.ok(await this.currencyService.getCurrencyList());
  35. }
  36. @Post('/getMerchants', { summary: '商户列表' })
  37. async getMerchants() {
  38. return this.ok(await this.merchantService.getMerchantList());
  39. }
  40. @Post('/getPayTypes', { summary: '支付类型列表' })
  41. async getPayTypes(@Body('type') type) {
  42. return this.ok(await this.payTypeService.getPayTypeList(type));
  43. }
  44. @Post('/getChannels', { summary: '支付通道列表' })
  45. async getChannels() {
  46. return this.ok(await this.channelService.getChannelList());
  47. }
  48. }