♻️ refactor(api): update endpoints to include '/api' prefix and add new types for IP location and withdrawal logs

- Updated all user and common service endpoints to include '/api' prefix for consistency.
- Added new API types for querying IP location and withdrawal logs.
- Introduced commission withdrawal functionality in user service.
- Enhanced user service typings to include rules and withdrawal log structures.
This commit is contained in:
web
2025-11-30 18:20:06 -08:00
parent 1837343845
commit 5f3354e948
35 changed files with 594 additions and 399 deletions
+23 -20
View File
@@ -6,7 +6,7 @@ export async function updateAds(
body: API.UpdateAdsRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/ads/", {
return request<API.Response & { data?: any }>("/api/v1/admin/ads/", {
method: "PUT",
headers: {
"Content-Type": "application/json",
@@ -21,7 +21,7 @@ export async function createAds(
body: API.CreateAdsRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/ads/", {
return request<API.Response & { data?: any }>("/api/v1/admin/ads/", {
method: "POST",
headers: {
"Content-Type": "application/json",
@@ -36,7 +36,7 @@ export async function deleteAds(
body: API.DeleteAdsRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/ads/", {
return request<API.Response & { data?: any }>("/api/v1/admin/ads/", {
method: "DELETE",
headers: {
"Content-Type": "application/json",
@@ -52,23 +52,26 @@ export async function getAdsDetail(
params: API.GetAdsDetailParams,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.Ads }>("/v1/admin/ads/detail", {
method: "GET",
params: {
...params,
},
...(options || {}),
});
}
/** Get Ads List GET /v1/admin/ads/list */
export async function getAdsList(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.GetAdsListParams,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.GetAdsListResponse }>(
"/v1/admin/ads/list",
return request<API.Response & { data?: API.Ads }>(
"/api/v1/admin/ads/detail",
{
method: "GET",
params: {
...params,
},
...(options || {}),
}
);
}
/** Get Ads List GET /v1/admin/ads/list */
export async function getAdsList(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.GetAdsListParams,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.GetAdsListResponse }>(
"/api/v1/admin/ads/list",
{
method: "GET",
params: {
@@ -6,7 +6,7 @@ export async function updateAnnouncement(
body: API.UpdateAnnouncementRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/announcement/", {
return request<API.Response & { data?: any }>("/api/v1/admin/announcement/", {
method: "PUT",
headers: {
"Content-Type": "application/json",
@@ -21,7 +21,7 @@ export async function createAnnouncement(
body: API.CreateAnnouncementRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/announcement/", {
return request<API.Response & { data?: any }>("/api/v1/admin/announcement/", {
method: "POST",
headers: {
"Content-Type": "application/json",
@@ -36,7 +36,7 @@ export async function deleteAnnouncement(
body: API.DeleteAnnouncementRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/announcement/", {
return request<API.Response & { data?: any }>("/api/v1/admin/announcement/", {
method: "DELETE",
headers: {
"Content-Type": "application/json",
@@ -53,7 +53,7 @@ export async function getAnnouncement(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.Announcement }>(
"/v1/admin/announcement/detail",
"/api/v1/admin/announcement/detail",
{
method: "GET",
params: {
@@ -71,7 +71,7 @@ export async function getAnnouncementList(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.GetAnnouncementListResponse }>(
"/v1/admin/announcement/list",
"/api/v1/admin/announcement/list",
{
method: "GET",
params: {
@@ -7,7 +7,7 @@ export async function createSubscribeApplication(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.SubscribeApplication }>(
"/v1/admin/application/",
"/api/v1/admin/application/",
{
method: "POST",
headers: {
@@ -27,7 +27,7 @@ export async function previewSubscribeTemplate(
) {
return request<
API.Response & { data?: API.PreviewSubscribeTemplateResponse }
>("/v1/admin/application/preview", {
>("/api/v1/admin/application/preview", {
method: "GET",
params: {
...params,
@@ -42,7 +42,7 @@ export async function updateSubscribeApplication(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.SubscribeApplication }>(
"/v1/admin/application/subscribe_application",
"/api/v1/admin/application/subscribe_application",
{
method: "PUT",
headers: {
@@ -60,7 +60,7 @@ export async function deleteSubscribeApplication(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>(
"/v1/admin/application/subscribe_application",
"/api/v1/admin/application/subscribe_application",
{
method: "DELETE",
headers: {
@@ -80,7 +80,7 @@ export async function getSubscribeApplicationList(
) {
return request<
API.Response & { data?: API.GetSubscribeApplicationListResponse }
>("/v1/admin/application/subscribe_application_list", {
>("/api/v1/admin/application/subscribe_application_list", {
method: "GET",
params: {
...params,
+7 -7
View File
@@ -8,7 +8,7 @@ export async function getAuthMethodConfig(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.AuthMethodConfig }>(
"/v1/admin/auth-method/config",
"/api/v1/admin/auth-method/config",
{
method: "GET",
params: {
@@ -25,7 +25,7 @@ export async function updateAuthMethodConfig(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.AuthMethodConfig }>(
"/v1/admin/auth-method/config",
"/api/v1/admin/auth-method/config",
{
method: "PUT",
headers: {
@@ -40,7 +40,7 @@ export async function updateAuthMethodConfig(
/** Get email support platform GET /v1/admin/auth-method/email_platform */
export async function getEmailPlatform(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.PlatformResponse }>(
"/v1/admin/auth-method/email_platform",
"/api/v1/admin/auth-method/email_platform",
{
method: "GET",
...(options || {}),
@@ -51,7 +51,7 @@ export async function getEmailPlatform(options?: { [key: string]: any }) {
/** Get auth method list GET /v1/admin/auth-method/list */
export async function getAuthMethodList(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.GetAuthMethodListResponse }>(
"/v1/admin/auth-method/list",
"/api/v1/admin/auth-method/list",
{
method: "GET",
...(options || {}),
@@ -62,7 +62,7 @@ export async function getAuthMethodList(options?: { [key: string]: any }) {
/** Get sms support platform GET /v1/admin/auth-method/sms_platform */
export async function getSmsPlatform(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.PlatformResponse }>(
"/v1/admin/auth-method/sms_platform",
"/api/v1/admin/auth-method/sms_platform",
{
method: "GET",
...(options || {}),
@@ -76,7 +76,7 @@ export async function testEmailSend(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>(
"/v1/admin/auth-method/test_email_send",
"/api/v1/admin/auth-method/test_email_send",
{
method: "POST",
headers: {
@@ -94,7 +94,7 @@ export async function testSmsSend(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>(
"/v1/admin/auth-method/test_sms_send",
"/api/v1/admin/auth-method/test_sms_send",
{
method: "POST",
headers: {
+4 -4
View File
@@ -4,7 +4,7 @@ import request from "@workspace/ui/lib/request";
/** Query revenue statistics GET /v1/admin/console/revenue */
export async function queryRevenueStatistics(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.RevenueStatisticsResponse }>(
"/v1/admin/console/revenue",
"/api/v1/admin/console/revenue",
{
method: "GET",
...(options || {}),
@@ -15,7 +15,7 @@ export async function queryRevenueStatistics(options?: { [key: string]: any }) {
/** Query server total data GET /v1/admin/console/server */
export async function queryServerTotalData(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.ServerTotalDataResponse }>(
"/v1/admin/console/server",
"/api/v1/admin/console/server",
{
method: "GET",
...(options || {}),
@@ -26,7 +26,7 @@ export async function queryServerTotalData(options?: { [key: string]: any }) {
/** Query ticket wait reply GET /v1/admin/console/ticket */
export async function queryTicketWaitReply(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.TicketWaitRelpyResponse }>(
"/v1/admin/console/ticket",
"/api/v1/admin/console/ticket",
{
method: "GET",
...(options || {}),
@@ -37,7 +37,7 @@ export async function queryTicketWaitReply(options?: { [key: string]: any }) {
/** Query user statistics GET /v1/admin/console/user */
export async function queryUserStatistics(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.UserStatisticsResponse }>(
"/v1/admin/console/user",
"/api/v1/admin/console/user",
{
method: "GET",
...(options || {}),
+5 -5
View File
@@ -6,7 +6,7 @@ export async function updateCoupon(
body: API.UpdateCouponRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/coupon/", {
return request<API.Response & { data?: any }>("/api/v1/admin/coupon/", {
method: "PUT",
headers: {
"Content-Type": "application/json",
@@ -21,7 +21,7 @@ export async function createCoupon(
body: API.CreateCouponRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/coupon/", {
return request<API.Response & { data?: any }>("/api/v1/admin/coupon/", {
method: "POST",
headers: {
"Content-Type": "application/json",
@@ -36,7 +36,7 @@ export async function deleteCoupon(
body: API.DeleteCouponRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/coupon/", {
return request<API.Response & { data?: any }>("/api/v1/admin/coupon/", {
method: "DELETE",
headers: {
"Content-Type": "application/json",
@@ -51,7 +51,7 @@ export async function batchDeleteCoupon(
body: API.BatchDeleteCouponRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/coupon/batch", {
return request<API.Response & { data?: any }>("/api/v1/admin/coupon/batch", {
method: "DELETE",
headers: {
"Content-Type": "application/json",
@@ -68,7 +68,7 @@ export async function getCouponList(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.GetCouponListResponse }>(
"/v1/admin/coupon/list",
"/api/v1/admin/coupon/list",
{
method: "GET",
params: {
+16 -13
View File
@@ -6,7 +6,7 @@ export async function updateDocument(
body: API.UpdateDocumentRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/document/", {
return request<API.Response & { data?: any }>("/api/v1/admin/document/", {
method: "PUT",
headers: {
"Content-Type": "application/json",
@@ -21,7 +21,7 @@ export async function createDocument(
body: API.CreateDocumentRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/document/", {
return request<API.Response & { data?: any }>("/api/v1/admin/document/", {
method: "POST",
headers: {
"Content-Type": "application/json",
@@ -36,7 +36,7 @@ export async function deleteDocument(
body: API.DeleteDocumentRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/document/", {
return request<API.Response & { data?: any }>("/api/v1/admin/document/", {
method: "DELETE",
headers: {
"Content-Type": "application/json",
@@ -51,20 +51,23 @@ export async function batchDeleteDocument(
body: API.BatchDeleteDocumentRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/document/batch", {
method: "DELETE",
headers: {
"Content-Type": "application/json",
},
data: body,
...(options || {}),
});
return request<API.Response & { data?: any }>(
"/api/v1/admin/document/batch",
{
method: "DELETE",
headers: {
"Content-Type": "application/json",
},
data: body,
...(options || {}),
}
);
}
/** Get document detail GET /v1/admin/document/detail */
export async function getDocumentDetail(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.Document }>(
"/v1/admin/document/detail",
"/api/v1/admin/document/detail",
{
method: "GET",
...(options || {}),
@@ -79,7 +82,7 @@ export async function getDocumentList(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.GetDocumentListResponse }>(
"/v1/admin/document/list",
"/api/v1/admin/document/list",
{
method: "GET",
params: {
+15 -15
View File
@@ -8,7 +8,7 @@ export async function filterBalanceLog(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.FilterBalanceLogResponse }>(
"/v1/admin/log/balance/list",
"/api/v1/admin/log/balance/list",
{
method: "GET",
params: {
@@ -26,7 +26,7 @@ export async function filterCommissionLog(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.FilterCommissionLogResponse }>(
"/v1/admin/log/commission/list",
"/api/v1/admin/log/commission/list",
{
method: "GET",
params: {
@@ -44,7 +44,7 @@ export async function filterEmailLog(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.FilterEmailLogResponse }>(
"/v1/admin/log/email/list",
"/api/v1/admin/log/email/list",
{
method: "GET",
params: {
@@ -62,7 +62,7 @@ export async function filterGiftLog(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.FilterGiftLogResponse }>(
"/v1/admin/log/gift/list",
"/api/v1/admin/log/gift/list",
{
method: "GET",
params: {
@@ -80,7 +80,7 @@ export async function filterLoginLog(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.FilterLoginLogResponse }>(
"/v1/admin/log/login/list",
"/api/v1/admin/log/login/list",
{
method: "GET",
params: {
@@ -98,7 +98,7 @@ export async function getMessageLogList(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.GetMessageLogListResponse }>(
"/v1/admin/log/message/list",
"/api/v1/admin/log/message/list",
{
method: "GET",
params: {
@@ -116,7 +116,7 @@ export async function filterMobileLog(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.FilterMobileLogResponse }>(
"/v1/admin/log/mobile/list",
"/api/v1/admin/log/mobile/list",
{
method: "GET",
params: {
@@ -134,7 +134,7 @@ export async function filterRegisterLog(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.FilterRegisterLogResponse }>(
"/v1/admin/log/register/list",
"/api/v1/admin/log/register/list",
{
method: "GET",
params: {
@@ -152,7 +152,7 @@ export async function filterServerTrafficLog(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.FilterServerTrafficLogResponse }>(
"/v1/admin/log/server/traffic/list",
"/api/v1/admin/log/server/traffic/list",
{
method: "GET",
params: {
@@ -166,7 +166,7 @@ export async function filterServerTrafficLog(
/** Get log setting GET /v1/admin/log/setting */
export async function getLogSetting(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.LogSetting }>(
"/v1/admin/log/setting",
"/api/v1/admin/log/setting",
{
method: "GET",
...(options || {}),
@@ -179,7 +179,7 @@ export async function updateLogSetting(
body: API.LogSetting,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/log/setting", {
return request<API.Response & { data?: any }>("/api/v1/admin/log/setting", {
method: "POST",
headers: {
"Content-Type": "application/json",
@@ -196,7 +196,7 @@ export async function filterSubscribeLog(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.FilterSubscribeLogResponse }>(
"/v1/admin/log/subscribe/list",
"/api/v1/admin/log/subscribe/list",
{
method: "GET",
params: {
@@ -214,7 +214,7 @@ export async function filterResetSubscribeLog(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.FilterResetSubscribeLogResponse }>(
"/v1/admin/log/subscribe/reset/list",
"/api/v1/admin/log/subscribe/reset/list",
{
method: "GET",
params: {
@@ -232,7 +232,7 @@ export async function filterUserSubscribeTrafficLog(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.FilterSubscribeTrafficResponse }>(
"/v1/admin/log/subscribe/traffic/list",
"/api/v1/admin/log/subscribe/traffic/list",
{
method: "GET",
params: {
@@ -250,7 +250,7 @@ export async function filterTrafficLogDetails(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.FilterTrafficLogDetailsResponse }>(
"/v1/admin/log/traffic/details",
"/api/v1/admin/log/traffic/details",
{
method: "GET",
params: {
+8 -8
View File
@@ -9,7 +9,7 @@ export async function getBatchSendEmailTaskList(
) {
return request<
API.Response & { data?: API.GetBatchSendEmailTaskListResponse }
>("/v1/admin/marketing/email/batch/list", {
>("/api/v1/admin/marketing/email/batch/list", {
method: "GET",
params: {
...params,
@@ -24,7 +24,7 @@ export async function getPreSendEmailCount(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.GetPreSendEmailCountResponse }>(
"/v1/admin/marketing/email/batch/pre-send-count",
"/api/v1/admin/marketing/email/batch/pre-send-count",
{
method: "POST",
headers: {
@@ -42,7 +42,7 @@ export async function createBatchSendEmailTask(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>(
"/v1/admin/marketing/email/batch/send",
"/api/v1/admin/marketing/email/batch/send",
{
method: "POST",
headers: {
@@ -61,7 +61,7 @@ export async function getBatchSendEmailTaskStatus(
) {
return request<
API.Response & { data?: API.GetBatchSendEmailTaskStatusResponse }
>("/v1/admin/marketing/email/batch/status", {
>("/api/v1/admin/marketing/email/batch/status", {
method: "POST",
headers: {
"Content-Type": "application/json",
@@ -77,7 +77,7 @@ export async function stopBatchSendEmailTask(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>(
"/v1/admin/marketing/email/batch/stop",
"/api/v1/admin/marketing/email/batch/stop",
{
method: "POST",
headers: {
@@ -95,7 +95,7 @@ export async function createQuotaTask(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>(
"/v1/admin/marketing/quota/create",
"/api/v1/admin/marketing/quota/create",
{
method: "POST",
headers: {
@@ -114,7 +114,7 @@ export async function queryQuotaTaskList(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.QueryQuotaTaskListResponse }>(
"/v1/admin/marketing/quota/list",
"/api/v1/admin/marketing/quota/list",
{
method: "GET",
params: {
@@ -131,7 +131,7 @@ export async function queryQuotaTaskPreCount(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.QueryQuotaTaskPreCountResponse }>(
"/v1/admin/marketing/quota/pre-count",
"/api/v1/admin/marketing/quota/pre-count",
{
method: "POST",
headers: {
+3 -3
View File
@@ -6,7 +6,7 @@ export async function createOrder(
body: API.CreateOrderRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/order/", {
return request<API.Response & { data?: any }>("/api/v1/admin/order/", {
method: "POST",
headers: {
"Content-Type": "application/json",
@@ -23,7 +23,7 @@ export async function getOrderList(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.GetOrderListResponse }>(
"/v1/admin/order/list",
"/api/v1/admin/order/list",
{
method: "GET",
params: {
@@ -39,7 +39,7 @@ export async function updateOrderStatus(
body: API.UpdateOrderStatusRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/order/status", {
return request<API.Response & { data?: any }>("/api/v1/admin/order/status", {
method: "PUT",
headers: {
"Content-Type": "application/json",
+5 -5
View File
@@ -7,7 +7,7 @@ export async function updatePaymentMethod(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.PaymentConfig }>(
"/v1/admin/payment/",
"/api/v1/admin/payment/",
{
method: "PUT",
headers: {
@@ -25,7 +25,7 @@ export async function createPaymentMethod(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.PaymentConfig }>(
"/v1/admin/payment/",
"/api/v1/admin/payment/",
{
method: "POST",
headers: {
@@ -42,7 +42,7 @@ export async function deletePaymentMethod(
body: API.DeletePaymentMethodRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/payment/", {
return request<API.Response & { data?: any }>("/api/v1/admin/payment/", {
method: "DELETE",
headers: {
"Content-Type": "application/json",
@@ -59,7 +59,7 @@ export async function getPaymentMethodList(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.GetPaymentMethodListResponse }>(
"/v1/admin/payment/list",
"/api/v1/admin/payment/list",
{
method: "GET",
params: {
@@ -73,7 +73,7 @@ export async function getPaymentMethodList(
/** Get supported payment platform GET /v1/admin/payment/platform */
export async function getPaymentPlatform(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.PlatformResponse }>(
"/v1/admin/payment/platform",
"/api/v1/admin/payment/platform",
{
method: "GET",
...(options || {}),
+25 -22
View File
@@ -6,7 +6,7 @@ export async function createServer(
body: API.CreateServerRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/server/create", {
return request<API.Response & { data?: any }>("/api/v1/admin/server/create", {
method: "POST",
headers: {
"Content-Type": "application/json",
@@ -21,7 +21,7 @@ export async function deleteServer(
body: API.DeleteServerRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/server/delete", {
return request<API.Response & { data?: any }>("/api/v1/admin/server/delete", {
method: "POST",
headers: {
"Content-Type": "application/json",
@@ -38,7 +38,7 @@ export async function filterServerList(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.FilterServerListResponse }>(
"/v1/admin/server/list",
"/api/v1/admin/server/list",
{
method: "GET",
params: {
@@ -52,7 +52,7 @@ export async function filterServerList(
/** Check if there is any server or node to migrate GET /v1/admin/server/migrate/has */
export async function hasMigrateSeverNode(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.HasMigrateSeverNodeResponse }>(
"/v1/admin/server/migrate/has",
"/api/v1/admin/server/migrate/has",
{
method: "GET",
...(options || {}),
@@ -63,7 +63,7 @@ export async function hasMigrateSeverNode(options?: { [key: string]: any }) {
/** Migrate server and node data to new database POST /v1/admin/server/migrate/run */
export async function migrateServerNode(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.MigrateServerNodeResponse }>(
"/v1/admin/server/migrate/run",
"/api/v1/admin/server/migrate/run",
{
method: "POST",
...(options || {}),
@@ -77,7 +77,7 @@ export async function createNode(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>(
"/v1/admin/server/node/create",
"/api/v1/admin/server/node/create",
{
method: "POST",
headers: {
@@ -95,7 +95,7 @@ export async function deleteNode(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>(
"/v1/admin/server/node/delete",
"/api/v1/admin/server/node/delete",
{
method: "POST",
headers: {
@@ -114,7 +114,7 @@ export async function filterNodeList(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.FilterNodeListResponse }>(
"/v1/admin/server/node/list",
"/api/v1/admin/server/node/list",
{
method: "GET",
params: {
@@ -130,14 +130,17 @@ export async function resetSortWithNode(
body: API.ResetSortRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/server/node/sort", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
data: body,
...(options || {}),
});
return request<API.Response & { data?: any }>(
"/api/v1/admin/server/node/sort",
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
data: body,
...(options || {}),
}
);
}
/** Toggle Node Status POST /v1/admin/server/node/status/toggle */
@@ -146,7 +149,7 @@ export async function toggleNodeStatus(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>(
"/v1/admin/server/node/status/toggle",
"/api/v1/admin/server/node/status/toggle",
{
method: "POST",
headers: {
@@ -161,7 +164,7 @@ export async function toggleNodeStatus(
/** Query all node tags GET /v1/admin/server/node/tags */
export async function queryNodeTag(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.QueryNodeTagResponse }>(
"/v1/admin/server/node/tags",
"/api/v1/admin/server/node/tags",
{
method: "GET",
...(options || {}),
@@ -175,7 +178,7 @@ export async function updateNode(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>(
"/v1/admin/server/node/update",
"/api/v1/admin/server/node/update",
{
method: "POST",
headers: {
@@ -194,7 +197,7 @@ export async function getServerProtocols(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.GetServerProtocolsResponse }>(
"/v1/admin/server/protocols",
"/api/v1/admin/server/protocols",
{
method: "GET",
params: {
@@ -211,7 +214,7 @@ export async function resetSortWithServer(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>(
"/v1/admin/server/server/sort",
"/api/v1/admin/server/server/sort",
{
method: "POST",
headers: {
@@ -228,7 +231,7 @@ export async function updateServer(
body: API.UpdateServerRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/server/update", {
return request<API.Response & { data?: any }>("/api/v1/admin/server/update", {
method: "POST",
headers: {
"Content-Type": "application/json",
+63 -48
View File
@@ -6,7 +6,7 @@ export async function updateSubscribe(
body: API.UpdateSubscribeRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/subscribe/", {
return request<API.Response & { data?: any }>("/api/v1/admin/subscribe/", {
method: "PUT",
headers: {
"Content-Type": "application/json",
@@ -21,7 +21,7 @@ export async function createSubscribe(
body: API.CreateSubscribeRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/subscribe/", {
return request<API.Response & { data?: any }>("/api/v1/admin/subscribe/", {
method: "POST",
headers: {
"Content-Type": "application/json",
@@ -36,7 +36,7 @@ export async function deleteSubscribe(
body: API.DeleteSubscribeRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/subscribe/", {
return request<API.Response & { data?: any }>("/api/v1/admin/subscribe/", {
method: "DELETE",
headers: {
"Content-Type": "application/json",
@@ -51,14 +51,17 @@ export async function batchDeleteSubscribe(
body: API.BatchDeleteSubscribeRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/subscribe/batch", {
method: "DELETE",
headers: {
"Content-Type": "application/json",
},
data: body,
...(options || {}),
});
return request<API.Response & { data?: any }>(
"/api/v1/admin/subscribe/batch",
{
method: "DELETE",
headers: {
"Content-Type": "application/json",
},
data: body,
...(options || {}),
}
);
}
/** Get subscribe details GET /v1/admin/subscribe/details */
@@ -68,7 +71,7 @@ export async function getSubscribeDetails(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.Subscribe }>(
"/v1/admin/subscribe/details",
"/api/v1/admin/subscribe/details",
{
method: "GET",
params: {
@@ -84,14 +87,17 @@ export async function updateSubscribeGroup(
body: API.UpdateSubscribeGroupRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/subscribe/group", {
method: "PUT",
headers: {
"Content-Type": "application/json",
},
data: body,
...(options || {}),
});
return request<API.Response & { data?: any }>(
"/api/v1/admin/subscribe/group",
{
method: "PUT",
headers: {
"Content-Type": "application/json",
},
data: body,
...(options || {}),
}
);
}
/** Create subscribe group POST /v1/admin/subscribe/group */
@@ -99,14 +105,17 @@ export async function createSubscribeGroup(
body: API.CreateSubscribeGroupRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/subscribe/group", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
data: body,
...(options || {}),
});
return request<API.Response & { data?: any }>(
"/api/v1/admin/subscribe/group",
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
data: body,
...(options || {}),
}
);
}
/** Delete subscribe group DELETE /v1/admin/subscribe/group */
@@ -114,14 +123,17 @@ export async function deleteSubscribeGroup(
body: API.DeleteSubscribeGroupRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/subscribe/group", {
method: "DELETE",
headers: {
"Content-Type": "application/json",
},
data: body,
...(options || {}),
});
return request<API.Response & { data?: any }>(
"/api/v1/admin/subscribe/group",
{
method: "DELETE",
headers: {
"Content-Type": "application/json",
},
data: body,
...(options || {}),
}
);
}
/** Batch delete subscribe group DELETE /v1/admin/subscribe/group/batch */
@@ -130,7 +142,7 @@ export async function batchDeleteSubscribeGroup(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>(
"/v1/admin/subscribe/group/batch",
"/api/v1/admin/subscribe/group/batch",
{
method: "DELETE",
headers: {
@@ -145,7 +157,7 @@ export async function batchDeleteSubscribeGroup(
/** Get subscribe group list GET /v1/admin/subscribe/group/list */
export async function getSubscribeGroupList(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.GetSubscribeGroupListResponse }>(
"/v1/admin/subscribe/group/list",
"/api/v1/admin/subscribe/group/list",
{
method: "GET",
...(options || {}),
@@ -160,7 +172,7 @@ export async function getSubscribeList(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.GetSubscribeListResponse }>(
"/v1/admin/subscribe/list",
"/api/v1/admin/subscribe/list",
{
method: "GET",
params: {
@@ -174,7 +186,7 @@ export async function getSubscribeList(
/** Reset all subscribe tokens POST /v1/admin/subscribe/reset_all_token */
export async function resetAllSubscribeToken(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.ResetAllSubscribeTokenResponse }>(
"/v1/admin/subscribe/reset_all_token",
"/api/v1/admin/subscribe/reset_all_token",
{
method: "POST",
...(options || {}),
@@ -187,12 +199,15 @@ export async function subscribeSort(
body: API.SubscribeSortRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/subscribe/sort", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
data: body,
...(options || {}),
});
return request<API.Response & { data?: any }>(
"/api/v1/admin/subscribe/sort",
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
data: body,
...(options || {}),
}
);
}
+45 -39
View File
@@ -4,7 +4,7 @@ import request from "@workspace/ui/lib/request";
/** Get Currency Config GET /v1/admin/system/currency_config */
export async function getCurrencyConfig(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.CurrencyConfig }>(
"/v1/admin/system/currency_config",
"/api/v1/admin/system/currency_config",
{
method: "GET",
...(options || {}),
@@ -18,7 +18,7 @@ export async function updateCurrencyConfig(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>(
"/v1/admin/system/currency_config",
"/api/v1/admin/system/currency_config",
{
method: "PUT",
headers: {
@@ -33,7 +33,7 @@ export async function updateCurrencyConfig(
/** Get Node Multiplier GET /v1/admin/system/get_node_multiplier */
export async function getNodeMultiplier(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.GetNodeMultiplierResponse }>(
"/v1/admin/system/get_node_multiplier",
"/api/v1/admin/system/get_node_multiplier",
{
method: "GET",
...(options || {}),
@@ -44,7 +44,7 @@ export async function getNodeMultiplier(options?: { [key: string]: any }) {
/** Get invite config GET /v1/admin/system/invite_config */
export async function getInviteConfig(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.InviteConfig }>(
"/v1/admin/system/invite_config",
"/api/v1/admin/system/invite_config",
{
method: "GET",
...(options || {}),
@@ -58,7 +58,7 @@ export async function updateInviteConfig(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>(
"/v1/admin/system/invite_config",
"/api/v1/admin/system/invite_config",
{
method: "PUT",
headers: {
@@ -73,7 +73,7 @@ export async function updateInviteConfig(
/** Get Module Config GET /v1/admin/system/module */
export async function getModuleConfig(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.ModuleConfig }>(
"/v1/admin/system/module",
"/api/v1/admin/system/module",
{
method: "GET",
...(options || {}),
@@ -84,7 +84,7 @@ export async function getModuleConfig(options?: { [key: string]: any }) {
/** Get node config GET /v1/admin/system/node_config */
export async function getNodeConfig(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.NodeConfig }>(
"/v1/admin/system/node_config",
"/api/v1/admin/system/node_config",
{
method: "GET",
...(options || {}),
@@ -98,7 +98,7 @@ export async function updateNodeConfig(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>(
"/v1/admin/system/node_config",
"/api/v1/admin/system/node_config",
{
method: "PUT",
headers: {
@@ -113,7 +113,7 @@ export async function updateNodeConfig(
/** PreView Node Multiplier GET /v1/admin/system/node_multiplier/preview */
export async function preViewNodeMultiplier(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.PreViewNodeMultiplierResponse }>(
"/v1/admin/system/node_multiplier/preview",
"/api/v1/admin/system/node_multiplier/preview",
{
method: "GET",
...(options || {}),
@@ -124,7 +124,7 @@ export async function preViewNodeMultiplier(options?: { [key: string]: any }) {
/** get Privacy Policy Config GET /v1/admin/system/privacy */
export async function getPrivacyPolicyConfig(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.PrivacyPolicyConfig }>(
"/v1/admin/system/privacy",
"/api/v1/admin/system/privacy",
{
method: "GET",
...(options || {}),
@@ -137,20 +137,23 @@ export async function updatePrivacyPolicyConfig(
body: API.PrivacyPolicyConfig,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/system/privacy", {
method: "PUT",
headers: {
"Content-Type": "application/json",
},
data: body,
...(options || {}),
});
return request<API.Response & { data?: any }>(
"/api/v1/admin/system/privacy",
{
method: "PUT",
headers: {
"Content-Type": "application/json",
},
data: body,
...(options || {}),
}
);
}
/** Get register config GET /v1/admin/system/register_config */
export async function getRegisterConfig(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.RegisterConfig }>(
"/v1/admin/system/register_config",
"/api/v1/admin/system/register_config",
{
method: "GET",
...(options || {}),
@@ -164,7 +167,7 @@ export async function updateRegisterConfig(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>(
"/v1/admin/system/register_config",
"/api/v1/admin/system/register_config",
{
method: "PUT",
headers: {
@@ -182,7 +185,7 @@ export async function setNodeMultiplier(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>(
"/v1/admin/system/set_node_multiplier",
"/api/v1/admin/system/set_node_multiplier",
{
method: "POST",
headers: {
@@ -197,7 +200,7 @@ export async function setNodeMultiplier(
/** setting telegram bot POST /v1/admin/system/setting_telegram_bot */
export async function settingTelegramBot(options?: { [key: string]: any }) {
return request<API.Response & { data?: any }>(
"/v1/admin/system/setting_telegram_bot",
"/api/v1/admin/system/setting_telegram_bot",
{
method: "POST",
...(options || {}),
@@ -208,7 +211,7 @@ export async function settingTelegramBot(options?: { [key: string]: any }) {
/** Get site config GET /v1/admin/system/site_config */
export async function getSiteConfig(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.SiteConfig }>(
"/v1/admin/system/site_config",
"/api/v1/admin/system/site_config",
{
method: "GET",
...(options || {}),
@@ -222,7 +225,7 @@ export async function updateSiteConfig(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>(
"/v1/admin/system/site_config",
"/api/v1/admin/system/site_config",
{
method: "PUT",
headers: {
@@ -237,7 +240,7 @@ export async function updateSiteConfig(
/** Get subscribe config GET /v1/admin/system/subscribe_config */
export async function getSubscribeConfig(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.SubscribeConfig }>(
"/v1/admin/system/subscribe_config",
"/api/v1/admin/system/subscribe_config",
{
method: "GET",
...(options || {}),
@@ -251,7 +254,7 @@ export async function updateSubscribeConfig(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>(
"/v1/admin/system/subscribe_config",
"/api/v1/admin/system/subscribe_config",
{
method: "PUT",
headers: {
@@ -266,7 +269,7 @@ export async function updateSubscribeConfig(
/** Get Team of Service Config GET /v1/admin/system/tos_config */
export async function getTosConfig(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.TosConfig }>(
"/v1/admin/system/tos_config",
"/api/v1/admin/system/tos_config",
{
method: "GET",
...(options || {}),
@@ -279,20 +282,23 @@ export async function updateTosConfig(
body: API.TosConfig,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/system/tos_config", {
method: "PUT",
headers: {
"Content-Type": "application/json",
},
data: body,
...(options || {}),
});
return request<API.Response & { data?: any }>(
"/api/v1/admin/system/tos_config",
{
method: "PUT",
headers: {
"Content-Type": "application/json",
},
data: body,
...(options || {}),
}
);
}
/** Get Verify Code Config GET /v1/admin/system/verify_code_config */
export async function getVerifyCodeConfig(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.VerifyCodeConfig }>(
"/v1/admin/system/verify_code_config",
"/api/v1/admin/system/verify_code_config",
{
method: "GET",
...(options || {}),
@@ -306,7 +312,7 @@ export async function updateVerifyCodeConfig(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>(
"/v1/admin/system/verify_code_config",
"/api/v1/admin/system/verify_code_config",
{
method: "PUT",
headers: {
@@ -321,7 +327,7 @@ export async function updateVerifyCodeConfig(
/** Get verify config GET /v1/admin/system/verify_config */
export async function getVerifyConfig(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.VerifyConfig }>(
"/v1/admin/system/verify_config",
"/api/v1/admin/system/verify_config",
{
method: "GET",
...(options || {}),
@@ -335,7 +341,7 @@ export async function updateVerifyConfig(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>(
"/v1/admin/system/verify_config",
"/api/v1/admin/system/verify_config",
{
method: "PUT",
headers: {
+4 -4
View File
@@ -6,7 +6,7 @@ export async function updateTicketStatus(
body: API.UpdateTicketStatusRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/ticket/", {
return request<API.Response & { data?: any }>("/api/v1/admin/ticket/", {
method: "PUT",
headers: {
"Content-Type": "application/json",
@@ -23,7 +23,7 @@ export async function getTicket(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.Ticket }>(
"/v1/admin/ticket/detail",
"/api/v1/admin/ticket/detail",
{
method: "GET",
params: {
@@ -39,7 +39,7 @@ export async function createTicketFollow(
body: API.CreateTicketFollowRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/ticket/follow", {
return request<API.Response & { data?: any }>("/api/v1/admin/ticket/follow", {
method: "POST",
headers: {
"Content-Type": "application/json",
@@ -56,7 +56,7 @@ export async function getTicketList(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.GetTicketListResponse }>(
"/v1/admin/ticket/list",
"/api/v1/admin/ticket/list",
{
method: "GET",
params: {
+21 -3
View File
@@ -1,10 +1,28 @@
/* eslint-disable */
import request from "@workspace/ui/lib/request";
/** Query IP Location GET /v1/admin/tool/ip/location */
export async function queryIpLocation(
// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
params: API.QueryIPLocationParams,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.QueryIPLocationResponse }>(
"/api/v1/admin/tool/ip/location",
{
method: "GET",
params: {
...params,
},
...(options || {}),
}
);
}
/** Get System Log GET /v1/admin/tool/log */
export async function getSystemLog(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.LogResponse }>(
"/v1/admin/tool/log",
"/api/v1/admin/tool/log",
{
method: "GET",
...(options || {}),
@@ -14,7 +32,7 @@ export async function getSystemLog(options?: { [key: string]: any }) {
/** Restart System GET /v1/admin/tool/restart */
export async function restartSystem(options?: { [key: string]: any }) {
return request<API.Response & { data?: any }>("/v1/admin/tool/restart", {
return request<API.Response & { data?: any }>("/api/v1/admin/tool/restart", {
method: "GET",
...(options || {}),
});
@@ -23,7 +41,7 @@ export async function restartSystem(options?: { [key: string]: any }) {
/** Get Version GET /v1/admin/tool/version */
export async function getVersion(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.VersionResponse }>(
"/v1/admin/tool/version",
"/api/v1/admin/tool/version",
{
method: "GET",
...(options || {}),
+15
View File
@@ -1648,6 +1648,20 @@ declare namespace API {
list: Document[];
};
type QueryIPLocationParams = {
ip: string;
};
type QueryIPLocationRequest = {
ip: string;
};
type QueryIPLocationResponse = {
country: string;
region?: string;
city: string;
};
type QueryNodeTagResponse = {
tags: string[];
};
@@ -2388,6 +2402,7 @@ declare namespace API {
enable_trade_notify: boolean;
auth_methods: UserAuthMethod[];
user_devices: UserDevice[];
rules: string[];
created_at: number;
updated_at: number;
deleted_at?: number;
+100 -76
View File
@@ -6,7 +6,7 @@ export async function createUser(
body: API.CreateUserRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/user/", {
return request<API.Response & { data?: any }>("/api/v1/admin/user/", {
method: "POST",
headers: {
"Content-Type": "application/json",
@@ -22,7 +22,7 @@ export async function deleteUser(
params: API.DeleteUserParams,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/user/", {
return request<API.Response & { data?: any }>("/api/v1/admin/user/", {
method: "DELETE",
params: {
...params,
@@ -34,7 +34,7 @@ export async function deleteUser(
/** Get user auth method GET /v1/admin/user/auth_method */
export async function getUserAuthMethod(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.GetUserAuthMethodResponse }>(
"/v1/admin/user/auth_method",
"/api/v1/admin/user/auth_method",
{
method: "GET",
...(options || {}),
@@ -47,14 +47,17 @@ export async function updateUserAuthMethod(
body: API.UpdateUserAuthMethodRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/user/auth_method", {
method: "PUT",
headers: {
"Content-Type": "application/json",
},
data: body,
...(options || {}),
});
return request<API.Response & { data?: any }>(
"/api/v1/admin/user/auth_method",
{
method: "PUT",
headers: {
"Content-Type": "application/json",
},
data: body,
...(options || {}),
}
);
}
/** Create user auth method POST /v1/admin/user/auth_method */
@@ -62,14 +65,17 @@ export async function createUserAuthMethod(
body: API.CreateUserAuthMethodRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/user/auth_method", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
data: body,
...(options || {}),
});
return request<API.Response & { data?: any }>(
"/api/v1/admin/user/auth_method",
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
data: body,
...(options || {}),
}
);
}
/** Delete user auth method DELETE /v1/admin/user/auth_method */
@@ -77,14 +83,17 @@ export async function deleteUserAuthMethod(
body: API.DeleteUserAuthMethodRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/user/auth_method", {
method: "DELETE",
headers: {
"Content-Type": "application/json",
},
data: body,
...(options || {}),
});
return request<API.Response & { data?: any }>(
"/api/v1/admin/user/auth_method",
{
method: "DELETE",
headers: {
"Content-Type": "application/json",
},
data: body,
...(options || {}),
}
);
}
/** Update user basic info PUT /v1/admin/user/basic */
@@ -92,7 +101,7 @@ export async function updateUserBasicInfo(
body: API.UpdateUserBasiceInfoRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/user/basic", {
return request<API.Response & { data?: any }>("/api/v1/admin/user/basic", {
method: "PUT",
headers: {
"Content-Type": "application/json",
@@ -107,7 +116,7 @@ export async function batchDeleteUser(
body: API.BatchDeleteUserRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/user/batch", {
return request<API.Response & { data?: any }>("/api/v1/admin/user/batch", {
method: "DELETE",
headers: {
"Content-Type": "application/json",
@@ -119,10 +128,13 @@ export async function batchDeleteUser(
/** Current user GET /v1/admin/user/current */
export async function currentUser(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.User }>("/v1/admin/user/current", {
method: "GET",
...(options || {}),
});
return request<API.Response & { data?: API.User }>(
"/api/v1/admin/user/current",
{
method: "GET",
...(options || {}),
}
);
}
/** Get user detail GET /v1/admin/user/detail */
@@ -131,13 +143,16 @@ export async function getUserDetail(
params: API.GetUserDetailParams,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.User }>("/v1/admin/user/detail", {
method: "GET",
params: {
...params,
},
...(options || {}),
});
return request<API.Response & { data?: API.User }>(
"/api/v1/admin/user/detail",
{
method: "GET",
params: {
...params,
},
...(options || {}),
}
);
}
/** User device PUT /v1/admin/user/device */
@@ -145,7 +160,7 @@ export async function updateUserDevice(
body: API.UserDevice,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/user/device", {
return request<API.Response & { data?: any }>("/api/v1/admin/user/device", {
method: "PUT",
headers: {
"Content-Type": "application/json",
@@ -160,7 +175,7 @@ export async function deleteUserDevice(
body: API.DeleteUserDeivceRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/user/device", {
return request<API.Response & { data?: any }>("/api/v1/admin/user/device", {
method: "DELETE",
headers: {
"Content-Type": "application/json",
@@ -176,7 +191,7 @@ export async function kickOfflineByUserDevice(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>(
"/v1/admin/user/device/kick_offline",
"/api/v1/admin/user/device/kick_offline",
{
method: "PUT",
headers: {
@@ -195,7 +210,7 @@ export async function getUserList(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.GetUserListResponse }>(
"/v1/admin/user/list",
"/api/v1/admin/user/list",
{
method: "GET",
params: {
@@ -213,7 +228,7 @@ export async function getUserLoginLogs(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.GetUserLoginLogsResponse }>(
"/v1/admin/user/login/logs",
"/api/v1/admin/user/login/logs",
{
method: "GET",
params: {
@@ -229,7 +244,7 @@ export async function updateUserNotifySetting(
body: API.UpdateUserNotifySettingRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/user/notify", {
return request<API.Response & { data?: any }>("/api/v1/admin/user/notify", {
method: "PUT",
headers: {
"Content-Type": "application/json",
@@ -246,7 +261,7 @@ export async function getUserSubscribe(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.GetUserSubscribeListResponse }>(
"/v1/admin/user/subscribe",
"/api/v1/admin/user/subscribe",
{
method: "GET",
params: {
@@ -262,14 +277,17 @@ export async function updateUserSubscribe(
body: API.UpdateUserSubscribeRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/user/subscribe", {
method: "PUT",
headers: {
"Content-Type": "application/json",
},
data: body,
...(options || {}),
});
return request<API.Response & { data?: any }>(
"/api/v1/admin/user/subscribe",
{
method: "PUT",
headers: {
"Content-Type": "application/json",
},
data: body,
...(options || {}),
}
);
}
/** Create user subcribe POST /v1/admin/user/subscribe */
@@ -277,14 +295,17 @@ export async function createUserSubscribe(
body: API.CreateUserSubscribeRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/user/subscribe", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
data: body,
...(options || {}),
});
return request<API.Response & { data?: any }>(
"/api/v1/admin/user/subscribe",
{
method: "POST",
headers: {
"Content-Type": "application/json",
},
data: body,
...(options || {}),
}
);
}
/** Delete user subcribe DELETE /v1/admin/user/subscribe */
@@ -292,14 +313,17 @@ export async function deleteUserSubscribe(
body: API.DeleteUserSubscribeRequest,
options?: { [key: string]: any }
) {
return request<API.Response & { data?: any }>("/v1/admin/user/subscribe", {
method: "DELETE",
headers: {
"Content-Type": "application/json",
},
data: body,
...(options || {}),
});
return request<API.Response & { data?: any }>(
"/api/v1/admin/user/subscribe",
{
method: "DELETE",
headers: {
"Content-Type": "application/json",
},
data: body,
...(options || {}),
}
);
}
/** Get user subcribe by id GET /v1/admin/user/subscribe/detail */
@@ -309,7 +333,7 @@ export async function getUserSubscribeById(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.UserSubscribeDetail }>(
"/v1/admin/user/subscribe/detail",
"/api/v1/admin/user/subscribe/detail",
{
method: "GET",
params: {
@@ -327,7 +351,7 @@ export async function getUserSubscribeDevices(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.GetUserSubscribeDevicesResponse }>(
"/v1/admin/user/subscribe/device",
"/api/v1/admin/user/subscribe/device",
{
method: "GET",
params: {
@@ -345,7 +369,7 @@ export async function getUserSubscribeLogs(
options?: { [key: string]: any }
) {
return request<API.Response & { data?: API.GetUserSubscribeLogsResponse }>(
"/v1/admin/user/subscribe/logs",
"/api/v1/admin/user/subscribe/logs",
{
method: "GET",
params: {
@@ -364,7 +388,7 @@ export async function getUserSubscribeResetTrafficLogs(
) {
return request<
API.Response & { data?: API.GetUserSubscribeResetTrafficLogsResponse }
>("/v1/admin/user/subscribe/reset/logs", {
>("/api/v1/admin/user/subscribe/reset/logs", {
method: "GET",
params: {
...params,
@@ -381,7 +405,7 @@ export async function getUserSubscribeTrafficLogs(
) {
return request<
API.Response & { data?: API.GetUserSubscribeTrafficLogsResponse }
>("/v1/admin/user/subscribe/traffic_logs", {
>("/api/v1/admin/user/subscribe/traffic_logs", {
method: "GET",
params: {
...params,