商品列表路由
<h5>接口描述</h5>
<ul>
<li>商品列表模板</li>
</ul>
<h5>请求URL</h5>
<ul>
<li><code>/api/goods</code></li>
</ul>
<h5>请求方式</h5>
<ul>
<li>GET</li>
</ul>
<h5>Query 请求参数</h5>
<p>|参数名|必选|类型|说明|
|:---- |:---|:----- |----- |
|title |是 |string |标题 |
|category_id |是 |string |分类 |
|sales |是 |string |销量 默认1 |
|price |是 |string |价格 1 |
|comments_count |是 |string |评论数 1 |</p>
<h5>返回示例</h5>
<ul>
<li>状态码 200 请求成功</li>
</ul>
<pre><code>{
&quot;goods&quot;: {
&quot;current_page&quot;: 1,
&quot;data&quot;: [
{
&quot;id&quot;: 1,
&quot;title&quot;: &quot;Minus rerum eaque.&quot;,
&quot;price&quot;: 1180,
&quot;cover&quot;: &quot;https://picsum.photos/640/480&quot;,
&quot;category_id&quot;: 14,
&quot;sales&quot;: 0,
&quot;updated_at&quot;: &quot;2024-04-03T12:56:35.000000Z&quot;,
&quot;comments_count&quot;: 0,
&quot;cover_url&quot;: &quot;https://picsum.photos/640/480&quot;
}
],
&quot;first_page_url&quot;: &quot;http://api.test/api/goods?title=Minus&amp;category_id=14&amp;sales=1&amp;price=1&amp;comments_count=1&amp;page=1&quot;,
&quot;from&quot;: 1,
&quot;next_page_url&quot;: null,
&quot;path&quot;: &quot;http://api.test/api/goods&quot;,
&quot;per_page&quot;: 20,
&quot;prev_page_url&quot;: null,
&quot;to&quot;: 1
},
&quot;recommend_goods&quot;: [
{
&quot;id&quot;: 50,
&quot;title&quot;: &quot;Tenetur sunt vero.&quot;,
&quot;price&quot;: 80698,
&quot;cover&quot;: &quot;https://picsum.photos/640/480&quot;,
&quot;comments_count&quot;: 0,
&quot;cover_url&quot;: &quot;https://picsum.photos/640/480&quot;
},
{
&quot;id&quot;: 90,
&quot;title&quot;: &quot;Et odit debitis.&quot;,
&quot;price&quot;: 57820,
&quot;cover&quot;: &quot;https://picsum.photos/640/480&quot;,
&quot;comments_count&quot;: 0,
&quot;cover_url&quot;: &quot;https://picsum.photos/640/480&quot;
},
{
&quot;id&quot;: 89,
&quot;title&quot;: &quot;Autem molestiae.&quot;,
&quot;price&quot;: 53862,
&quot;cover&quot;: &quot;https://picsum.photos/640/480&quot;,
&quot;comments_count&quot;: 0,
&quot;cover_url&quot;: &quot;https://picsum.photos/640/480&quot;
},
{
&quot;id&quot;: 34,
&quot;title&quot;: &quot;Laborum harum nam.&quot;,
&quot;price&quot;: 60591,
&quot;cover&quot;: &quot;https://picsum.photos/640/480&quot;,
&quot;comments_count&quot;: 0,
&quot;cover_url&quot;: &quot;https://picsum.photos/640/480&quot;
},
{
&quot;id&quot;: 93,
&quot;title&quot;: &quot;Laborum asperiores.&quot;,
&quot;price&quot;: 56706,
&quot;cover&quot;: &quot;https://picsum.photos/640/480&quot;,
&quot;comments_count&quot;: 0,
&quot;cover_url&quot;: &quot;https://picsum.photos/640/480&quot;
},
{
&quot;id&quot;: 99,
&quot;title&quot;: &quot;Molestiae nobis.&quot;,
&quot;price&quot;: 67009,
&quot;cover&quot;: &quot;https://picsum.photos/640/480&quot;,
&quot;comments_count&quot;: 0,
&quot;cover_url&quot;: &quot;https://picsum.photos/640/480&quot;
},
{
&quot;id&quot;: 5,
&quot;title&quot;: &quot;Pariatur provident.&quot;,
&quot;price&quot;: 20117,
&quot;cover&quot;: &quot;https://picsum.photos/640/480&quot;,
&quot;comments_count&quot;: 0,
&quot;cover_url&quot;: &quot;https://picsum.photos/640/480&quot;
},
{
&quot;id&quot;: 68,
&quot;title&quot;: &quot;Perferendis.&quot;,
&quot;price&quot;: 64086,
&quot;cover&quot;: &quot;https://picsum.photos/640/480&quot;,
&quot;comments_count&quot;: 0,
&quot;cover_url&quot;: &quot;https://picsum.photos/640/480&quot;
},
{
&quot;id&quot;: 63,
&quot;title&quot;: &quot;Quas praesentium.&quot;,
&quot;price&quot;: 83222,
&quot;cover&quot;: &quot;https://picsum.photos/640/480&quot;,
&quot;comments_count&quot;: 0,
&quot;cover_url&quot;: &quot;https://picsum.photos/640/480&quot;
},
{
&quot;id&quot;: 32,
&quot;title&quot;: &quot;Aut corrupti autem.&quot;,
&quot;price&quot;: 90268,
&quot;cover&quot;: &quot;https://picsum.photos/640/480&quot;,
&quot;comments_count&quot;: 0,
&quot;cover_url&quot;: &quot;https://picsum.photos/640/480&quot;
}
],
&quot;categories&quot;: [
{
&quot;id&quot;: 1,
&quot;pid&quot;: 0,
&quot;level&quot;: 1,
&quot;name&quot;: &quot;电子数码&quot;,
&quot;status&quot;: 1,
&quot;children&quot;: [
{
&quot;id&quot;: 2,
&quot;pid&quot;: 1,
&quot;name&quot;: &quot;手机&quot;,
&quot;level&quot;: 2,
&quot;status&quot;: 1,
&quot;children&quot;: [
{
&quot;id&quot;: 3,
&quot;pid&quot;: 2,
&quot;name&quot;: &quot;华为&quot;,
&quot;level&quot;: 3,
&quot;status&quot;: 1
},
{
&quot;id&quot;: 4,
&quot;pid&quot;: 2,
&quot;name&quot;: &quot;小米&quot;,
&quot;level&quot;: 3,
&quot;status&quot;: 1
}
]
},
{
&quot;id&quot;: 5,
&quot;pid&quot;: 1,
&quot;name&quot;: &quot;电脑&quot;,
&quot;level&quot;: 2,
&quot;status&quot;: 1,
&quot;children&quot;: [
{
&quot;id&quot;: 6,
&quot;pid&quot;: 5,
&quot;name&quot;: &quot;联想&quot;,
&quot;level&quot;: 3,
&quot;status&quot;: 1
},
{
&quot;id&quot;: 7,
&quot;pid&quot;: 5,
&quot;name&quot;: &quot;戴尔&quot;,
&quot;level&quot;: 3,
&quot;status&quot;: 1
}
]
}
]
},
{
&quot;id&quot;: 8,
&quot;pid&quot;: 0,
&quot;level&quot;: 1,
&quot;name&quot;: &quot;服装衣帽&quot;,
&quot;status&quot;: 1,
&quot;children&quot;: [
{
&quot;id&quot;: 9,
&quot;pid&quot;: 8,
&quot;name&quot;: &quot;男装&quot;,
&quot;level&quot;: 2,
&quot;status&quot;: 1,
&quot;children&quot;: [
{
&quot;id&quot;: 10,
&quot;pid&quot;: 9,
&quot;name&quot;: &quot;海澜之家&quot;,
&quot;level&quot;: 3,
&quot;status&quot;: 1
},
{
&quot;id&quot;: 11,
&quot;pid&quot;: 9,
&quot;name&quot;: &quot;Nike&quot;,
&quot;level&quot;: 3,
&quot;status&quot;: 1
}
]
},
{
&quot;id&quot;: 12,
&quot;pid&quot;: 8,
&quot;name&quot;: &quot;女装&quot;,
&quot;level&quot;: 2,
&quot;status&quot;: 1,
&quot;children&quot;: [
{
&quot;id&quot;: 13,
&quot;pid&quot;: 12,
&quot;name&quot;: &quot;欧时力&quot;,
&quot;level&quot;: 3,
&quot;status&quot;: 1
},
{
&quot;id&quot;: 14,
&quot;pid&quot;: 12,
&quot;name&quot;: &quot;Only&quot;,
&quot;level&quot;: 3,
&quot;status&quot;: 1
}
]
}
]
}
]
}</code></pre>
<ul>
<li>
<p>状态码 200 成功</p>
</li>
<li>状态码 422 参数错误</li>
</ul>