shop-api


获取购物车列表

<p>[TOC]</p> <h5>简要描述</h5> <ul> <li>获取购物车接口</li> </ul> <h5>请求URL</h5> <ul> <li><code>http://127.0.0.1:12345/front/api/cart/list/:id</code></li> </ul> <h5>请求方式</h5> <ul> <li>GET </li> </ul> <h5>参数</h5> <table> <thead> <tr> <th style="text-align: left;">参数名</th> <th style="text-align: left;">类型</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">Authorization</td> <td style="text-align: left;">string</td> <td>登录后的令牌</td> </tr> </tbody> </table> <h5>参数</h5> <table> <thead> <tr> <th style="text-align: left;">参数名</th> <th style="text-align: left;">是否必选</th> <th>类型</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">id</td> <td style="text-align: left;">是</td> <td>string</td> <td>用户的id</td> </tr> </tbody> </table> <h5>返回示例</h5> <pre><code>{     &amp;quot;error_code&amp;quot;: 200,     &amp;quot;msg&amp;quot;: &amp;quot;获取购物车数据成功!&amp;quot;,     &amp;quot;data&amp;quot;: {         &amp;quot;carts&amp;quot;: [             {                 &amp;quot;_id&amp;quot;: &amp;quot;6479a00aefb9826565790bbd&amp;quot;,                 &amp;quot;goodsId&amp;quot;: &amp;quot;64798a3c7ac38c31d6196bd1&amp;quot;,                 &amp;quot;num&amp;quot;: 1,                 &amp;quot;userId&amp;quot;: &amp;quot;647853c119ec939866488c3e&amp;quot;,                 &amp;quot;__v&amp;quot;: 0,                 &amp;quot;goods&amp;quot;: {                     &amp;quot;_id&amp;quot;: &amp;quot;64798a3c7ac38c31d6196bd1&amp;quot;,                     &amp;quot;goodsname&amp;quot;: &amp;quot;82年拉菲&amp;quot;,                     &amp;quot;price&amp;quot;: 500,                     &amp;quot;spec&amp;quot;: &amp;quot;500ml&amp;quot;,                     &amp;quot;goodsimg&amp;quot;: &amp;quot;/uploads/1685686844842.jpg&amp;quot;,                     &amp;quot;cat&amp;quot;: &amp;quot;6479867ca959208341233c2d&amp;quot;,                     &amp;quot;__v&amp;quot;: 0                 }             },             {                 &amp;quot;_id&amp;quot;: &amp;quot;6479a147efb9826565790bc0&amp;quot;,                 &amp;quot;goodsId&amp;quot;: &amp;quot;647995a92a1d623246e6920a&amp;quot;,                 &amp;quot;num&amp;quot;: 12,                 &amp;quot;userId&amp;quot;: &amp;quot;647853c119ec939866488c3e&amp;quot;,                 &amp;quot;__v&amp;quot;: 0,                 &amp;quot;goods&amp;quot;: {                     &amp;quot;_id&amp;quot;: &amp;quot;647995a92a1d623246e6920a&amp;quot;,                     &amp;quot;goodsname&amp;quot;: &amp;quot;布娃娃&amp;quot;,                     &amp;quot;price&amp;quot;: 99,                     &amp;quot;spec&amp;quot;: &amp;quot;50cm*40cm&amp;quot;,                     &amp;quot;goodsimg&amp;quot;: &amp;quot;/uploads/1685689769566.jpg&amp;quot;,                     &amp;quot;cat&amp;quot;: &amp;quot;647986bba959208341233c2f&amp;quot;,                     &amp;quot;__v&amp;quot;: 0                 }             }         ]     } }</code></pre> <h5>返回参数说明</h5> <table> <thead> <tr> <th style="text-align: left;">参数名</th> <th style="text-align: left;">类型</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">error_code</td> <td style="text-align: left;">int</td> <td>状态,200:成功;非200:失败</td> </tr> <tr> <td style="text-align: left;">msg</td> <td style="text-align: left;">string</td> <td>状态描述</td> </tr> <tr> <td style="text-align: left;">data</td> <td style="text-align: left;">object</td> <td>响应的数据</td> </tr> </tbody> </table> <h5>备注</h5> <ul> <li>更多返回错误代码请看首页的错误代码描述</li> </ul>

页面列表

ITEM_HTML