mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 11:09:19 +08:00
feat: 新增拼读都类目管理
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* 拼多多平台类目(本地落库)API
|
||||
*/
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
import type { PddCatDTO, PddCatVO } from './types';
|
||||
|
||||
/** 触发全量同步 */
|
||||
export async function syncPddCatsApi() {
|
||||
return requestClient.post<void>('/channel/pdd/cat/sync');
|
||||
}
|
||||
|
||||
/** 同步状态 */
|
||||
export async function getPddCatSyncStatusApi() {
|
||||
return requestClient.get<PddCatVO.SyncStatus>('/channel/pdd/cat/sync/status');
|
||||
}
|
||||
|
||||
/** 子类目列表(懒加载树) */
|
||||
export async function listPddCatChildrenApi(data: PddCatDTO.ChildrenQuery) {
|
||||
return requestClient.post<PddCatVO.Cat[]>('/channel/pdd/cat/children', data);
|
||||
}
|
||||
|
||||
/** 按名称/路径搜索(跨层级) */
|
||||
export async function searchPddCatsApi(data: PddCatDTO.SearchQuery) {
|
||||
return requestClient.post<PddCatVO.Cat[]>('/channel/pdd/cat/search', data);
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
export * from './apis';
|
||||
export type * from './types';
|
||||
@@ -0,0 +1,40 @@
|
||||
/** 拼多多类目 DTO / VO */
|
||||
|
||||
export namespace PddCatDTO {
|
||||
export interface ChildrenQuery {
|
||||
/** 父类目;0 或省略为顶级 */
|
||||
parentCatId?: number;
|
||||
}
|
||||
|
||||
export interface SearchQuery {
|
||||
keyword: string;
|
||||
/** 默认 true:仅叶子(可发布) */
|
||||
leafOnly?: boolean;
|
||||
/** 默认 50,最大 100 */
|
||||
limit?: number;
|
||||
}
|
||||
}
|
||||
|
||||
export namespace PddCatVO {
|
||||
export interface Cat {
|
||||
catId: number;
|
||||
parentCatId?: number;
|
||||
catName?: string;
|
||||
level?: number;
|
||||
leaf?: boolean;
|
||||
/** 如 1/23/456 */
|
||||
pathIds?: string;
|
||||
/** 如 洗护/纸品/抽纸 */
|
||||
pathNames?: string;
|
||||
lastSyncTime?: string;
|
||||
}
|
||||
|
||||
export interface SyncStatus {
|
||||
status?: 'IDLE' | 'RUNNING' | 'SUCCESS' | 'FAILED' | string;
|
||||
startedAt?: string | null;
|
||||
finishedAt?: string | null;
|
||||
lastError?: string | null;
|
||||
syncedCount?: number | null;
|
||||
message?: string | null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user