feat: 拼多多商品发布(goods.add)及发布后详情入库绑定主商品

This commit is contained in:
2026-09-03 17:55:48 +08:00
parent 0ccc787165
commit 37b5610f27
33 changed files with 3594 additions and 2 deletions
@@ -2,7 +2,12 @@ import type { PageQueryDTO, PageResultVO } from '#/types/common';
import { requestClient } from '#/api/request';
import type { PddGoodsDTO, PddGoodsVO } from './types';
import type {
PddGoodsDTO,
PddGoodsPublishDTO,
PddGoodsPublishVO,
PddGoodsVO,
} from './types';
/** 分页查询拼多多渠道商品 */
export async function getPddGoodsPageApi(
@@ -30,3 +35,81 @@ export async function syncPddGoodsByShopApi(pddShopId: number) {
`/channel/pdd/goods/sync/${pddShopId}`,
);
}
/** 可发布类目 */
export async function listPddPublishCatsApi(
data: PddGoodsPublishDTO.ShopCatQuery,
) {
return requestClient.post<PddGoodsPublishVO.Cat[]>(
'/channel/pdd/goods/publish/meta/cats',
data,
);
}
/** 运费模板列表 */
export async function listPddPublishLogisticsApi(
data: PddGoodsPublishDTO.LogisticsQuery,
) {
return requestClient.post<PddGoodsPublishVO.LogisticsPage>(
'/channel/pdd/goods/publish/meta/logistics-templates',
data,
);
}
/** 运费模板详情 */
export async function getPddPublishLogisticsTemplateDetailApi(
data: PddGoodsPublishDTO.CostTemplateDetailQuery,
) {
return requestClient.post<PddGoodsPublishVO.CostTemplateDetail>(
'/channel/pdd/goods/publish/meta/logistics-template-detail',
data,
);
}
/** 类目属性模板 */
export async function getPddPublishCatTemplateApi(
data: PddGoodsPublishDTO.CatTemplateQuery,
) {
return requestClient.post<PddGoodsPublishVO.CatTemplate>(
'/channel/pdd/goods/publish/meta/cat-template',
data,
);
}
/** 父规格列表 */
export async function listPddPublishParentSpecsApi(
data: PddGoodsPublishDTO.SpecQuery,
) {
return requestClient.post<PddGoodsPublishVO.ParentSpec[]>(
'/channel/pdd/goods/publish/meta/specs',
data,
);
}
/** 生成规格 ID */
export async function createPddPublishSpecIdApi(
data: PddGoodsPublishDTO.SpecIdCreate,
) {
return requestClient.post<PddGoodsPublishVO.SpecId>(
'/channel/pdd/goods/publish/meta/spec-id',
data,
);
}
/** 本系统文件转传拼多多图 */
export async function transferPddPublishImageApi(
data: PddGoodsPublishDTO.TransferImage,
) {
return requestClient.post<PddGoodsPublishVO.TransferImageResult>(
'/channel/pdd/goods/publish/transfer-image',
data,
);
}
/** 发布商品并入库 */
export async function publishPddGoodsApi(data: PddGoodsPublishDTO.Publish) {
return requestClient.post<PddGoodsPublishVO.PublishResult>(
'/channel/pdd/goods/publish',
data,
);
}