feat: add withdrawal management pages

This commit is contained in:
2026-05-24 20:30:19 -07:00
parent 55c78276fb
commit d6399cf796
10 changed files with 800 additions and 11 deletions
+2
View File
@@ -22,6 +22,7 @@ import * as system from "./system";
import * as ticket from "./ticket";
import * as tool from "./tool";
import * as user from "./user";
import * as withdrawal from "./withdrawal";
export default {
ads,
announcement,
@@ -43,4 +44,5 @@ export default {
ticket,
tool,
user,
withdrawal,
};
+32
View File
@@ -28,6 +28,21 @@ declare namespace API {
updated_at: number;
};
type AdminWithdrawalLog = {
id: number;
user_id: number;
amount: number;
content: string;
status: number;
reason?: string;
created_at: number;
updated_at: number;
};
type ApproveWithdrawalRequest = {
withdrawal_id: number;
};
type AnyTLS = {
port: number;
security_config: SecurityConfig;
@@ -71,6 +86,18 @@ declare namespace API {
is_default: boolean;
};
type GetWithdrawalListParams = {
page: number;
size: number;
user_id?: number;
status?: number;
};
type GetWithdrawalListResponse = {
list: AdminWithdrawalLog[];
total: number;
};
type AppUserSubcbribe = {
id: number;
name: string;
@@ -3047,6 +3074,11 @@ declare namespace API {
confirm: boolean;
};
type RejectWithdrawalRequest = {
withdrawal_id: number;
reason: string;
};
type PreviewUserNodesRequest = {
user_id: number;
};
@@ -0,0 +1,55 @@
/* eslint-disable */
import request from "@workspace/ui/lib/request";
/** Get withdrawal list GET /v1/admin/user/withdrawal/list */
export async function getWithdrawalList(
params: API.GetWithdrawalListParams,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.GetWithdrawalListResponse }>(
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/user/withdrawal/list`,
{
method: "GET",
params: {
...params,
},
...(options || {}),
}
);
}
/** Approve withdrawal POST /v1/admin/user/withdrawal/approve */
export async function approveWithdrawal(
body: API.ApproveWithdrawalRequest,
options?: { [key: string]: any }
) {
return request<API.Response>(
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/user/withdrawal/approve`,
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
data: body,
...(options || {}),
}
);
}
/** Reject withdrawal POST /v1/admin/user/withdrawal/reject */
export async function rejectWithdrawal(
body: API.RejectWithdrawalRequest,
options?: { [key: string]: any }
) {
return request<API.Response>(
`${import.meta.env.VITE_API_PREFIX || ""}/v1/admin/user/withdrawal/reject`,
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
data: body,
...(options || {}),
}
);
}
+8
View File
@@ -846,6 +846,14 @@ declare namespace API {
order_no: string;
};
type RedeemCodeRequest = {
code: string;
};
type RedeemCodeResponse = {
message: string;
};
type RegisterConfig = {
stop_register: boolean;
enable_trial: boolean;
+18
View File
@@ -251,6 +251,24 @@ export async function updateUserPassword(
);
}
/** Redeem Code POST /v1/public/redemption/ */
export async function redeemCode(
body: API.RedeemCodeRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.RedeemCodeResponse }>(
`${import.meta.env.VITE_API_PREFIX || ""}/v1/public/redemption/`,
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
data: body,
...(options || {}),
}
);
}
/** Update User Rules PUT /v1/public/user/rules */
export async function updateUserRules(
body: API.UpdateUserRulesRequest,