소스 검색

fix: 添加获取用户详情的接口

max 7 달 전
부모
커밋
8cdddef4d2
3개의 변경된 파일25개의 추가작업 그리고 1개의 파일을 삭제
  1. 9 1
      src/modules/api/controller/customer.ts
  2. 3 0
      src/modules/api/service/customer.ts
  3. 13 0
      src/modules/payment/adapter/sunpay.adapter.ts

+ 9 - 1
src/modules/api/controller/customer.ts

@@ -3,7 +3,7 @@ import {
   ALL,
   Body,
   Get,
-  Inject,
+  Inject, Param,
   Post,
   Provide,
   Put, Query,
@@ -61,4 +61,12 @@ export class CustomerController extends BaseController {
   async updateCustomer(@Body() params: IndividualEntity) {
     return await this.customerService.updateCustomer(params);
   }
+  /**
+   * 修改客户详情
+   * /api/v3/Fiat/Customer
+   */
+  @Get('/Customer/:customer_id', { summary: '修改客户' })
+  async getCustomerInfo(@Param('customer_id') customer_id: string) {
+    return await this.customerService.getCustomer(customer_id);
+  }
 }

+ 3 - 0
src/modules/api/service/customer.ts

@@ -70,4 +70,7 @@ export class CustomerService extends BaseService {
     this.individualService.setIsOpenApi(true)
     return await this.individualService.add(params);
   }
+  async getCustomer(customer_id: string) {
+    return  await this.sunPayAdapter.getCustomerForId(customer_id);
+  }
 }

+ 13 - 0
src/modules/payment/adapter/sunpay.adapter.ts

@@ -273,6 +273,19 @@ export class SunPayAdapter implements ChannelAdapter {
   async getBeneficiaryForId(id: string): Promise<void> {
     return  await this.request('GET', '/Fiat/Beneficiary/' + id);
   }
+  /**
+   * 获取受益人
+   */
+  async getCustomerForId(id: string): Promise<void> {
+    return  await this.request('GET', '/Fiat/Customer/' + id);
+  }
+
+  /**
+   * 获取受益人列表
+   */
+  async getBeneficiaryList(data: any): Promise<void> {
+    return  await this.request('GET', '/Fiat/Beneficiary', data);
+  }
 
    /**
    * 获取账户钱包币种余额信息