|
@@ -1,6 +1,7 @@
|
|
import { CoolController, BaseController } from '@cool-midway/core';
|
|
import { CoolController, BaseController } from '@cool-midway/core';
|
|
-import { ALL, Body, Get, Inject, Post, Provide } from '@midwayjs/decorator';
|
|
|
|
|
|
+import { ALL, Body, Get, Inject, Post, Provide, Query } from '@midwayjs/decorator';
|
|
import { BusinessEntity } from '../../payment/entity/business';
|
|
import { BusinessEntity } from '../../payment/entity/business';
|
|
|
|
+import { SunPayAdapter } from '../../payment/adapter/sunpay.adapter';
|
|
|
|
|
|
/**
|
|
/**
|
|
* 支持银行
|
|
* 支持银行
|
|
@@ -8,19 +9,14 @@ import { BusinessEntity } from '../../payment/entity/business';
|
|
@Provide()
|
|
@Provide()
|
|
@CoolController('/api/v1/Fiat')
|
|
@CoolController('/api/v1/Fiat')
|
|
export class BanksController extends BaseController {
|
|
export class BanksController extends BaseController {
|
|
|
|
+ @Inject()
|
|
|
|
+ sunPayAdapter: SunPayAdapter;
|
|
/**
|
|
/**
|
|
* 获取银行列表
|
|
* 获取银行列表
|
|
* /api/v3/Fiat/Banks
|
|
* /api/v3/Fiat/Banks
|
|
*/
|
|
*/
|
|
- @Post('/Banks', { summary: '获取银行列表' })
|
|
|
|
- async getBanks(@Body(ALL) business: BusinessEntity) {
|
|
|
|
- // if (!this.allowKeys.includes(key)) {
|
|
|
|
- // return this.fail('非法操作');
|
|
|
|
- // }
|
|
|
|
- // 关键参数校验
|
|
|
|
- // 数据落库
|
|
|
|
- // 回调
|
|
|
|
- console.log(business);
|
|
|
|
- return this.ok('hello, cool-admin!!!');
|
|
|
|
|
|
+ @Get('/Banks', { summary: '获取银行列表' })
|
|
|
|
+ async getBanks(@Body(ALL) params: any) {
|
|
|
|
+ return await this.sunPayAdapter.getBanks(params)
|
|
}
|
|
}
|
|
}
|
|
}
|