狼行天下

狼行天下


向波-接口测试文档

<h2>提问数据初始化到elasticsearch</h2> <p><strong>接口:</strong><a href="http://localhost:9000/search/es/index/init">http://localhost:9000/search/es/index/init</a></p> <h5>正常调用</h5> <pre><code class="language-json">{     "msg": "初始化成功",     "code": 200 }</code></pre> <h5>异常调用</h5> <pre><code class="language-json">{     "msg": "已经初始化过, 请不要重复初始化",     "code": 200 }</code></pre> <h2>快速查询</h2> <p><strong>接口:</strong><a href="http://localhost:9000/search/q/fast/question/search?key">http://localhost:9000/search/q/fast/question/search?key</a>=</p> <h5>正常调用</h5> <pre><code class="language-json">{     "msg": "success",     "code": 200,     "data": [         {             "id": "a6e5653a7134e31de81933230bb387c0",             "title": "你好啊,埃及法老陵墓,你成都的",             "content": "&lt;p&gt;你**啊&lt;/p&gt;",             "viewNum": 0,             "thumbSupNum": 0,             "starNum": 0,             "replayNum": 0,             "state": 0,             "destId": 2,             "userId": 1,             "qualityScore": 0,             "createTime": "2023-01-11T08:03:38.000+00:00",             "updateTime": null,             "goodCommentId": null         }     ] }</code></pre> <h5>异常调用</h5> <pre><code class="language-json">{     "msg": "关键字为空,请确认后查询",     "code": 501 }</code></pre> <h2>快速查询</h2> <p><strong>接口:</strong><a href="http://localhost:9000/search/q/normal/question/search?key=成都&limit=10">http://localhost:9000/search/q/normal/question/search?key=成都&limit=10</a></p> <h5>正常调用</h5> <pre><code class="language-json">{     "msg": "success",     "code": 200,     "data": [         {             "id": "2",             "title": "怎么写看回答啊",             "content": "救救",             "viewNum": 0,             "thumbSupNum": 0,             "starNum": 0,             "replayNum": 0,             "state": 1,             "destId": 450,             "userId": 1,             "qualityScore": 20,             "createTime": "2023-01-11 08:03:38",             "updateTime": "2023-01-14 09:32:02",             "goodCommentId": "1",             "questionCommentDTO": {                 "id": "1",                 "questionId": "2",                 "userId": 2,                 "content": "我也不会啊",                 "state": 1,                 "thumbsupnum": 16351,                 "starnum": 321,                 "createTime": "2023-01-12T09:05:47.000+00:00",                 "updateTime": null,                 "question": {                     "id": "2",                     "title": "怎么写看回答啊",                     "content": "救救",                     "viewNum": 0,                     "thumbSupNum": 0,                     "starNum": 0,                     "replayNum": 0,                     "state": 1,                     "destId": 450,                     "userId": 1,                     "qualityScore": 20,                     "createTime": "2023-01-11 08:03:38",                     "updateTime": "2023-01-14 09:32:02",                     "goodCommentId": "1"                 },                 "headImgUrl": "/images/default.jpg",                 "nickName": "laoliu"             },             "destName": "成都"         },         {             "id": "1",             "title": "测试标题111111",             "content": "&lt;p&gt;测试内容成都&lt;/p&gt;",             "viewNum": 0,             "thumbSupNum": 0,             "starNum": 0,             "replayNum": 0,             "state": 1,             "destId": 450,             "userId": 1,             "qualityScore": 125,             "createTime": "2023-01-11 06:52:25",             "updateTime": "2023-01-12 16:03:54",             "goodCommentId": null,             "questionCommentDTO": null,             "destName": "成都"         }     ] }</code></pre> <h5>异常调用</h5> <pre><code class="language-json">{     "msg": "关键字为空,请确认后查询",     "code": 501 }</code></pre> <h2>管理端查询问题列表</h2> <p><strong>接口:</strong><a href="http://localhost:9000/wenda/question/list">http://localhost:9000/wenda/question/list</a></p> <h5>正常调用</h5> <pre><code class="language-json">{     "msg": "success",     "code": 200,     "data": [         {             "id": "1",             "title": "测试标题111111",             "content": "&lt;p&gt;测试内容成都&lt;/p&gt;",             "viewNum": 0,             "thumbSupNum": 0,             "starNum": 0,             "replayNum": 0,             "state": 1,             "destId": 450,             "userId": 1,             "qualityScore": 125,             "createTime": "2023-01-11 06:52:25",             "updateTime": "2023-01-12 16:03:54",             "goodCommentId": null,             "questionCommentDTO": null,             "destName": null,             "headUrl": "/images/default.jpg",             "nickName": "xiaoliu"         },         {             "id": "2",             "title": "怎么写看回答啊",             "content": "救救",             "viewNum": 0,             "thumbSupNum": 0,             "starNum": 0,             "replayNum": 0,             "state": 1,             "destId": 450,             "userId": 1,             "qualityScore": 20,             "createTime": "2023-01-11 08:03:38",             "updateTime": "2023-01-14 09:32:02",             "goodCommentId": "1",             "questionCommentDTO": null,             "destName": null,             "headUrl": "/images/default.jpg",             "nickName": "xiaoliu"         },         {             "id": "338c7b60d29b64f31cf8db46736cfbb4",             "title": "HelloWorld",             "content": "测试内容1",             "viewNum": 0,             "thumbSupNum": 0,             "starNum": 0,             "replayNum": 0,             "state": 1,             "destId": 2,             "userId": 1,             "qualityScore": 0,             "createTime": "2023-01-12 08:47:55",             "updateTime": "2023-01-12 09:32:09",             "goodCommentId": null,             "questionCommentDTO": null,             "destName": null,             "headUrl": "/images/default.jpg",             "nickName": "xiaoliu"         },         {             "id": "94f16740bb9c9f505b97de1c0129c504",             "title": "HelloWorld",             "content": "测试内容2",             "viewNum": 0,             "thumbSupNum": 0,             "starNum": 0,             "replayNum": 0,             "state": 1,             "destId": 2,             "userId": 8,             "qualityScore": 0,             "createTime": "2023-01-12 08:58:52",             "updateTime": null,             "goodCommentId": null,             "questionCommentDTO": null,             "destName": null,             "headUrl": "/images/header/ljy.jpg",             "nickName": "管理员"         },         {             "id": "97140c62628e73f4ba11290e1668e730",             "title": "11111111111111",             "content": "测试内容3",             "viewNum": 0,             "thumbSupNum": 0,             "starNum": 0,             "replayNum": 0,             "state": 1,             "destId": 2,             "userId": 8,             "qualityScore": 0,             "createTime": "2023-01-12 09:02:11",             "updateTime": null,             "goodCommentId": null,             "questionCommentDTO": null,             "destName": null,             "headUrl": "/images/header/ljy.jpg",             "nickName": "管理员"         },         {             "id": "d23035255d7e88bc708599788efe8cc4",             "title": "11111111111111",             "content": "测试内容44",             "viewNum": 0,             "thumbSupNum": 0,             "starNum": 0,             "replayNum": 0,             "state": 0,             "destId": 2,             "userId": 8,             "qualityScore": 0,             "createTime": "2023-01-12 09:11:11",             "updateTime": null,             "goodCommentId": null,             "questionCommentDTO": null,             "destName": null,             "headUrl": "/images/header/ljy.jpg",             "nickName": "管理员"         }     ] }</code></pre> <h2>删除问题</h2> <p><strong>接口:</strong><a href="http://localhost:9000/wenda/question/delete/{id">http://localhost:9000/wenda/question/delete/{id</a>}</p> <h5>正常调用</h5> <pre><code class="language-json">{     "msg": "success",     "code": 200,     "data": true }</code></pre> <h2>查看回答</h2> <p><strong>接口:</strong><a href="http://localhost:9000/wenda/question/find/comment?id">http://localhost:9000/wenda/question/find/comment?id</a>=</p> <h5>正常调用</h5> <pre><code class="language-json">{     "msg": "success",     "code": 200,     "data": [         {             "id": "2",             "questionId": "97140c62628e73f4ba11290e1668e730",             "userId": 8,             "content": "测试回答内容",             "state": 1,             "thumbsupnum": 1000,             "starnum": 100,             "createTime": "2023-01-02 17:37:14",             "updateTime": null,             "question": null,             "headImgUrl": "/images/header/ljy.jpg",             "nickName": "管理员"         },         {             "id": "3",             "questionId": "97140c62628e73f4ba11290e1668e730",             "userId": 2,             "content": "测试回答内容2222",             "state": 2,             "thumbsupnum": 200,             "starnum": 300,             "createTime": "2023-01-04 17:37:14",             "updateTime": null,             "question": null,             "headImgUrl": "/images/default.jpg",             "nickName": "laoliu"         }     ] }</code></pre> <h2>删除回答</h2> <p><strong>接口:</strong><a href="http://localhost:9000/wenda/questionsComment/delete?id=4">http://localhost:9000/wenda/questionsComment/delete?id=4</a></p> <h5>正常调用</h5> <pre><code class="language-json">{     "msg": "success",     "code": 200,     "data": true }</code></pre> <h2>攻略评论查询</h2> <p><strong>接口:</strong><a href="http://localhost:9000/cmt/strategies/comments/queryComment">http://localhost:9000/cmt/strategies/comments/queryComment</a></p> <h5>正常调用</h5> <pre><code class="language-json">{     "msg": "success",     "code": 200,     "data": {         "content": [             {                 "id": "63b2854f9daa3c19c74c9a29",                 "strategyId": 22,                 "strategyTitle": "测试1",                 "userId": 1,                 "nickname": "xiaoliu",                 "city": "成都",                 "level": 1000,                 "headImgUrl": "/images/default.jpg",                 "createTime": "2023-01-02 15:18:39",                 "content": "2222",                 "thumbupnum": 2,                 "thumbuplist": [                     1,                     8                 ]             },             {                 "id": "63b294959daa3c19c74c9a2a",                 "strategyId": 22,                 "strategyTitle": "测试1",                 "userId": 8,                 "nickname": "管理员",                 "city": null,                 "level": 0,                 "headImgUrl": "/images/header/ljy.jpg",                 "createTime": "2023-01-02 16:23:49",                 "content": "(愤怒小蜂)xxxx",                 "thumbupnum": 0,                 "thumbuplist": []             },             {                 "id": "63b2de25524e3d78bc0238af",                 "strategyId": 22,                 "strategyTitle": "测试1",                 "userId": 1,                 "nickname": "xiaoliu",                 "city": "成都",                 "level": 1000,                 "headImgUrl": "/images/default.jpg",                 "createTime": "2023-01-02 21:37:41",                 "content": "123",                 "thumbupnum": 0,                 "thumbuplist": []             },             {                 "id": "63be818d108c1216e12e5807",                 "strategyId": null,                 "strategyTitle": null,                 "userId": 1,                 "nickname": "xiaoliu",                 "city": "成都",                 "level": 1000,                 "headImgUrl": "/images/default.jpg",                 "createTime": "2023-01-11 17:29:49",                 "content": "*擦",                 "thumbupnum": 0,                 "thumbuplist": []             },             {                 "id": "63bfa5650392e52507ffe5d6",                 "strategyId": 11,                 "strategyTitle": "玩遍大北京!你绝不可错过的景点",                 "userId": 1,                 "nickname": "xiaoliu",                 "city": "成都",                 "level": 1000,                 "headImgUrl": "/images/default.jpg",                 "createTime": "2023-01-12 14:15:01",                 "content": "11",                 "thumbupnum": 0,                 "thumbuplist": []             },             {                 "id": "63bfa56d0392e52507ffe5d7",                 "strategyId": 11,                 "strategyTitle": "玩遍大北京!你绝不可错过的景点",                 "userId": 1,                 "nickname": "xiaoliu",                 "city": "成都",                 "level": 1000,                 "headImgUrl": "/images/default.jpg",                 "createTime": "2023-01-12 14:15:09",                 "content": "**",                 "thumbupnum": 0,                 "thumbuplist": []             },             {                 "id": "63bfa5ad0392e52507ffe5d8",                 "strategyId": 11,                 "strategyTitle": "玩遍大北京!你绝不可错过的景点",                 "userId": 1,                 "nickname": "xiaoliu",                 "city": "成都",                 "level": 1000,                 "headImgUrl": "/images/default.jpg",                 "createTime": "2023-01-12 14:16:13",                 "content": "**",                 "thumbupnum": 0,                 "thumbuplist": []             },             {                 "id": "63bfa6150392e52507ffe5d9",                 "strategyId": 11,                 "strategyTitle": "玩遍大北京!你绝不可错过的景点",                 "userId": 1,                 "nickname": "xiaoliu",                 "city": "成都",                 "level": 1000,                 "headImgUrl": "/images/default.jpg",                 "createTime": "2023-01-12 14:17:57",                 "content": "是吧1",                 "thumbupnum": 0,                 "thumbuplist": []             },             {                 "id": "63bfa68c0392e52507ffe5da",                 "strategyId": 14,                 "strategyTitle": "日本好吃不贵的排队美食大全!(含东京、大阪、京都)",                 "userId": 1,                 "nickname": "xiaoliu",                 "city": "成都",                 "level": 1000,                 "headImgUrl": "/images/default.jpg",                 "createTime": "2023-01-12 14:19:56",                 "content": "**",                 "thumbupnum": 0,                 "thumbuplist": []             },             {                 "id": "63bfa6970392e52507ffe5db",                 "strategyId": 14,                 "strategyTitle": "日本好吃不贵的排队美食大全!(含东京、大阪、京都)",                 "userId": 1,                 "nickname": "xiaoliu",                 "city": "成都",                 "level": 1000,                 "headImgUrl": "/images/default.jpg",                 "createTime": "2023-01-12 14:20:07",                 "content": "**",                 "thumbupnum": 0,                 "thumbuplist": []             }         ],         "pageable": {             "sort": {                 "sorted": false,                 "unsorted": true,                 "empty": true             },             "offset": 0,             "pageSize": 10,             "pageNumber": 0,             "unpaged": false,             "paged": true         },         "totalPages": 2,         "totalElements": 13,         "last": false,         "number": 0,         "size": 10,         "sort": {             "sorted": false,             "unsorted": true,             "empty": true         },         "numberOfElements": 10,         "first": true,         "empty": false     } }</code></pre> <h2>游记评论查询</h2> <p><strong>接口:</strong><a href="http://localhost:9000/cmt/travels/comments/queryComment">http://localhost:9000/cmt/travels/comments/queryComment</a></p> <pre><code class="language-json">{     "msg": "success",     "code": 200,     "data": {         "content": [             {                 "id": "63b2a08ace31847bced29da8",                 "travelId": 5,                 "travelTitle": "5月趣上海,非去不可",                 "userId": 1,                 "nickname": "xiaoliu",                 "city": "成都",                 "level": 1000,                 "headImgUrl": "/images/default.jpg",                 "type": 0,                 "createTime": "2023-01-02 17:14:50",                 "content": "123",                 "refComment": null             },             {                 "id": "63b2a0c2ce31847bced29da9",                 "travelId": 5,                 "travelTitle": "5月趣上海,非去不可",                 "userId": 1,                 "nickname": "xiaoliu",                 "city": "成都",                 "level": 1000,                 "headImgUrl": "/images/default.jpg",                 "type": 0,                 "createTime": "2023-01-02 17:15:46",                 "content": "&lt;img src=\"/images/emoji/brands_v3/40@2x.png\"style=\"width: width:28px;\"/&gt;测试评论2",                 "refComment": null             },             {                 "id": "63bd019ec15a1d6936eb35f1",                 "travelId": 2,                 "travelTitle": "每年都会有的广州情节",                 "userId": 1,                 "nickname": "xiaoliu",                 "city": "成都",                 "level": 1000,                 "headImgUrl": "/images/default.jpg",                 "type": 0,                 "createTime": "2023-01-10 14:11:42",                 "content": "111",                 "refComment": null             },             {                 "id": "63bd019ec15a1d6936eb35f2",                 "travelId": 2,                 "travelTitle": "每年都会有的广州情节",                 "userId": 1,                 "nickname": "xiaoliu",                 "city": "成都",                 "level": 1000,                 "headImgUrl": "/images/default.jpg",                 "type": 0,                 "createTime": "2023-01-10 14:11:42",                 "content": "111",                 "refComment": null             },             {                 "id": "63bd01a2c15a1d6936eb35f3",                 "travelId": 2,                 "travelTitle": "每年都会有的广州情节",                 "userId": 1,                 "nickname": "xiaoliu",                 "city": "成都",                 "level": 1000,                 "headImgUrl": "/images/default.jpg",                 "type": 0,                 "createTime": "2023-01-10 14:11:46",                 "content": "22",                 "refComment": null             }         ],         "pageable": {             "sort": {                 "sorted": false,                 "unsorted": true,                 "empty": true             },             "offset": 0,             "pageSize": 5,             "pageNumber": 0,             "unpaged": false,             "paged": true         },         "totalPages": 3,         "totalElements": 14,         "last": false,         "number": 0,         "size": 5,         "sort": {             "sorted": false,             "unsorted": true,             "empty": true         },         "numberOfElements": 5,         "first": true,         "empty": false     } }</code></pre>

页面列表

ITEM_HTML