feat: 新增拼多多店铺管理和商品管理

This commit is contained in:
2026-08-15 10:52:38 +08:00
parent 2dda6a2d30
commit 949c5dcf0c
28 changed files with 1546 additions and 50 deletions
@@ -0,0 +1,32 @@
import type { PageQueryDTO, PageResultVO } from '#/types/common';
import { requestClient } from '#/api/request';
import type { PddGoodsDTO, PddGoodsVO } from './types';
/** 分页查询拼多多渠道商品 */
export async function getPddGoodsPageApi(
params: PageQueryDTO<PddGoodsDTO.Filters>,
) {
return requestClient.post<PageResultVO<PddGoodsVO.Info>>(
'/channel/pdd/goods/list',
params,
);
}
/** 拼多多商品详情(含 SKU) */
export async function getPddGoodsDetailApi(id: number) {
return requestClient.get<PddGoodsVO.Info>(`/channel/pdd/goods/detail/${id}`);
}
/** 删除拼多多商品及 SKU */
export async function deletePddGoodsApi(id: number) {
return requestClient.delete<void>(`/channel/pdd/goods/delete/${id}`);
}
/** 按渠道店铺同步商品 */
export async function syncPddGoodsByShopApi(pddShopId: number) {
return requestClient.post<PddGoodsVO.SyncResult>(
`/channel/pdd/goods/sync/${pddShopId}`,
);
}
@@ -0,0 +1,2 @@
export * from './apis';
export * from './types';
@@ -0,0 +1,59 @@
export namespace PddGoodsDTO {
export interface Filters {
/** 渠道店铺ID(channel_pdd_shop.id) */
shopId?: number;
mallId?: number;
goodsName?: string;
goodsId?: string;
/** 0否 1是 */
isOnsale?: number;
/** 0否 1是 */
isMoreSku?: number;
}
}
export namespace PddGoodsVO {
export interface Sku {
id?: number;
goodsRowId?: number;
goodsId?: string;
skuId?: string;
spec?: string;
specDetails?: string;
skuQuantity?: number;
reserveQuantity?: number;
isSkuOnsale?: number;
outerGoodsId?: string;
outerId?: string;
}
export interface Info {
id: number;
companyId?: number;
shopId?: number;
mallId?: number;
goodsId?: string;
goodsName?: string;
goodsQuantity?: number;
goodsReserveQuantity?: number;
imageUrl?: string;
thumbUrl?: string;
isMoreSku?: number;
isOnsale?: number;
pddCreatedAt?: string;
lastSyncTime?: string;
createTime?: string;
updateTime?: string;
skus?: Sku[];
}
export interface SyncResult {
pddShopId: number;
mallId?: number;
syncedCount?: number;
createdCount?: number;
updatedCount?: number;
skuCount?: number;
pageCount?: number;
}
}
@@ -1,10 +1,20 @@
import type { PddShopInfo } from '#/api/ec/shop/types';
import type { PageQueryDTO, PageResultVO } from '#/types/common';
import { requestClient } from '#/api/request';
/**
* 拼多多渠道店铺详情(含授权信息,不含 token)
*/
import type { PddShopDTO, PddShopVO } from './types';
/** 分页查询拼多多渠道店铺 */
export async function getPddShopPageApi(
params: PageQueryDTO<PddShopDTO.Filters>,
) {
return requestClient.post<PageResultVO<PddShopVO.Info>>(
'/channel/pdd/shop/list',
params,
);
}
/** 拼多多渠道店铺详情(含授权信息,不含 token) */
export async function getPddShopDetailApi(id: number) {
return requestClient.get<PddShopInfo>(`/channel/pdd/shop/detail/${id}`);
return requestClient.get<PddShopVO.Info>(`/channel/pdd/shop/detail/${id}`);
}
@@ -1 +1,2 @@
export * from './apis';
export * from './types';
@@ -0,0 +1,39 @@
export namespace PddShopDTO {
export interface Filters {
mallName?: string;
merchantType?: number;
mallCharacter?: number;
pddAuthId?: number;
}
}
export namespace PddShopVO {
export interface AuthInfo {
id: number;
companyId?: number;
ownerId?: string;
expiresAt?: string;
refreshTokenExpiresAt?: string;
scope?: string;
/** 0失效 1正常 2已撤销 */
status?: number;
createTime?: string;
updateTime?: string;
}
export interface Info {
id: number;
companyId?: number;
pddAuthId?: null | number;
auth?: AuthInfo | null;
mallId?: number;
mallName?: string;
logo?: string;
mallDesc?: string;
merchantType?: number;
mallCharacter?: number;
lastSyncTime?: string;
createTime?: string;
updateTime?: string;
}
}