蒋炜-接口测试文档
<p>[TOC]</p>
<h2><center>问答模块</center></h2>
<h5>热门数据接口测试</h5>
<p>接口:<a href="http://localhost:9000/wenda/question/hotqustion">http://localhost:9000/wenda/question/hotqustion</a></p>
<h5>正常调用</h5>
<pre><code> {
"msg": "success",
"code": 200,
"data": [
{
"id": "1",
"title": "测试标题111111",
"content": "<p>测试内容成都</p>",
"viewnum": 12,
"thumbsupnum": 11,
"starnum": 13,
"replynum": 14,
"state": 1,
"destId": 450,
"userId": 1,
"qualityScore": 125,
"createTime": "2023-01-11 14:52:25",
"updateTime": "2023-01-13 00:03:54",
"goodCommentId": null,
"headImgUrl": null,
"nickName": null,
"destName": "成都"
},
{
"id": "2",
"title": "怎么写看回答啊",
"content": "我也不会啊",
"viewnum": 12,
"thumbsupnum": 12,
"starnum": 12,
"replynum": 12,
"state": 1,
"destId": 450,
"userId": 1,
"qualityScore": 20,
"createTime": "2023-01-11 16:03:38",
"updateTime": "2023-01-14 17:32:02",
"goodCommentId": "1",
"headImgUrl": "/images/default.jpg",
"nickName": "xiaoliu",
"destName": "成都"
}
]
}</code></pre>
<h5>最新问题接口测试</h5>
<p>接口:<a href="http://localhost:9000/wenda/question/newest">http://localhost:9000/wenda/question/newest</a></p>
<h5>正常调用</h5>
<pre><code>{
"msg": "success",
"code": 200,
"data": [
{
"id": "97140c62628e73f4ba11290e1668e730",
"title": "11111111111111",
"content": "测试内容3",
"viewnum": 0,
"thumbsupnum": 0,
"starnum": 0,
"replynum": 0,
"state": 1,
"destId": 2,
"userId": 8,
"qualityScore": 0,
"createTime": "2023-01-12 17:02:11",
"updateTime": null,
"goodCommentId": null,
"headImgUrl": "/images/header/ljy.jpg",
"nickName": "管理员",
"destName": "埃及"
},
{
"id": "94f16740bb9c9f505b97de1c0129c504",
"title": "HelloWorld",
"content": "测试内容2",
"viewnum": 0,
"thumbsupnum": 0,
"starnum": 0,
"replynum": 0,
"state": 1,
"destId": 2,
"userId": 8,
"qualityScore": 0,
"createTime": "2023-01-12 16:58:52",
"updateTime": null,
"goodCommentId": null,
"headImgUrl": "/images/header/ljy.jpg",
"nickName": "管理员",
"destName": "埃及"
},
{
"id": "338c7b60d29b64f31cf8db46736cfbb4",
"title": "HelloWorld",
"content": "测试内容1",
"viewnum": 0,
"thumbsupnum": 0,
"starnum": 0,
"replynum": 0,
"state": 1,
"destId": 2,
"userId": 1,
"qualityScore": 0,
"createTime": "2023-01-12 16:47:55",
"updateTime": "2023-01-12 17:32:09",
"goodCommentId": null,
"headImgUrl": "/images/default.jpg",
"nickName": "xiaoliu",
"destName": "埃及"
},
{
"id": "2",
"title": "怎么写看回答啊",
"content": "我也不会啊",
"viewnum": 12,
"thumbsupnum": 12,
"starnum": 12,
"replynum": 12,
"state": 1,
"destId": 450,
"userId": 1,
"qualityScore": 20,
"createTime": "2023-01-11 16:03:38",
"updateTime": "2023-01-14 17:32:02",
"goodCommentId": "1",
"headImgUrl": "/images/default.jpg",
"nickName": "xiaoliu",
"destName": "成都"
},
{
"id": "1",
"title": "测试标题111111",
"content": "<p>测试内容成都</p>",
"viewnum": 12,
"thumbsupnum": 11,
"starnum": 13,
"replynum": 14,
"state": 1,
"destId": 450,
"userId": 1,
"qualityScore": 125,
"createTime": "2023-01-11 14:52:25",
"updateTime": "2023-01-13 00:03:54",
"goodCommentId": null,
"headImgUrl": null,
"nickName": null,
"destName": "成都"
}
]
}</code></pre>
<h5>待回答问题接口测试</h5>
<p>接口:<a href="http://localhost:9000/wenda/question/unanswered">http://localhost:9000/wenda/question/unanswered</a></p>
<h5>正常调用</h5>
<pre><code>{
"msg": "success",
"code": 200,
"data": [
{
"id": "338c7b60d29b64f31cf8db46736cfbb4",
"title": "HelloWorld",
"content": "测试内容1",
"viewnum": 0,
"thumbsupnum": 0,
"starnum": 0,
"replynum": 0,
"state": 1,
"destId": 2,
"userId": 1,
"qualityScore": 0,
"createTime": "2023-01-12 16:47:55",
"updateTime": "2023-01-12 17:32:09",
"goodCommentId": null,
"headImgUrl": "/images/default.jpg",
"nickName": "xiaoliu",
"destName": "埃及"
},
{
"id": "94f16740bb9c9f505b97de1c0129c504",
"title": "HelloWorld",
"content": "测试内容2",
"viewnum": 0,
"thumbsupnum": 0,
"starnum": 0,
"replynum": 0,
"state": 1,
"destId": 2,
"userId": 8,
"qualityScore": 0,
"createTime": "2023-01-12 16:58:52",
"updateTime": null,
"goodCommentId": null,
"headImgUrl": "/images/header/ljy.jpg",
"nickName": "管理员",
"destName": "埃及"
},
{
"id": "97140c62628e73f4ba11290e1668e730",
"title": "11111111111111",
"content": "测试内容3",
"viewnum": 0,
"thumbsupnum": 0,
"starnum": 0,
"replynum": 0,
"state": 1,
"destId": 2,
"userId": 8,
"qualityScore": 0,
"createTime": "2023-01-12 17:02:11",
"updateTime": null,
"goodCommentId": null,
"headImgUrl": "/images/header/ljy.jpg",
"nickName": "管理员",
"destName": "埃及"
}
]
}</code></pre>
<h5>敏感词测试</h5>
<p>接口:<a href="http://localhost:9000/sensitive/check">http://localhost:9000/sensitive/check</a></p>
<h5>正常调用</h5>
<pre><code>"code": 200,</code></pre>