diff --git a/apps/server/docs/pdd/api-docs/goods/pdd.goods.add商品新增接口.md b/apps/server/docs/pdd/api-docs/goods/pdd.goods.add商品新增接口.md index 24b338e6..c281fb56 100644 --- a/apps/server/docs/pdd/api-docs/goods/pdd.goods.add商品新增接口.md +++ b/apps/server/docs/pdd/api-docs/goods/pdd.goods.add商品新增接口.md @@ -14,6 +14,11 @@ API文档/商品API/pdd.goods.add 单个商品发布,需要配合pdd.goods.img.upload上传主图及商品详情图片。 +> **与本系统 `PddGoodsPublishDTO` 对照**(勿与轮播混淆) +> - `carousel_gallery` → `carouselImages`(商品轮播图,1:1,必填) +> - `detail_gallery` → `detailImages`(商品详情图,必填) +> - `image_url` → `imageUrl`(**商品主图**,首页大图 750×352,非必填;部分活动必填) + ### 公共参数 diff --git a/apps/server/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/model/dto/publish/PddGoodsPublishDTO.java b/apps/server/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/model/dto/publish/PddGoodsPublishDTO.java index 6b7171c6..9a51ae60 100644 --- a/apps/server/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/model/dto/publish/PddGoodsPublishDTO.java +++ b/apps/server/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/model/dto/publish/PddGoodsPublishDTO.java @@ -63,15 +63,24 @@ public class PddGoodsPublishDTO { @Max(value = 100, message = "满两件折扣范围为0-100") private Integer twoPiecesDiscount = 95; - /** 轮播图:本系统 fileId,或已是拼多多 CDN 的 URL */ + /** + * 商品轮播图,对应开放平台 {@code carousel_gallery}(必填)。 + * 入参为本系统 fileId 或已转传的拼多多 CDN URL;规格见 pdd.goods.add 文档。 + */ @NotEmpty(message = "轮播图不能为空") private List carouselImages; - /** 详情图 */ + /** + * 商品详情图,对应开放平台 {@code detail_gallery}(必填)。 + * 入参为本系统 fileId 或已转传的 URL;规格见 pdd.goods.add 文档。 + */ @NotEmpty(message = "详情图不能为空") private List detailImages; - /** 活动主图(可选):fileId 或 URL */ + /** + * 商品主图,对应开放平台 {@code image_url}(非必填;参加部分活动则必填)。 + * 与轮播图不同:首页大图 750×352 等约束见 pdd.goods.add 文档。入参为 fileId 或 URL。 + */ private String imageUrl; /** 商品属性(类目模板非销售属性) */ diff --git a/apps/server/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/model/dto/publish/PddGoodsPublishSkuDTO.java b/apps/server/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/model/dto/publish/PddGoodsPublishSkuDTO.java index 79dbf4d8..31490855 100644 --- a/apps/server/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/model/dto/publish/PddGoodsPublishSkuDTO.java +++ b/apps/server/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/model/dto/publish/PddGoodsPublishSkuDTO.java @@ -37,7 +37,7 @@ public class PddGoodsPublishSkuDTO { @NotNull(message = "重量不能为空") private Long weight; - /** 缩略图:fileId 或 URL */ + /** SKU 缩略图,对应 sku_list.thumb_url(必填);fileId 或已转传 URL */ @NotBlank(message = "SKU缩略图不能为空") private String thumbImage; diff --git a/apps/server/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/service/impl/PddGoodsPublishServiceImpl.java b/apps/server/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/service/impl/PddGoodsPublishServiceImpl.java index c7859050..c09e08c9 100644 --- a/apps/server/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/service/impl/PddGoodsPublishServiceImpl.java +++ b/apps/server/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/goods/service/impl/PddGoodsPublishServiceImpl.java @@ -344,6 +344,7 @@ public class PddGoodsPublishServiceImpl implements PddGoodsPublishService { /** * 组装 POP 商品命令。strict=true 走发布强校验;false 仅要求能组包,缺图/SKU 交给平台报错。 + * 图片:carouselImages/detailImages/imageUrl 分别映射 carousel_gallery、detail_gallery、image_url(商品主图)。 */ private PddGoodsPublishPopApiClient.GoodsAddCommand assembleAddCommand( PddGoodsPublishDTO dto, Long companyId, ShopAuth ctx, boolean strict) throws Exception { diff --git a/apps/server/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/pop/goods/PddGoodsPublishPopApiClient.java b/apps/server/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/pop/goods/PddGoodsPublishPopApiClient.java index 10e55616..67641c31 100644 --- a/apps/server/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/pop/goods/PddGoodsPublishPopApiClient.java +++ b/apps/server/src/main/java/top/xyquan/ecomdmbbackend/modules/channel/pdd/pop/goods/PddGoodsPublishPopApiClient.java @@ -726,6 +726,11 @@ public class PddGoodsPublishPopApiClient { String specIdList, List skuProperties) { } + /** + * pdd.goods.add / 草稿提交共用上行;字段名与开放平台一致。 + * 与 {@link top.xyquan.ecomdmbbackend.modules.channel.pdd.goods.model.dto.publish.PddGoodsPublishDTO} + * 映射:carouselImages→carouselGallery,detailImages→detailGallery,imageUrl→imageUrl(商品主图)。 + */ public record GoodsAddCommand( String goodsName, String goodsDesc, diff --git a/apps/web/apps/web-antd/src/api/channel/pdd/goods/types/publish.ts b/apps/web/apps/web-antd/src/api/channel/pdd/goods/types/publish.ts index fddc467e..b27c77ab 100644 --- a/apps/web/apps/web-antd/src/api/channel/pdd/goods/types/publish.ts +++ b/apps/web/apps/web-antd/src/api/channel/pdd/goods/types/publish.ts @@ -2,7 +2,7 @@ export namespace PddGoodsPublishDTO { export interface Publish { pddShopId: number; - /** 关联系统草稿:发布成功后回写 goods_commit_id */ + /** 关联系统草稿 ID;正式发布成功后更新草稿状态并累加店铺发布次数 */ systemDraftId?: number; goodsName: string; goodsDesc?: string; @@ -16,9 +16,11 @@ export namespace PddGoodsPublishDTO { secondHand: boolean; /** 满2件折扣 0-100,默认 95 */ twoPiecesDiscount: number; - /** fileId 字符串或已转传的 URL */ + /** 轮播图 carousel_gallery(必填);fileId 或已转传 URL,规格见 pdd.goods.add */ carouselImages: string[]; + /** 详情图 detail_gallery(必填);fileId 或已转传 URL */ detailImages: string[]; + /** 商品主图 image_url(可选,部分活动必填);与轮播图不同,750×352 等见 pdd.goods.add */ imageUrl?: string; goodsProperties?: GoodsProperty[]; skus: PublishSku[]; @@ -46,6 +48,7 @@ export namespace PddGoodsPublishDTO { multiPriceFen: number; quantity: number; weight: number; + /** SKU 缩略图 thumb_url(必填);fileId 或已转传 URL */ thumbImage: string; specIdList: string; isOnsale?: number;