zhengyiming
2025-02-24 d6e8780fb1b2fe5d14186901f0a45bbc7abbf3eb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
import axios, { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios';
import { IRequest, BlLifeRechargeServicesOptions } from './types';
import { LifeRechargeConstants } from './lifeRechargeConstants';
 
export interface RequestConfig {}
 
export class BlLifeRechargeServices<T extends IRequest> {
  private request: T;
  constructor({ request }: BlLifeRechargeServicesOptions<T>) {
    this.request = request;
  }
 
  async lifePayPhoneMesssageCodeLogin(body: PhoneMesssageCodeLoginInput, options?: RequestConfig) {
    return this.request<string>('/api/Account/LifePayPhoneMesssageCodeLogin', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    });
  }
 
  /** 获取折扣 GET /api/LifePay/GetRate */
  async getRate(options?: RequestConfig) {
    return this.request<LifePayRateListOutput[]>('/api/LifePay/GetRate', {
      method: 'GET',
      ...(options || {}),
    });
  }
 
  /** 获取电费面值 GET /api/LifePay/GetElectricParValue */
  async getElectricParValue(options?: RequestConfig) {
    return this.request<ElectricParValueResponse>('/api/LifePay/GetElectricParValue', {
      method: 'GET',
      ...(options || {}),
    });
  }
 
  /** 获取话费面值 GET /api/LifePay/GetPhoneParValue */
  async getPhoneParValue(options?: RequestConfig) {
    return this.request<PhoneParValueResponse>('/api/LifePay/GetPhoneParValue', {
      method: 'GET',
      ...(options || {}),
    });
  }
 
  /** 创建生活缴费话费订单 POST /api/LifePay/CreateLifePayPhoneOrder */
  async createLifePayPhoneOrder(
    body: LifePhoneDataCreateLifePayOrderInput,
    options?: RequestConfig
  ) {
    return this.request<CreateLifePayOrderOutput>('/api/LifePay/CreateLifePayPhoneOrder', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    });
  }
 
  /** 创建生活缴费电费订单 POST /api/LifePay/CreateLifePayElectricOrder */
  async createLifePayElectricOrder(
    body: LifeElectricDataCreateLifePayOrderInput,
    options?: RequestConfig
  ) {
    return this.request<CreateLifePayOrderOutput>('/api/LifePay/CreateLifePayElectricOrder', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    });
  }
 
  /** 根据订单号获取支付状态 GET /api/LifePay/GetPayStatusByOrderNo */
  async getPayStatusByOrderNo(params: APIgetPayStatusByOrderNoParams, options?: RequestConfig) {
    return this.request<LifeRechargeConstants.LifePayStatusEnum>(
      '/api/LifePay/GetPayStatusByOrderNo',
      {
        method: 'GET',
        params: {
          ...params,
        },
        ...(options || {}),
      }
    );
  }
 
  async setLifePayOrderPayType(body: SetLifePayOrderPayTypeInput, options?: RequestConfig) {
    return this.request<string>('/api/LifePay/SetLifePayOrderPayType', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    });
  }
 
  /** 获取我的订单分页数据 POST /api/LifePay/GetUserLifePayOrderPage */
  async getUserLifePayOrderPage(body: QueryLifePayOrderListInput, options?: RequestConfig) {
    return this.request<UserLifePayOrderOutputPageOutput>('/api/LifePay/GetUserLifePayOrderPage', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
      },
      data: body,
      ...(options || {}),
    });
  }
}
 
export interface PhoneMesssageCodeLoginInput {
  /** 手机号 */
  phoneNumber: string;
  /** 验证码 */
  code: string;
}
 
export interface LifePayRateListOutput {
  rateType?: LifeRechargeConstants.LifePayRateTypeEnum;
  rate?: number;
}
 
export interface ElectricParValueResponse {
  success?: string;
  requestNo?: string;
  partnerId?: string;
  service?: string;
  version?: string;
  protocol?: string;
  context?: string;
  ext?: string;
  code?: string;
  message?: string;
  detail?: string;
  electricParValue?: ElectricParValueOutput[];
}
 
export interface ElectricParValueOutput {
  electricType?: string;
  areaName?: string;
  parValue?: string;
  rate?: number;
  comments?: string;
}
 
export interface PhoneParValueResponse {
  success?: boolean;
  requestNo?: string;
  partnerId?: string;
  service?: string;
  version?: string;
  protocol?: string;
  context?: string;
  ext?: any;
  code?: string;
  message?: string;
  detail?: string;
  phoneParValue?: PhoneParValueOutput[];
}
 
export interface PhoneParValueOutput {
  ispCode?: string;
  ispName?: string;
  parValue?: string[];
  rate?: number;
  phoneSection?: string;
  comments?: string;
}
 
export interface LifePhoneDataCreateLifePayOrderInput {
  userId?: string;
  productData?: LifePhoneData;
}
 
export interface LifePhoneData {
  /** 运营商编码,例如:"yidong", "dianxin", "liantong"。 */
  ispCode: string;
  /** 充值面额,单位为元。测试账户:parValue=100:缴费成功,parValue>100:缴费失败。 */
  parValue: number;
  /** 手机号。 */
  phone: string;
  /** 机主名称(电信手机号必填) */
  name?: string;
}
 
export interface CreateLifePayOrderOutput {
  orderNo?: string;
}
 
export interface LifeElectricDataCreateLifePayOrderInput {
  userId?: string;
  productData?: LifeElectricData;
}
 
export interface LifeElectricData {
  /** 充值面额,单位为元。 */
  parValue: number;
  /** 电网类型,例如:"guowang"代表国家电网,"nanwang"代表南方电网。 */
  electricType: string;
  /** 电费类型,国网必传:住宅、企事业、店铺三个选项。 */
  electricAccountType: string;
  /** 电费户号。 */
  electricAccount: string;
  /** 省份。 */
  province: string;
  /** 城市。 */
  city: string;
  /** 客户身份证后6位,南网必传。 */
  sixID?: string;
}
 
export interface APIgetPayStatusByOrderNoParams {
  orderNo?: string;
}
 
export interface SetLifePayOrderPayTypeInput {
  orderNo: string;
  lifePayType?: LifeRechargeConstants.LifePayTypeEnum;
}
 
export interface QueryLifePayOrderListInput {
  pageModel?: Pagination;
  lifePayOrderType?: LifeRechargeConstants.LifePayOrderTypeEnum;
  /** 开始支付时间 */
  beginPayTime?: string;
  /** 结束支付时间 */
  endPayTime?: string;
  payStatus?: LifeRechargeConstants.LifePayStatusEnum;
  lifePayOrderStatus?: LifeRechargeConstants.LifePayOrderStatusEnum;
  /** 开始完成时间 */
  beginFinishTime?: string;
  /** 结束完成时间 */
  endFinishTime?: string;
  /** 用户Id */
  userId?: string;
}
 
export interface Pagination {
  rows?: number;
  page?: number;
  orderInput?: OrderInput[];
  totalCount?: number;
  totalPage?: number;
}
 
export interface OrderInput {
  property?: string;
  order?: any;
}
 
export interface UserLifePayOrderOutputPageOutput {
  pageModel?: Pagination;
  objectData?: any;
  data?: UserLifePayOrderOutput[];
}
 
export interface UserLifePayOrderOutput {
  id?: string;
  lifePayType?: LifeRechargeConstants.LifePayTypeEnum;
  lifePayOrderType?: LifeRechargeConstants.LifePayOrderTypeEnum;
  /** 订单号 */
  orderNo?: string;
  /** 充值金额 */
  rechargeAmount?: number;
  /** 优惠金额 */
  discountAmount?: number;
  /** 实付金额 */
  payAmount?: number;
  /** 支付时间 */
  payTime?: string;
  payStatus?: LifeRechargeConstants.LifePayStatusEnum;
  lifePayOrderStatus?: LifeRechargeConstants.LifePayOrderStatusEnum;
  /** 完成时间 */
  finishTime?: string;
  /** 订单详细数据 */
  orderParamDetailJsonStr?: string;
  /** 下单时间 */
  creationTime?: string;
}