第一次上传
This commit is contained in:
@@ -0,0 +1,100 @@
|
||||
import request from "@/utils/request";
|
||||
import type {
|
||||
StaticAssetAutoRenewForm,
|
||||
StaticAssetBatchSyncForm,
|
||||
StaticAssetChangeNodeForm,
|
||||
StaticAssetCredentialForm,
|
||||
StaticAssetItem,
|
||||
StaticAssetQueryParams,
|
||||
StaticAssetRenewForm,
|
||||
StaticAssetRenewResult,
|
||||
StaticAssetSyncForm,
|
||||
StaticAssetWhitelistItem,
|
||||
StaticAssetWhitelistForm,
|
||||
} from "./types";
|
||||
|
||||
const STATIC_ASSET_BASE_URL = "/api/v1/proxy/static-assets";
|
||||
|
||||
const StaticAssetAPI = {
|
||||
getPage(queryParams?: StaticAssetQueryParams) {
|
||||
return request<any, PageResult<StaticAssetItem>>({
|
||||
url: STATIC_ASSET_BASE_URL,
|
||||
method: "get",
|
||||
params: queryParams,
|
||||
});
|
||||
},
|
||||
|
||||
renew(data: StaticAssetRenewForm) {
|
||||
return request<any, StaticAssetRenewResult>({
|
||||
url: `${STATIC_ASSET_BASE_URL}/renew`,
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
},
|
||||
|
||||
updateCredentials(data: StaticAssetCredentialForm) {
|
||||
return request({
|
||||
url: `${STATIC_ASSET_BASE_URL}/credentials`,
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
},
|
||||
|
||||
changeNode(data: StaticAssetChangeNodeForm) {
|
||||
return request({
|
||||
url: `${STATIC_ASSET_BASE_URL}/change-node`,
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
},
|
||||
|
||||
syncFromUpstream(data: StaticAssetSyncForm) {
|
||||
return request({
|
||||
url: `${STATIC_ASSET_BASE_URL}/sync`,
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
},
|
||||
|
||||
batchSyncFromUpstream(data: StaticAssetBatchSyncForm) {
|
||||
return request<any, number>({
|
||||
url: `${STATIC_ASSET_BASE_URL}/batch-sync`,
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
},
|
||||
|
||||
updateAutoRenew(data: StaticAssetAutoRenewForm) {
|
||||
return request({
|
||||
url: `${STATIC_ASSET_BASE_URL}/auto-renew`,
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
},
|
||||
|
||||
addWhitelist(data: StaticAssetWhitelistForm) {
|
||||
return request({
|
||||
url: `${STATIC_ASSET_BASE_URL}/whitelists`,
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
},
|
||||
|
||||
getWhitelistList(assetId: number) {
|
||||
return request<any, StaticAssetWhitelistItem[]>({
|
||||
url: `${STATIC_ASSET_BASE_URL}/${assetId}/whitelists`,
|
||||
method: "get",
|
||||
});
|
||||
},
|
||||
|
||||
deleteWhitelist(id: number) {
|
||||
return request({
|
||||
url: `${STATIC_ASSET_BASE_URL}/whitelists/${id}`,
|
||||
method: "delete",
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
export default StaticAssetAPI;
|
||||
|
||||
export * from "./types";
|
||||
Reference in New Issue
Block a user