修复BUG,完善匹配店铺
This commit is contained in:
@@ -640,6 +640,10 @@ export interface ProductRiskTaskSummary {
|
||||
updatedAt?: string;
|
||||
finishedAt?: string;
|
||||
scheduledAt?: string;
|
||||
countryCodes?: string[];
|
||||
currentStageIndex?: number;
|
||||
activeStageIndex?: number;
|
||||
scheduleStages?: ShopMatchTaskStage[];
|
||||
}
|
||||
|
||||
export interface ProductRiskTaskDetailVo {
|
||||
@@ -671,6 +675,12 @@ export type ShopMatchTaskDetailVo = ProductRiskTaskDetailVo;
|
||||
export type ShopMatchTaskBatchVo = ProductRiskTaskBatchVo;
|
||||
export type ShopMatchCreateTaskVo = ProductRiskCreateTaskVo;
|
||||
|
||||
export interface ShopMatchTaskStage {
|
||||
stageIndex?: number;
|
||||
scheduledAt?: string;
|
||||
status?: string;
|
||||
}
|
||||
|
||||
export function getProductRiskDashboard() {
|
||||
return unwrapJavaResponse(
|
||||
get<JavaApiResponse<ProductRiskDashboardVo>>(
|
||||
@@ -851,16 +861,18 @@ export function deleteShopMatchHistory(resultId: number) {
|
||||
|
||||
export function createShopMatchTask(
|
||||
items: ShopMatchShopQueueItem[],
|
||||
scheduleTime?: string,
|
||||
countryCodes: string[],
|
||||
scheduleTimes?: string[],
|
||||
) {
|
||||
return unwrapJavaResponse(
|
||||
post<
|
||||
JavaApiResponse<ShopMatchCreateTaskVo>,
|
||||
{ user_id: number; items: ShopMatchShopQueueItem[]; schedule_time?: string }
|
||||
{ user_id: number; items: ShopMatchShopQueueItem[]; country_codes: string[]; schedule_times?: string[] }
|
||||
>(`${JAVA_API_PREFIX}/shop-match/tasks`, {
|
||||
user_id: getCurrentUserId(),
|
||||
items,
|
||||
schedule_time: scheduleTime,
|
||||
country_codes: countryCodes,
|
||||
schedule_times: scheduleTimes,
|
||||
}),
|
||||
);
|
||||
}
|
||||
@@ -873,15 +885,24 @@ export function deleteShopMatchTask(taskId: number) {
|
||||
);
|
||||
}
|
||||
|
||||
export function activateShopMatchTask(taskId: number) {
|
||||
export function activateShopMatchTask(taskId: number, stageIndex: number) {
|
||||
return unwrapJavaResponse(
|
||||
post<JavaApiResponse<null>, undefined>(
|
||||
`${JAVA_API_PREFIX}/shop-match/tasks/${taskId}/activate?user_id=${encodeURIComponent(String(getCurrentUserId()))}`,
|
||||
`${JAVA_API_PREFIX}/shop-match/tasks/${taskId}/activate?user_id=${encodeURIComponent(String(getCurrentUserId()))}&stage_index=${encodeURIComponent(String(stageIndex))}`,
|
||||
undefined,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
export function completeShopMatchTaskStage(taskId: number, stageIndex: number) {
|
||||
return unwrapJavaResponse(
|
||||
post<JavaApiResponse<null>, { stage_index: number }>(
|
||||
`${JAVA_API_PREFIX}/shop-match/tasks/${taskId}/stage-finished?user_id=${encodeURIComponent(String(getCurrentUserId()))}`,
|
||||
{ stage_index: stageIndex },
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
export function getShopMatchTasksBatch(taskIds: number[]) {
|
||||
return unwrapJavaResponse(
|
||||
post<JavaApiResponse<ShopMatchTaskBatchVo>, { taskIds: number[] }>(
|
||||
|
||||
Reference in New Issue
Block a user