绿洲ERP电商系统


新增产品信息

<p>[TOC]</p> <h5>简要描述</h5> <ul> <li>新增产品信息接口</li> </ul> <h4><strong>接口描述</strong></h4> <p>创建新产品信息,包含产品基础信息、价格、描述、轮播图、SKU 列表及 SKU 编码等。</p> <h5>请求URL</h5> <pre><code>http://localhost:48082/admin-api/erp/product/create</code></pre> <h5>请求方式</h5> <ul> <li>POST </li> </ul> <hr /> <h3><strong>请求参数说明</strong></h3> <h4><strong>请求数据结构</strong></h4> <pre><code class="language-json">{ &amp;quot;categoryId&amp;quot;: 89, &amp;quot;categoryName&amp;quot;: null, &amp;quot;prodCode&amp;quot;: &amp;quot;Round-Chandelier&amp;quot;, &amp;quot;barCode&amp;quot;: &amp;quot;12345678&amp;quot;, &amp;quot;name&amp;quot;: &amp;quot;大光明豪华吊灯&amp;quot;, &amp;quot;introductionType&amp;quot;: 10, &amp;quot;introductionUrl&amp;quot;: &amp;quot;http://.../image.png&amp;quot;, &amp;quot;sliderPicUrls&amp;quot;: [ &amp;quot;http://.../image1.png&amp;quot;, &amp;quot;http://.../image2.png&amp;quot; ], &amp;quot;purchasePrice&amp;quot;: 199.00, &amp;quot;salePrice&amp;quot;: 199.00, &amp;quot;minPrice&amp;quot;: 199.00, &amp;quot;description&amp;quot;: &amp;quot;&amp;lt;p&amp;gt;产品描述 HTML&amp;lt;/p&amp;gt;&amp;quot;, &amp;quot;sort&amp;quot;: 5, &amp;quot;status&amp;quot;: 1, &amp;quot;remark&amp;quot;: null, &amp;quot;skuList&amp;quot;: [ ... ] }</code></pre> <h4><strong>字段说明</strong></h4> <h5>1. 根字段</h5> <table> <thead> <tr> <th>字段名</th> <th>必填</th> <th>类型</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td>categoryId</td> <td>是</td> <td>整数</td> <td>分类 ID</td> </tr> <tr> <td>categoryName</td> <td>否</td> <td>字符串</td> <td>分类名称(通常无需填写,由系统关联)</td> </tr> <tr> <td>prodCode</td> <td>是</td> <td>字符串</td> <td>产品编码(唯一标识)</td> </tr> <tr> <td>barCode</td> <td>是</td> <td>字符串</td> <td>商品条形码</td> </tr> <tr> <td>name</td> <td>是</td> <td>字符串</td> <td>产品名称</td> </tr> <tr> <td>introductionType</td> <td>是</td> <td>整数</td> <td>介绍类型(示例为 <code>10</code>,需确认含义)</td> </tr> <tr> <td>introductionUrl</td> <td>是</td> <td>字符串</td> <td>主图 URL</td> </tr> <tr> <td>sliderPicUrls</td> <td>是</td> <td>字符串数组</td> <td>轮播图 URL 列表</td> </tr> <tr> <td>purchasePrice</td> <td>是</td> <td>数值</td> <td>采购价(保留 2 位小数)</td> </tr> <tr> <td>salePrice</td> <td>是</td> <td>数值</td> <td>销售价</td> </tr> <tr> <td>minPrice</td> <td>是</td> <td>数值</td> <td>最低价</td> </tr> <tr> <td>description</td> <td>是</td> <td>字符串</td> <td>产品描述(HTML 格式)</td> </tr> <tr> <td>sort</td> <td>否</td> <td>整数</td> <td>排序值(数值越大越靠前)</td> </tr> <tr> <td>status</td> <td>是</td> <td>整数</td> <td>状态(<code>1</code> 启用,<code>0</code> 停用)</td> </tr> <tr> <td>remark</td> <td>否</td> <td>字符串</td> <td>备注</td> </tr> <tr> <td>skuList</td> <td>是</td> <td>SKU 对象数组</td> <td>SKU 列表(结构见下文)</td> </tr> </tbody> </table> <hr /> <h5>2. <code>skuList</code> 数组(SKU 列表)</h5> <table> <thead> <tr> <th>字段名</th> <th>必填</th> <th>类型</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td>properties</td> <td>是</td> <td>属性对象数组</td> <td>SKU 属性组合(如尺寸、颜色)</td> </tr> <tr> <td>name</td> <td>是</td> <td>字符串</td> <td>SKU 名称(示例与产品名相同)</td> </tr> <tr> <td>price</td> <td>是</td> <td>数值</td> <td>SKU 价格</td> </tr> <tr> <td>marketPrice</td> <td>是</td> <td>数值</td> <td>市场价</td> </tr> <tr> <td>costPrice</td> <td>是</td> <td>数值</td> <td>成本价</td> </tr> <tr> <td>barCode</td> <td>是</td> <td>字符串</td> <td>SKU 条形码(可为空字符串)</td> </tr> <tr> <td>picUrl</td> <td>是</td> <td>字符串</td> <td>SKU 图片 URL</td> </tr> <tr> <td>sort</td> <td>是</td> <td>整数</td> <td>SKU 排序值</td> </tr> <tr> <td>skuCodeList</td> <td>是</td> <td>SKU编码对象数组</td> <td>SKU 编码列表(与门店关联)</td> </tr> </tbody> </table> <h6>2.1 <code>properties</code> 数组(属性组合)</h6> <table> <thead> <tr> <th>字段名</th> <th>必填</th> <th>类型</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td>propertyId</td> <td>是</td> <td>整数</td> <td>属性项 ID(如尺寸 ID)</td> </tr> <tr> <td>propertyName</td> <td>是</td> <td>字符串</td> <td>属性项名称(如“尺寸”)</td> </tr> <tr> <td>valueId</td> <td>是</td> <td>整数</td> <td>属性值 ID(如“72&#039;&#039;” ID)</td> </tr> <tr> <td>valueName</td> <td>是</td> <td>字符串</td> <td>属性值名称</td> </tr> </tbody> </table> <h6>2.2 <code>skuCodeList</code> 数组(SKU 编码列表)</h6> <table> <thead> <tr> <th>字段名</th> <th>必填</th> <th>类型</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td>productSkuCode</td> <td>是</td> <td>字符串</td> <td>SKU 编码(需唯一)</td> </tr> <tr> <td>storeId</td> <td>是</td> <td>字符串</td> <td>门店 ID</td> </tr> </tbody> </table> <hr /> <h3><strong>请求示例</strong></h3> <pre><code class="language-json">{ &amp;quot;categoryId&amp;quot;: 89, &amp;quot;prodCode&amp;quot;: &amp;quot;Round-Chandelier&amp;quot;, &amp;quot;barCode&amp;quot;: &amp;quot;12345678&amp;quot;, &amp;quot;name&amp;quot;: &amp;quot;大光明豪华吊灯&amp;quot;, &amp;quot;introductionType&amp;quot;: 10, &amp;quot;introductionUrl&amp;quot;: &amp;quot;http://.../image.png&amp;quot;, &amp;quot;sliderPicUrls&amp;quot;: [ &amp;quot;http://.../image1.png&amp;quot;, &amp;quot;http://.../image2.png&amp;quot; ], &amp;quot;purchasePrice&amp;quot;: 199.00, &amp;quot;salePrice&amp;quot;: 199.00, &amp;quot;minPrice&amp;quot;: 199.00, &amp;quot;description&amp;quot;: &amp;quot;&amp;lt;p&amp;gt;产品描述 HTML&amp;lt;/p&amp;gt;&amp;quot;, &amp;quot;sort&amp;quot;: 5, &amp;quot;status&amp;quot;: 1, &amp;quot;skuList&amp;quot;: [ { &amp;quot;properties&amp;quot;: [ { &amp;quot;propertyId&amp;quot;: 2, &amp;quot;propertyName&amp;quot;: &amp;quot;尺寸&amp;quot;, &amp;quot;valueId&amp;quot;: 1, &amp;quot;valueName&amp;quot;: &amp;quot;72&amp;#039;&amp;#039;&amp;quot; }, { &amp;quot;propertyId&amp;quot;: 3, &amp;quot;propertyName&amp;quot;: &amp;quot;颜色&amp;quot;, &amp;quot;valueId&amp;quot;: 3, &amp;quot;valueName&amp;quot;: &amp;quot;漆面抛光黄铜&amp;quot; } ], &amp;quot;name&amp;quot;: &amp;quot;大光明豪华吊灯&amp;quot;, &amp;quot;price&amp;quot;: 199.00, &amp;quot;marketPrice&amp;quot;: 199.00, &amp;quot;costPrice&amp;quot;: 199.00, &amp;quot;barCode&amp;quot;: &amp;quot;&amp;quot;, &amp;quot;picUrl&amp;quot;: &amp;quot;http://.../image.png&amp;quot;, &amp;quot;sort&amp;quot;: 1, &amp;quot;skuCodeList&amp;quot;: [ { &amp;quot;productSkuCode&amp;quot;: &amp;quot;SKUCODE-10-1-001&amp;quot;, &amp;quot;storeId&amp;quot;: &amp;quot;1&amp;quot; } ] } ] }</code></pre> <hr /> <h3><strong>响应参数说明</strong></h3> <h4><strong>响应数据结构</strong></h4> <pre><code class="language-json">{ &amp;quot;code&amp;quot;: 0, &amp;quot;data&amp;quot;: { ... }, &amp;quot;msg&amp;quot;: &amp;quot;&amp;quot; }</code></pre> <h5>字段说明</h5> <table> <thead> <tr> <th>字段名</th> <th>类型</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td>code</td> <td>整数</td> <td>状态码(0 成功,其他为错误码)</td> </tr> <tr> <td>data</td> <td>对象</td> <td>新增产品完整信息(包含生成的 ID 等)</td> </tr> <tr> <td>msg</td> <td>字符串</td> <td>错误信息(成功时为空)</td> </tr> </tbody> </table> <hr /> <h3><strong>注意事项</strong></h3> <ol> <li><strong>必填字段</strong>:标注为“必填”的字段必须提供,否则接口可能返回错误。</li> <li><strong>SKU 唯一性</strong>:<code>productSkuCode</code> 需全局唯一,避免重复。</li> <li><strong>属性关联</strong>:<code>properties</code> 中的 <code>propertyId</code> 和 <code>valueId</code> 需与属性项、属性值接口中的数据一致。</li> <li><strong>价格精度</strong>:价格字段建议保留 2 位小数(示例中精度不一致需确认业务规则)。</li> <li><strong>图片 URL</strong>:确保 <code>introductionUrl</code> 和 <code>picUrl</code> 是有效的可访问地址。</li> <li><strong>空值处理</strong>:<code>categoryName</code>、<code>remark</code> 等字段可传 <code>null</code> 或空字符串。</li> </ol>

页面列表

ITEM_HTML