From 6a5d66d21df56c4549648b259609419e357e9470 Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期五, 21 三月 2025 17:17:00 +0800
Subject: [PATCH] fix: 三期需求

---
 packages/core/src/lifeRechargeServices.ts |  221 +++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 206 insertions(+), 15 deletions(-)

diff --git a/packages/core/src/lifeRechargeServices.ts b/packages/core/src/lifeRechargeServices.ts
index 200ad7e..908687f 100644
--- a/packages/core/src/lifeRechargeServices.ts
+++ b/packages/core/src/lifeRechargeServices.ts
@@ -1,15 +1,36 @@
 import { BlLifeRechargeServicesOptions } from './types';
 import { LifeRechargeConstants } from './lifeRechargeConstants';
 import { Request, IRequest } from 'senior-request';
+import { BlLifeRecharge } from './lifeRecharge';
 
 export interface RequestConfig {}
 
 export class BlLifeRechargeServices<TResponse = any, TRequestOptions = any> {
   private request: IRequest;
-  constructor({ axiosConfig }: BlLifeRechargeServicesOptions<TResponse, TRequestOptions>) {
+  ctx: BlLifeRecharge<TResponse, TRequestOptions>;
+
+  constructor(
+    ctx: BlLifeRecharge<TResponse, TRequestOptions>,
+    { axiosConfig }: BlLifeRechargeServicesOptions<TResponse, TRequestOptions>
+  ) {
+    this.ctx = ctx;
     this.request = Request.create({
       ...axiosConfig,
       // baseURL: process.env.NODE_ENV === 'development' ? '/' : 'https://api.81812333.com',
+      requestInterceptors: [
+        [
+          (config) => {
+            if (config.params) {
+              config.params.checkChannelId = this.ctx.accountModel.channlesNum;
+            }
+            if (config.data) {
+              config.data.checkChannelId = this.ctx.accountModel.channlesNum;
+            }
+            return config;
+          },
+        ],
+        ...axiosConfig.requestInterceptors,
+      ],
       timeout: 10 * 1000,
       headers: {
         Accept: 'application/json, text/plain, */*',
@@ -40,25 +61,37 @@
   }
 
   /** 鑾峰彇鐢佃垂鍏呭�煎尯鍩� GET /api/LifePay/GetElectricSupportArea */
-  async getElectricSupportArea(options?: RequestConfig) {
+  async getElectricSupportArea(body: ChannelsBaseInput, options?: RequestConfig) {
     return this.request<ElectricSupportAreaResponse>('/api/LifePay/GetElectricSupportArea', {
-      method: 'GET',
+      method: 'POST',
+      headers: {
+        'Content-Type': 'application/json',
+      },
+      data: body,
       ...(options || {}),
     });
   }
 
-  /** 鑾峰彇鐢佃垂闈㈠�� GET /api/LifePay/GetElectricParValue */
-  async getElectricParValue(options?: RequestConfig) {
+  /** 鑾峰彇鐢佃垂闈㈠�� POST /api/LifePay/GetElectricParValue */
+  async getElectricParValue(body: ChannelsBaseInput, options?: RequestConfig) {
     return this.request<ElectricParValueResponse>('/api/LifePay/GetElectricParValue', {
-      method: 'GET',
+      method: 'POST',
+      headers: {
+        'Content-Type': 'application/json',
+      },
+      data: body,
       ...(options || {}),
     });
   }
 
   /** 鑾峰彇璇濊垂闈㈠�� GET /api/LifePay/GetPhoneParValue */
-  async getPhoneParValue(options?: RequestConfig) {
+  async getPhoneParValue(body: ChannelsBaseInput, options?: RequestConfig) {
     return this.request<PhoneParValueResponse>('/api/LifePay/GetPhoneParValue', {
-      method: 'GET',
+      method: 'POST',
+      headers: {
+        'Content-Type': 'application/json',
+      },
+      data: body,
       ...(options || {}),
     });
   }
@@ -94,14 +127,15 @@
   }
 
   /** 鏍规嵁璁㈠崟鍙疯幏鍙栨敮浠樼姸鎬� GET /api/LifePay/GetPayStatusByOrderNo */
-  async getPayStatusByOrderNo(params: APIgetPayStatusByOrderNoParams, options?: RequestConfig) {
+  async getPayStatusByOrderNo(body: GetPayStatusByOrderNoInput, options?: RequestConfig) {
     return this.request<LifeRechargeConstants.LifePayStatusEnum>(
       '/api/LifePay/GetPayStatusByOrderNo',
       {
-        method: 'GET',
-        params: {
-          ...params,
+        method: 'POST',
+        headers: {
+          'Content-Type': 'application/json',
         },
+        data: body,
         ...(options || {}),
       }
     );
@@ -206,9 +240,13 @@
   }
 
   /** 鑾峰彇鐕冩皵闈㈠�� GET /api/LifePay/GetGasParValue */
-  async getGasParValue(options?: RequestConfig) {
+  async getGasParValue(body: ChannelsBaseInput, options?: RequestConfig) {
     return this.request<GasParValueResponse>('/api/LifePay/GetGasParValue', {
-      method: 'GET',
+      method: 'POST',
+      headers: {
+        'Content-Type': 'application/json',
+      },
+      data: body,
       ...(options || {}),
     });
   }
@@ -221,6 +259,70 @@
         'Content-Type': 'application/json',
       },
       data: body,
+      ...(options || {}),
+    });
+  }
+
+  /** 鍒犻櫎鎴戠殑鎴峰彿 POST /api/LifePay/DeleteUserAccount */
+  async deleteUserAccount(
+    // 鍙犲姞鐢熸垚鐨凱aram绫诲瀷 (闈瀊ody鍙傛暟swagger榛樿娌℃湁鐢熸垚瀵硅薄)
+    params: APIdeleteUserAccountParams,
+    options?: RequestConfig
+  ) {
+    return this.request<number>('/api/LifePay/DeleteUserAccount', {
+      method: 'POST',
+      params: {
+        ...params,
+      },
+      ...(options || {}),
+    });
+  }
+
+  /** 鑾峰彇鎴戠殑鎴峰彿璇︽儏 GET /api/LifePay/GetUserAccountDetail */
+  async getUserAccountDetail(
+    // 鍙犲姞鐢熸垚鐨凱aram绫诲瀷 (闈瀊ody鍙傛暟swagger榛樿娌℃湁鐢熸垚瀵硅薄)
+    params: APIgetUserAccountDetailParams,
+    options?: RequestConfig
+  ) {
+    return this.request<UserAccountOutput>('/api/LifePay/GetUserAccountDetail', {
+      method: 'GET',
+      params: {
+        ...params,
+      },
+      ...(options || {}),
+    });
+  }
+
+  /** 鑾峰彇鎴戠殑璁㈠崟璇︽儏 GET /api/LifePay/GetUserLifePayOrderDetail */
+  async getUserLifePayOrderDetail(
+    // 鍙犲姞鐢熸垚鐨凱aram绫诲瀷 (闈瀊ody鍙傛暟swagger榛樿娌℃湁鐢熸垚瀵硅薄)
+    params: APIgetUserLifePayOrderDetailParams,
+    options?: RequestConfig
+  ) {
+    return this.request<UserLifePayOrderOutput>('/api/LifePay/GetUserLifePayOrderDetail', {
+      method: 'GET',
+      params: {
+        ...params,
+      },
+      ...(options || {}),
+    });
+  }
+
+  /** 鎼滅储绠$悊--鍒楄〃(鍖哄煙绠$悊) GET /api/Area/GetRegionalManagementList */
+  async getRegionalManagementList(options?: RequestConfig) {
+    return this.request<AreaInfo[]>('/api/Area/GetRegionalManagementList', {
+      method: 'GET',
+      ...(options || {}),
+    });
+  }
+
+  /** 鑾峰彇椤荤煡 GET /api/LifePay/GetIntroInfo */
+  async getIntroInfo(params: APIgetIntroInfoParams, options?: RequestConfig) {
+    return this.request<LifePayIntroInfoOutput[]>('/api/LifePay/GetIntroInfo', {
+      method: 'GET',
+      params: {
+        ...params,
+      },
       ...(options || {}),
     });
   }
@@ -287,6 +389,8 @@
 
 export interface LifePhoneDataCreateLifePayOrderInput {
   userId?: string;
+  /** 娓犻亾Id */
+  channelId?: string;
   productData?: LifePhoneData;
 }
 
@@ -307,6 +411,8 @@
 
 export interface LifeElectricDataCreateLifePayOrderInput {
   userId?: string;
+  /** 娓犻亾Id */
+  channelId?: string;
   productData?: LifeElectricData;
 }
 
@@ -396,6 +502,15 @@
   creationTime?: string;
   /** 閫�娆炬椂闂� */
   refundTime?: string;
+  /** 閫�娆惧嚟璇� */
+  refundCredentialsImgUrl?: string;
+  refundApplyRemark?: string;
+  refundCheckRemark?: string;
+  /** 娓犻亾娴佹按鍙� */
+  acoolyOrderNo?: string;
+  frontStatus?: LifeRechargeConstants.LifePayOrderFrontStatusEnum;
+  lifePayRefundStatus?: LifeRechargeConstants.LifePayRefundStatusEnum;
+  acoolyStatus?: LifeRechargeConstants.ACOOLYStatusEnum;
 }
 
 export interface ElectricSupportAreaResponse {
@@ -508,6 +623,8 @@
 
 export interface LifeGasDataCreateLifePayOrderInput {
   userId?: string;
+  /** 娓犻亾Id */
+  channelId?: string;
   productData?: LifeGasData;
 }
 
@@ -536,7 +653,7 @@
   code?: string;
   message?: string;
   detail?: string;
-  gasParValue?: GasParValueOutput;
+  gasParValue?: GasParValueOutput[];
 }
 
 export interface GasParValueOutput {
@@ -566,3 +683,77 @@
   objectData?: any;
   data?: UserAccountListOutput[];
 }
+
+export interface APIdeleteUserAccountParams {
+  id?: string;
+}
+
+export interface APIgetUserAccountDetailParams {
+  id?: string;
+}
+
+export interface UserAccountOutput {
+  id?: string;
+  lifePayType?: LifeRechargeConstants.LifePayOrderTypeEnum;
+  /** 杩愯惀鍟� */
+  operators?: string;
+  /** 鎵嬫満鍙�/鎴峰彿 */
+  content?: string;
+  /** 鐪� */
+  province?: string;
+  /** 甯� */
+  city?: string;
+  /** 鎷撳睍瀛楁锛堢數璐圭被鍨嬶級 */
+  extraProperties?: string;
+  /** 澶囨敞 */
+  remark?: string;
+  /** 鍒涘缓鏃堕棿 */
+  creationTime?: string;
+  isDeleted?: boolean;
+}
+
+export interface APIgetUserLifePayOrderDetailParams {
+  orderNo?: string;
+}
+
+export interface ChannelsBaseInput {
+  checkChannelId?: string;
+}
+
+export interface AreaInfo {
+  areaCode?: number;
+  parentId?: number;
+  areaName?: string;
+  /** 1鐪� 2甯� 3鍖� 4闀� */
+  layer?: number;
+  sort?: number;
+  children?: AreaInfo[];
+  /** 绠�鏄撴嫾闊� */
+  simpleSpelling?: string;
+  /** 蹇�熸绱� */
+  quickQuery?: string;
+}
+
+export interface GetPayStatusByOrderNoInput {
+  checkChannelId?: string;
+  orderNo?: string;
+}
+
+export interface APIgetIntroInfoParams {
+  type?: LifeRechargeConstants.LifePayOrderTypeEnum;
+}
+
+export interface LifePayIntroInfoOutput {
+  type?: IntroInfoTypeEnum;
+  lifePayType?: LifeRechargeConstants.LifePayOrderTypeEnum;
+  /** 鎽樿 */
+  contentSummary?: string;
+  /** 鏂囨湰鍐呭 */
+  content?: string;
+  /** 鍥剧墖/瑙嗛璺緞 */
+  path?: string;
+  /** 鎺掑簭 */
+  sequence?: number;
+}
+
+export type IntroInfoTypeEnum = 0 | 1 | 2 | 3 | 4;

--
Gitblit v1.9.1