菜单修改优化
This commit is contained in:
@@ -1569,6 +1569,191 @@ export function deleteQueryAsinHistory(resultId: number) {
|
||||
);
|
||||
}
|
||||
|
||||
// ========== 店铺数据抓取 ==========
|
||||
|
||||
export interface ShopDataCrawlCandidateVo {
|
||||
id: number;
|
||||
shop_name: string;
|
||||
created_at?: string;
|
||||
}
|
||||
|
||||
export interface ShopDataCrawlCountryPreferenceVo {
|
||||
country_codes: string[];
|
||||
}
|
||||
|
||||
export interface ShopDataCrawlShopItem {
|
||||
shopName: string;
|
||||
matched: boolean;
|
||||
shopId?: string;
|
||||
platform?: string;
|
||||
companyName?: string;
|
||||
openStoreUrl?: string;
|
||||
matchedUserId?: number;
|
||||
matchStatus?: string;
|
||||
matchMessage?: string;
|
||||
}
|
||||
|
||||
export interface ShopDataCrawlMatchVo {
|
||||
items: ShopDataCrawlShopItem[];
|
||||
}
|
||||
|
||||
export interface ShopDataCrawlDashboardVo {
|
||||
candidateCount: number;
|
||||
processedTaskCount: number;
|
||||
successTaskCount: number;
|
||||
failedTaskCount: number;
|
||||
}
|
||||
|
||||
export interface ShopDataCrawlHistoryItem extends ShopDataCrawlShopItem {
|
||||
resultId?: number;
|
||||
taskId?: number;
|
||||
taskStatus?: string;
|
||||
success?: boolean;
|
||||
error?: string;
|
||||
fileReady?: boolean;
|
||||
fileStatus?: string;
|
||||
downloadUrl?: string;
|
||||
outputFilename?: string;
|
||||
createdAt?: string;
|
||||
finishedAt?: string;
|
||||
}
|
||||
|
||||
export interface ShopDataCrawlHistoryVo {
|
||||
items: ShopDataCrawlHistoryItem[];
|
||||
}
|
||||
|
||||
export interface ShopDataCrawlTaskSummary {
|
||||
id?: number;
|
||||
status?: string;
|
||||
errorMessage?: string;
|
||||
createdAt?: string;
|
||||
finishedAt?: string;
|
||||
countryCodes?: string[];
|
||||
}
|
||||
|
||||
export interface ShopDataCrawlTaskDetailVo {
|
||||
task?: ShopDataCrawlTaskSummary;
|
||||
items?: ShopDataCrawlHistoryItem[];
|
||||
}
|
||||
|
||||
export interface ShopDataCrawlTaskBatchVo {
|
||||
items: Array<ShopDataCrawlTaskDetailVo | ShopDataCrawlHistoryItem>;
|
||||
missingTaskIds?: number[];
|
||||
}
|
||||
|
||||
export interface ShopDataCrawlCreateTaskVo {
|
||||
taskId: number;
|
||||
items: ShopDataCrawlHistoryItem[];
|
||||
}
|
||||
|
||||
export function listShopDataCrawlCandidates() {
|
||||
return unwrapJavaResponse(
|
||||
get<JavaApiResponse<ShopDataCrawlCandidateVo[]>>(`${JAVA_API_PREFIX}/shop-data-crawl/candidates`, {
|
||||
params: { user_id: getCurrentUserId() },
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
export function addShopDataCrawlCandidate(shopName: string) {
|
||||
return unwrapJavaResponse(
|
||||
post<JavaApiResponse<ShopDataCrawlCandidateVo>, { user_id: number; shop_name: string }>(
|
||||
`${JAVA_API_PREFIX}/shop-data-crawl/candidates`,
|
||||
{ user_id: getCurrentUserId(), shop_name: shopName },
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
export function deleteShopDataCrawlCandidate(id: number) {
|
||||
return unwrapJavaResponse(
|
||||
del<JavaApiResponse<null>>(`${JAVA_API_PREFIX}/shop-data-crawl/candidates/${id}`, {
|
||||
params: { user_id: getCurrentUserId() },
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
export function getShopDataCrawlCountryPreference() {
|
||||
return unwrapJavaResponse(
|
||||
get<JavaApiResponse<ShopDataCrawlCountryPreferenceVo>>(
|
||||
`${JAVA_API_PREFIX}/shop-data-crawl/country-preference`,
|
||||
{ params: { user_id: getCurrentUserId() } },
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
export function putShopDataCrawlCountryPreference(countryCodes: string[]) {
|
||||
return unwrapJavaResponse(
|
||||
put<JavaApiResponse<ShopDataCrawlCountryPreferenceVo>, { user_id: number; country_codes: string[] }>(
|
||||
`${JAVA_API_PREFIX}/shop-data-crawl/country-preference`,
|
||||
{ user_id: getCurrentUserId(), country_codes: countryCodes },
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
export function matchShopDataCrawlShops(shopNames: string[]) {
|
||||
return unwrapJavaResponse(
|
||||
post<JavaApiResponse<ShopDataCrawlMatchVo>, { user_id: number; shop_names: string[] }>(
|
||||
`${JAVA_API_PREFIX}/shop-data-crawl/match-shops`,
|
||||
{ user_id: getCurrentUserId(), shop_names: shopNames },
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
export function getShopDataCrawlDashboard() {
|
||||
return unwrapJavaResponse(
|
||||
get<JavaApiResponse<ShopDataCrawlDashboardVo>>(`${JAVA_API_PREFIX}/shop-data-crawl/dashboard`, {
|
||||
params: { user_id: getCurrentUserId() },
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
export function getShopDataCrawlHistory() {
|
||||
return unwrapJavaResponse(
|
||||
get<JavaApiResponse<ShopDataCrawlHistoryVo>>(`${JAVA_API_PREFIX}/shop-data-crawl/history`, {
|
||||
params: { user_id: getCurrentUserId() },
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
export function createShopDataCrawlTask(items: ShopDataCrawlShopItem[], countryCodes: string[]) {
|
||||
return unwrapJavaResponse(
|
||||
post<
|
||||
JavaApiResponse<ShopDataCrawlCreateTaskVo>,
|
||||
{ user_id: number; items: ShopDataCrawlShopItem[]; country_codes: string[] }
|
||||
>(`${JAVA_API_PREFIX}/shop-data-crawl/tasks`, {
|
||||
user_id: getCurrentUserId(),
|
||||
items,
|
||||
country_codes: countryCodes,
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
export function getShopDataCrawlTaskProgressBatch(taskIds: number[]) {
|
||||
return postTaskProgressBatch<ShopDataCrawlTaskBatchVo>(
|
||||
`${JAVA_API_PREFIX}/shop-data-crawl/tasks/progress/batch`,
|
||||
taskIds,
|
||||
);
|
||||
}
|
||||
|
||||
export function getShopDataCrawlResultDownloadUrl(resultId: number) {
|
||||
return getJavaDownloadUrl(`/shop-data-crawl/results/${resultId}/download`);
|
||||
}
|
||||
|
||||
export function deleteShopDataCrawlTask(taskId: number) {
|
||||
return unwrapJavaResponse(
|
||||
del<JavaApiResponse<null>>(`${JAVA_API_PREFIX}/shop-data-crawl/tasks/${taskId}`, {
|
||||
params: { user_id: getCurrentUserId() },
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
export function deleteShopDataCrawlHistory(resultId: number) {
|
||||
return unwrapJavaResponse(
|
||||
del<JavaApiResponse<null>>(`${JAVA_API_PREFIX}/shop-data-crawl/history/${resultId}`, {
|
||||
params: { user_id: getCurrentUserId() },
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
// ========== 取款 ==========
|
||||
|
||||
export type WithdrawCandidateVo = QueryAsinCandidateVo;
|
||||
@@ -3324,6 +3509,14 @@ export function getPublishHistory() {
|
||||
);
|
||||
}
|
||||
|
||||
export function deletePublishTask(taskId: number) {
|
||||
return unwrapJavaResponse(
|
||||
del<JavaApiResponse<null>>(`${JAVA_API_PREFIX}/publish/tasks/${taskId}`, {
|
||||
params: { user_id: getCurrentUserId() },
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
export function getJavaDownloadUrl(path: string) {
|
||||
let raw =
|
||||
path.startsWith("http://") || path.startsWith("https://")
|
||||
|
||||
Reference in New Issue
Block a user