狼行天下

狼行天下


王梦林-接口测试文档

<h1><center>游记模块</center></h1> <h2>游记新增,编辑接口测试</h2> <p><strong>接口:</strong> <a href="http://localhost:9000/article/travel/saveOrUpdate">http://localhost:9000/article/travel/saveOrUpdate</a></p> <h5>正常调用</h5> <pre><code>{     "msg": "success",     "code": 200,     "data": 53 }</code></pre> <h5>异常调用</h5> <p>参数校验异常</p> <pre><code>{     "msg": "XX不能为空",     "code": 400 }</code></pre> <p>用户认证异常</p> <pre><code>{     "msg": "用户尚未登录",     "code": 401 }</code></pre> <p>时间转换异常</p> <pre><code>{     "msg": "Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date' for property 'travelTime'; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type \[java.lang.String\] to type \[@org.springframework.format.annotation.DateTimeFormat java.util.Date\] for value '2020/12/10'; nested exception is java.lang.IllegalArgumentException: Parse attempt failed for value \[2020/12/10\]",     "code": 400 }</code></pre> <p>目的地不存在</p> <pre><code>{     "msg": "目的地不存在,重新选择",     "code": 501 }</code></pre> <h2>游记封面上传</h2> <p><strong>接口:</strong> <a href="http://localhost:9000/article/travls/uploadImg">http://localhost:9000/article/travls/uploadImg</a></p> <h5>正常调用</h5> <pre><code>{ "msg": null, "fileName": "0c1566f42b440926d4de21c25ef7e042.png", "code": 200, "uploaded": 1, "url": "https://cmh-fdb.oss-cn-chengdu.aliyuncs.com/images/2cdb4a1511ec4220a65313bbbc51d2f1.png" }</code></pre> <h5>参数校验异常</h5> <p>{     &quot;msg&quot;: &quot;图片文件不能为空&quot;,     &quot;code&quot;: 400 }</p> <h2>游记查询</h2> <p><strong>接口:</strong> <a href="http://localhost:9000/article/travls/query">http://localhost:9000/article/travls/query</a></p> <h5>正常调用</h5> <pre><code>{     "msg": "success",     "code": 200,     "data": {         "records": \[             {                 "id": 2,                 "destId": 355,                 "destName": "广州",                 "authorId": 1,                 "author": {                     "id": 1,                     "nickname": "xiaoliu",                     "phone": "13700000000",                     "email": "xiaoliu@wolfcode.cn",                     "gender": 1,                     "level": 1000,                     "city": "成都",                     "headImgUrl": "/images/default.jpg",                     "info": "成都最靓的仔",                     "state": 0                 },                 "title": "每年都会有的广州情节",                 "summary": "几乎每年都会去 广州 一趟,一般都是一两天,一个人逛。",                 "coverUrl": "/images/default/wKgEaVzD69aAV3wVAApzcYZfk6089.jpeg",                 "travelTime": "2019-04-27T23:39:00.000+00:00",                 "avgConsume": 100,                 "day": 1,                 "person": 2,                 "createTime": "2019-04-27T23:39:00.000+00:00",                 "releaseTime": null,                 "lastUpdateTime": "2020-12-07T17:14:49.000+00:00",                 "ispublic": 1,                 "viewnum": 762,                 "replynum": 212,                 "favornum": 17,                 "sharenum": 0,                 "thumbsupnum": 100,                 "state": 2,                 "content": null             }         \],         "total": 1,         "size": 10,         "current": 1,         "orders": \[\],         "optimizeCountSql": true,         "searchCount": true,         "countId": null,         "maxLimit": null,         "pages": 1     },     "isView": false }</code></pre> <h2>目的地编辑(简介)</h2> <p><strong>接口:</strong> <a href="http://localhost:9000/article/destinations/updateInfo">http://localhost:9000/article/destinations/updateInfo</a></p> <h5>正常调用</h5> <pre><code>{     "msg": null,     "code": 200 }</code></pre> <h5>异常调用</h5> <h5>参数校验异常</h5> <pre><code>{     "msg": "id不能为空",     "code": 400 }</code></pre> <h2>攻略主题推荐</h2> <p><strong>接口:</strong> <a href="http://localhost:9000/article/strategies/themeCds">http://localhost:9000/article/strategies/themeCds</a></p> <h5>正常调用</h5> <pre><code>{     "msg": "success",     "code": 200,     "data": [         {             "themeName": "摄影",             "dests": [                 {                     "id": 21,                     "name": "北京"                 }             ]         },         {             "themeName": "美食",             "dests": [                 {                     "id": 355,                     "name": "广州"                 },                 {                     "id": 29,                     "name": "上海"                 },                 {                     "id": 87,                     "name": "东京"                 }             ]         },         {             "themeName": "旅行主义",             "dests": [                 {                     "id": 242,                     "name": "杭州"                 },                 {                     "id": 59,                     "name": "纽约"                 },                 {                     "id": 2,                     "name": "埃及"                 }             ]         },         {             "themeName": "观赏",             "dests": [                 {                     "id": 2,                     "name": "埃及"                 }             ]         },         {             "themeName": "文化",             "dests": [                 {                     "id": 355,                     "name": "广州"                 },                 {                     "id": 29,                     "name": "上海"                 }             ]         },         {             "themeName": "建筑",             "dests": [                 {                     "id": 16,                     "name": "泰国"                 }             ]         },         {             "themeName": "家庭",             "dests": [                 {                     "id": 450,                     "name": "成都"                 }             ]         },         {             "themeName": "节庆",             "dests": [                 {                     "id": 2,                     "name": "埃及"                 }             ]         },         {             "themeName": "户外",             "dests": [                 {                     "id": 355,                     "name": "广州"                 }             ]         },         {             "themeName": "购物",             "dests": [                 {                     "id": 29,                     "name": "上海"                 }             ]         }     ] }</code></pre> <h2>游记评论动态最新前十</h2> <p><strong>接口:</strong> <a href="http://localhost:9000/cmt/travels/comments/travelNodes">http://localhost:9000/cmt/travels/comments/travelNodes</a></p> <h5>正常调用</h5> <pre><code>{     "msg": "success",     "code": 200,     "data": [         {             "id": "63bf7ddd4feac4071256322c",             "travelId": 2,             "travelTitle": "每年都会有的广州情节",             "userId": 1,             "nickname": "xiaoliu",             "city": "成都",             "level": 1000,             "headImgUrl": "/images/default.jpg",             "type": 0,             "createTime": "2023-01-12 11:26:21",             "content": "我擦",             "refComment": null         },         {             "id": "63bf7d544feac4071256322b",             "travelId": null,             "travelTitle": null,             "userId": 1,             "nickname": "xiaoliu",             "city": "成都",             "level": 1000,             "headImgUrl": "/images/default.jpg",             "type": 0,             "createTime": "2023-01-12 11:24:04",             "content": "我擦",             "refComment": null         },         {             "id": "63bd07bac15a1d6936eb35f5",             "travelId": 16,             "travelTitle": "游走在《请回答1988》的韩国|首尔、议政府、仁川的寻寻觅觅",             "userId": 1,             "nickname": "xiaoliu",             "city": "成都",             "level": 1000,             "headImgUrl": "/images/default.jpg",             "type": 0,             "createTime": "2023-01-10 14:37:46",             "content": "11",             "refComment": null         },         {             "id": "63bd01a6c15a1d6936eb35f4",             "travelId": 2,             "travelTitle": "每年都会有的广州情节",             "userId": 1,             "nickname": "xiaoliu",             "city": "成都",             "level": 1000,             "headImgUrl": "/images/default.jpg",             "type": 1,             "createTime": "2023-01-10 14:11:50",             "content": "33",             "refComment": {                 "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             }         },         {             "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         },         {             "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": "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": "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": "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         }     ] }</code></pre>

页面列表

ITEM_HTML