withdraw.ts 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import { WithdrawEntity } from '../../entity/withdraw';
  2. import { Inject, Post, Provide, Body, ALL } from '@midwayjs/decorator';
  3. import { CoolController, BaseController } from '@cool-midway/core';
  4. import { WithdrawService } from '../../service/withdraw';
  5. @Provide()
  6. @CoolController({
  7. api: ['add', 'update', 'info', 'page'],
  8. entity: WithdrawEntity,
  9. service: WithdrawService,
  10. })
  11. export class WithdrawController extends BaseController {
  12. @Inject()
  13. withdrawService: WithdrawService;
  14. @Post('/summary', { summary: '统计' })
  15. async summary() {
  16. const { body } = this.baseCtx.request;
  17. return this.ok(await this.withdrawService.summary(body));
  18. }
  19. @Post('/query', { summary: '查单' })
  20. async query(@Body('id') id) {
  21. return this.ok(await this.withdrawService.queryByApi(id));
  22. }
  23. @Post('/notify', { summary: '通知' })
  24. async notify(@Body('id') id) {
  25. return this.ok(await this.withdrawService.notify(id));
  26. }
  27. @Post('/code', { summary: '获取订单通道编码' })
  28. async code(@Body('id') id) {
  29. return this.ok(id);
  30. }
  31. @Post('/mch', { summary: '获取订单商户编码' })
  32. async mch(@Body('id') id) {
  33. return this.ok(id);
  34. }
  35. // @Post('/withdraw', { summary: '发起代付' })
  36. // async withdraw(@Body(ALL) payload: any) {
  37. // return this.ok(await this.withdrawService.withdraw(payload));
  38. // }
  39. }