后台管理跳过asin、后台相关数据做数据隔离
This commit is contained in:
@@ -972,9 +972,38 @@ export interface PriceTrackHistoryVo {
|
||||
|
||||
export interface PriceTrackCreateTaskVo {
|
||||
taskId: number;
|
||||
items: PriceTrackShopQueueItem[];
|
||||
items: PriceTrackHistoryItem[];
|
||||
}
|
||||
|
||||
export interface PriceTrackTaskSummary {
|
||||
id?: number;
|
||||
taskNo?: string;
|
||||
status?: string;
|
||||
errorMessage?: string;
|
||||
createdAt?: string;
|
||||
updatedAt?: string;
|
||||
finishedAt?: string;
|
||||
}
|
||||
|
||||
export interface PriceTrackTaskDetailVo {
|
||||
task?: PriceTrackTaskSummary;
|
||||
items?: PriceTrackHistoryItem[];
|
||||
}
|
||||
|
||||
export interface PriceTrackTaskBatchVo {
|
||||
items: PriceTrackTaskDetailVo[];
|
||||
missingTaskIds?: number[];
|
||||
}
|
||||
|
||||
export interface PriceTrackPendingDeleteVo {
|
||||
removed: boolean;
|
||||
}
|
||||
|
||||
export type PriceTrackCreateTaskPayload = Omit<
|
||||
PriceTrackCreateTaskRequest,
|
||||
"userId"
|
||||
>;
|
||||
|
||||
export function listPriceTrackCandidates() {
|
||||
return unwrapJavaResponse(
|
||||
get<JavaApiResponse<PriceTrackCandidateVo[]>>(
|
||||
@@ -985,9 +1014,9 @@ export function listPriceTrackCandidates() {
|
||||
|
||||
export function addPriceTrackCandidate(shopName: string) {
|
||||
return unwrapJavaResponse(
|
||||
post<JavaApiResponse<PriceTrackCandidateVo>, { user_id: number; shopName: string }>(
|
||||
post<JavaApiResponse<PriceTrackCandidateVo>, { userId: number; shopName: string }>(
|
||||
`${JAVA_API_PREFIX}/price-track/candidates`,
|
||||
{ user_id: getCurrentUserId(), shopName },
|
||||
{ userId: getCurrentUserId(), shopName },
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -1010,18 +1039,18 @@ export function getPriceTrackCountryPreference() {
|
||||
|
||||
export function putPriceTrackCountryPreference(countryCodes: string[]) {
|
||||
return unwrapJavaResponse(
|
||||
put<JavaApiResponse<PriceTrackCountryPreferenceVo>, { user_id: number; countryCodes: string[] }>(
|
||||
put<JavaApiResponse<PriceTrackCountryPreferenceVo>, { userId: number; countryCodes: string[] }>(
|
||||
`${JAVA_API_PREFIX}/price-track/country-preference`,
|
||||
{ user_id: getCurrentUserId(), countryCodes },
|
||||
{ userId: getCurrentUserId(), countryCodes },
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
export function matchPriceTrackShops(shopNames: string[]) {
|
||||
return unwrapJavaResponse(
|
||||
post<JavaApiResponse<PriceTrackMatchShopsVo>, { user_id: number; shopNames: string[] }>(
|
||||
post<JavaApiResponse<PriceTrackMatchShopsVo>, { userId: number; shopNames: string[] }>(
|
||||
`${JAVA_API_PREFIX}/price-track/match-shops`,
|
||||
{ user_id: getCurrentUserId(), shopNames },
|
||||
{ userId: getCurrentUserId(), shopNames },
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -1057,16 +1086,15 @@ export interface PriceTrackCreateTaskRequest {
|
||||
items: PriceTrackShopQueueItem[];
|
||||
asinFiles: string[];
|
||||
countryCodes: string[];
|
||||
minPrice?: number;
|
||||
maxPrice?: number;
|
||||
priceDiffPercent?: number;
|
||||
}
|
||||
|
||||
export function createPriceTrackTask(request: PriceTrackCreateTaskRequest) {
|
||||
export function createPriceTrackTask(
|
||||
request: PriceTrackCreateTaskPayload | PriceTrackCreateTaskRequest,
|
||||
) {
|
||||
return unwrapJavaResponse(
|
||||
post<JavaApiResponse<PriceTrackCreateTaskVo>, PriceTrackCreateTaskRequest>(
|
||||
`${JAVA_API_PREFIX}/price-track/tasks`,
|
||||
{ ...request, user_id: getCurrentUserId() },
|
||||
{ ...request, userId: getCurrentUserId() },
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -1079,13 +1107,22 @@ export function deletePriceTrackTask(taskId: number) {
|
||||
);
|
||||
}
|
||||
|
||||
export function getPriceTrackTasksBatch(taskIds: number[]) {
|
||||
return unwrapJavaResponse(
|
||||
post<JavaApiResponse<PriceTrackTaskBatchVo>, { taskIds: number[] }>(
|
||||
`${JAVA_API_PREFIX}/price-track/tasks/batch`,
|
||||
{ taskIds },
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
export function getPriceTrackResultDownloadUrl(resultId: number) {
|
||||
return getJavaDownloadUrl(`/price-track/results/${resultId}/download`);
|
||||
}
|
||||
|
||||
export function deletePendingPriceTrackShopResult(shopName: string) {
|
||||
return unwrapJavaResponse(
|
||||
del<JavaApiResponse<null>>(
|
||||
del<JavaApiResponse<PriceTrackPendingDeleteVo>>(
|
||||
`${JAVA_API_PREFIX}/price-track/pending-shop-result?user_id=${encodeURIComponent(String(getCurrentUserId()))}&shop_name=${encodeURIComponent(shopName)}`,
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user