文章列表
<p><strong>简要描述:</strong></p>
<ul>
<li>文章列表接口</li>
</ul>
<p><strong>请求URL:</strong></p>
<ul>
<li><code>/public/list</code></li>
</ul>
<p><strong>请求方式:</strong></p>
<ul>
<li>GET</li>
</ul>
<p><strong>参数:</strong></p>
<table>
<thead>
<tr>
<th>参数名</th>
<th>必选</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>type</td>
<td>是</td>
<td>String</td>
<td>0-普通列表,1-置顶列表</td>
</tr>
<tr>
<td>page</td>
<td>是</td>
<td>String</td>
<td>分页,从几页开始</td>
</tr>
<tr>
<td>limit</td>
<td>否</td>
<td>String</td>
<td>每页的数量,默认10</td>
</tr>
<tr>
<td>catalog</td>
<td>否</td>
<td>String</td>
<td>分类的名称,默认是’index’</td>
</tr>
<tr>
<td>sort</td>
<td>否</td>
<td>String</td>
<td>文章的排序 ,默认是’created’ 创建时间进行倒序排列,否则的话按照回复数量进行排列</td>
</tr>
<tr>
<td>status</td>
<td>否</td>
<td>String</td>
<td>文章的状态, ‘’-全部 ,0-未关闭,1-已结贴</td>
</tr>
</tbody>
</table>
<p><strong>返回示例</strong></p>
<pre><code> {
"code": 200,
"data": [
{
"tid": "1",
"title": "帖子的标题",
"catalog": "index",
"fav": "20",
"created": "2019-10-01 00:00:00",
"isEnd": "0",
"isTop": "0",
"sort": "0",
"answer": "0",
"status": "0",
"user": {
"id": "用户id",
"isVip": "0",
"name": "用户昵称",
"pic": "用户头像"
}
}
],
"msg": "服务端的消息"
}</code></pre>
<p><strong>返回参数说明</strong></p>
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>code</td>
<td>Number</td>
<td>200-成功,500-服务端返回的异常消息,取msg</td>
</tr>
<tr>
<td>data</td>
<td>Array</td>
<td>文章列表</td>
</tr>
<tr>
<td>msg</td>
<td>String</td>
<td>系统的消息数据</td>
</tr>
</tbody>
</table>
<p><code>data</code>中Array数据的示例:</p>
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>tid</td>
<td>ObjectId</td>
<td>这个默认产生的ObjectId(‘’),取的时候需要_id</td>
</tr>
<tr>
<td>uid</td>
<td>String</td>
<td>用户ID</td>
</tr>
<tr>
<td>title</td>
<td>String</td>
<td>文章标题</td>
</tr>
<tr>
<td>content</td>
<td>String</td>
<td>文章内容</td>
</tr>
<tr>
<td>created</td>
<td>Date</td>
<td>创建时间时间</td>
</tr>
<tr>
<td>catalog</td>
<td>String</td>
<td>帖子分类,index-全部,ask-提问, advise-建议, discuss-交流, share-分享, news-动态</td>
</tr>
<tr>
<td>fav</td>
<td>String</td>
<td>帖子积分</td>
</tr>
<tr>
<td>isEnd</td>
<td>String</td>
<td>0-未结束,1-已结贴</td>
</tr>
<tr>
<td>reads</td>
<td>Number</td>
<td>阅读记数</td>
</tr>
<tr>
<td>answer</td>
<td>Number</td>
<td>回答记数</td>
</tr>
<tr>
<td>status</td>
<td>String</td>
<td>0-打开回复,1-关闭回复</td>
</tr>
<tr>
<td>isTop</td>
<td>String</td>
<td>0-未置顶,1-已置顶</td>
</tr>
<tr>
<td>sort</td>
<td>String</td>
<td>置顶排序</td>
</tr>
<tr>
<td>tags</td>
<td>String</td>
<td>文章的标签, 精华,加精, etc</td>
</tr>
</tbody>
</table>
<p><code>user</code>对象:</p>
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>String</td>
<td>用户ID</td>
</tr>
<tr>
<td>name</td>
<td>String</td>
<td>用户昵称</td>
</tr>
<tr>
<td>isVip</td>
<td>String</td>
<td>是否是会员,0-普通用户, 1-会员</td>
</tr>
<tr>
<td>pic</td>
<td>String</td>
<td>用户头像</td>
</tr>
</tbody>
</table>
<p><strong>备注</strong></p>
<ul>
<li>更多返回错误代码请看首页的错误代码描述</li>
</ul>