Skip to content

Let's use AI to Earn!

feat: 获取用户钱包信息api接口

牛文政125d8b006623
diff --git a/src/api/finance.ts b/src/api/finance.ts
index 70707820..04b68bd9 100644
--- a/src/api/finance.ts
+++ b/src/api/finance.ts
@@ -7,9 +7,10 @@
*/
import http from './request';
import { Pagination } from './types';
-import { UserWalletRecord, UserWalletRecordStatus } from './types/finance';
+import { UserWalletRecord } from './types/finance';
import {
CreateUserWalletAccountParams,
+ UserWallet,
UserWalletAccount,
} from './types/userWalletAccount';
@@ -38,6 +39,16 @@ export const financeApi = {
});
},
+ /**
+ * 获取用户钱包信息
+ * @returns
+ */
+ getUserWalletInfo() {
+ return http.get<UserWallet>(`/finance/userWallet/info`, {
+ isToken: true,
+ });
+ },
+
/**
* 获取用户钱包账户列表
* @returns
diff --git a/src/api/types/userWalletAccount.ts b/src/api/types/userWalletAccount.ts
index 55770f5c..58bd9c1c 100644
--- a/src/api/types/userWalletAccount.ts
+++ b/src/api/types/userWalletAccount.ts
@@ -10,6 +10,12 @@ export enum WalletAccountType {
WX_PAY = 'WX_PAY',
}
+export interface UserWallet {
+ userId: string;
+ balance: number;
+ income: number;
+}
+
export interface UserWalletAccount {
id: string;
account: string; // 账户号