畅二接口文档
API文档
by yiranblade
目录
缩写单词说明
| 缩写 |
说明 |
| re |
real 代表用户真实姓名 |
| info |
information 信息 |
| img |
images 图片 |
|
|
分类编码说明
| 一级分类编码 |
说明 |
二级分类编码说明 |
| 10241 |
数码电子 |
102411(手机)102412(电脑)102413(数码)102414(配件)102415(其它) |
| 10242 |
生活物品 |
102421(家电)102422(服饰)102423(箱包)102424(休闲娱乐)102425(运动健身)102426(其它) |
| 10243 |
租赁 |
|
| 10244 |
书籍教材 |
102441(考研)102442(4/6级)102443(小说)102444(课本)102445(编程)102446(其它) |
| 10245 |
其它 |
|
用户模块
登录
- 描述
登录畅二进行操作
请求地址
请求参数
| 序号 |
参数名 |
必选 |
数据类型 |
长度 |
备注 |
| 1 |
username |
Y |
String |
1byte |
必须8位纯数字 |
| 2 |
password |
N |
String |
2byte |
一卡通登录密码 |
返回数据
| 序号 |
返回值 |
中文名称 |
备注 |
| 1 |
code |
请求状态码 |
200请求成功,400请求失败 |
| 2 |
data |
返回数据 |
json格式数据,字符串 |
请求URL实例
POST /changer/user/login HTTP/1.1Host: localhost:8080Content-Type: application/x-www-form-urlencodedCache-Control: no-cachePostman-Token: c5f60931-6b26-46fb-d775-965002d8be5fusername=04143160&password=143160
{ "code": 405, "data": { "user_info_id": 1, "user_img": null, "user_re_name": "李璠涛", "user_grade": "软件1405", "user_name": null, "user_qq": null, "user_wx": null, "user_tel": null, "user_username": "04143160" }}
设置用户信息
- 描述
设置用户个人信息
请求地址
请求参数
| 序号 |
参数名 |
必选 |
数据类型 |
长度 |
备注 |
| 1 |
user_info_id |
Y |
Integer |
1byte |
|
| 2 |
user_img |
N |
String |
1byte |
图像 |
| 3 |
user_re_name |
Y |
String |
1byte |
用户真民 |
| 4 |
user_grade |
Y |
String |
1byte |
班级 |
| 5 |
user_name |
N |
String |
1byte |
昵称 |
| 6 |
user_qq |
N |
String |
1byte |
|
| 7 |
user_wx |
N |
String |
1byte |
微信 |
| 8 |
user_tel |
Y |
String |
1byte |
电话号码 |
| 9 |
user_username |
Y |
String |
1byte |
修改信息的用户 |
返回数据
| 序号 |
返回值 |
中文名称 |
备注 |
| 1 |
code |
请求状态码 |
407表示成功 |
| 2 |
data |
返回数据 |
json格式数据,字符串 |
请求URL实例
PUT /changer/userInfo HTTP/1.1Host: localhost:8080Content-Type: application/jsonCache-Control: no-cachePostman-Token: 8d6cdaf4-365d-42f8-6e37-b2cf65ad9c39{"user_info_id": 1, "user_img": null, "user_re_name": "李璠涛", "user_grade": "软件1405", "user_name": "yiranblade", "user_qq": "781029434", "user_wx": "wx", "user_tel": "15667027637", "user_username": "04143160"}
{ "code": 407, "data": "用户更新成功"}
上传用户图像
- 描述
设置用户个人图像
请求地址
请求参数
| 序号 |
参数名 |
必选 |
数据类型 |
长度 |
备注 |
| 1 |
image |
Y |
byte |
1000byte |
上传的图片 |
返回数据
| 序号 |
返回值 |
中文名称 |
备注 |
| 1 |
code |
请求状态码 |
407表示成功 |
| 2 |
data |
返回数据 |
json格式数据,字符串 |
请求URL实例
POST /changer/userImage HTTP/1.1Host: localhost:8080Cache-Control: no-cachePostman-Token: 8d06d5c4-0109-6bd7-459b-99d20c5b174aContent-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW------WebKitFormBoundary7MA4YWxkTrZu0gWContent-Disposition: form-data; name="image"; filename=""Content-Type: ------WebKitFormBoundary7MA4YWxkTrZu0gW--
{ "code": 406, "data": "图片上传成功"}
获取学生信息
{ "code": 408, "data": { "user_info_id": 1, "user_img": null, "user_re_name": "李璠涛", "user_grade": "软件1405", "user_name": "yiranblade", "user_qq": "781029434", "user_wx": "wx", "user_tel": "15667027637", "user_username": "04143160" }}
收藏物品
- 描述
登录畅二收藏喜欢的物品
请求地址
请求参数
| 序号 |
参数名 |
必选 |
数据类型 |
长度 |
备注 |
| 1 |
goodsId |
Y |
String |
1byte |
必须数字 |
返回数据
| 序号 |
返回值 |
中文名称 |
备注 |
| 1 |
code |
请求状态码 |
200请求成功,400请求失败 |
| 2 |
data |
返回数据 |
json格式数据,字符串 |
请求URL实例
POST /changer/user/collect HTTP/1.1Host: localhost:8080Content-Type: application/x-www-form-urlencodedCache-Control: no-cachePostman-Token: 43fc0d87-fa02-06f4-632f-14673cb4c6a1goodsId=1
{ "code": 408, "data": "收藏成功"}
取消收藏
- 描述
登录畅二收藏取消收藏的物品
请求地址
请求参数
| 序号 |
参数名 |
必选 |
数据类型 |
长度 |
备注 |
| 1 |
goodsId |
Y |
String |
1byte |
必须数字 |
返回数据
| 序号 |
返回值 |
中文名称 |
备注 |
| 1 |
code |
请求状态码 |
200请求成功,400请求失败 |
| 2 |
data |
返回数据 |
json格式数据,字符串 |
请求URL实例
DELETE /changer/user/collect/1 HTTP/1.1Host: localhost:8080Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gWCache-Control: no-cachePostman-Token: b53fc4cd-3ca0-423b-e456-3d20c03fa5e0------WebKitFormBoundary7MA4YWxkTrZu0gW--
{ "code": 409, "data": "取消收藏成功"}
查看以收藏的物品
- 描述
登录畅二查看收藏的物品
请求地址
请求参数
无
返回数据
| 序号 |
返回值 |
中文名称 |
备注 |
| 1 |
code |
请求状态码 |
200请求成功,400请求失败 |
| 2 |
data |
返回数据 |
json格式数据,字符串 |
请求URL实例
DELETE /changer/user/collect/1 HTTP/1.1Host: localhost:8080Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gWCache-Control: no-cachePostman-Token: 7a0b20fc-cef4-6d49-9b76-d0fb7ff8492b------WebKitFormBoundary7MA4YWxkTrZu0gW--
{ "code": 410, "data": [ { "goods_Id": 2, "goods_name": "C语言", "goods_price": "10", "goods_tel": "15667027637", "goods_type": "编程/书籍", "goods_status": "0", "goods_catalog": "失物", "user_username": "04143160", "goods_des": "This is a test" }, { "goods_Id": 3, "goods_name": "计算机科学", "goods_price": "10", "goods_tel": "15667027637", "goods_type": "编程/书籍", "goods_status": "0", "goods_catalog": "失物", "user_username": "04143160", "goods_des": "This is a test" } ]}
物品模块
发布新物品
描述
登录后发布新的物品
- 请求参数
json格式数据,详情见请求实例
- 返回数据
| 序号 |
返回值 |
中文名称 |
备注 |
| 1 |
code |
请求状态码 |
200请求成功,400请求失败 |
| 2 |
data |
返回数据 |
json格式数据,字符串 |
POST /changer/goods HTTP/1.1Host: localhost:8080Content-Type: application/jsonCache-Control: no-cachePostman-Token: e4902443-815c-8206-7d00-2e4c2edba82f{ "goods":{ "goodsName": "C语言", "goodsPrice": "15", "goodsTel": "15667027637", "goodsType": "编程/书籍", "goodsStatus": "0", "goodsCatalog": "失物", "userUsername": "04143160", "goodsDes": "This is a test" }, "goodsImg":["yiranblade","yiranblade","yiranblade"]}
更新发布物品信息
描述
更新物品信息
- 请求参数
json格式数据,详情见请求实例
- 返回数据
| 序号 |
返回值 |
中文名称 |
备注 |
| 1 |
code |
请求状态码 |
200请求成功,400请求失败 |
| 2 |
data |
返回数据 |
json格式数据,字符串 |
PUT /changer/goods HTTP/1.1Host: localhost:8080Content-Type: application/jsonCache-Control: no-cachePostman-Token: 11851543-03c2-7782-0807-d275dffc5f5d{ "goodsId":"1", "goodsName": "C语言", "goodsPrice": "20", "goodsTel": "15667027637", "goodsType": "编程/书籍", "goodsStatus": "0", "goodsCatalog": "失物", "userUsername": "04143160", "goodsDes": "This is a test"}
{ "code": 103, "data": "信息更新成功"}
删除发布物品信息
描述
登录后删除物品信息
- 请求参数
String数据,详情见请求实例
- 返回数据
| 序号 |
返回值 |
中文名称 |
备注 |
| 1 |
code |
请求状态码 |
200请求成功,400请求失败 |
| 2 |
data |
返回数据 |
json格式数据,字符串 |
DELETE /changer/goods/10 HTTP/1.1Host: localhost:8080Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gWCache-Control: no-cachePostman-Token: a961735f-8359-3d10-79ab-b21a21b51881------WebKitFormBoundary7MA4YWxkTrZu0gW--
{ "code": 102, "data": "信息删除成功"}
获取物品图片信息
描述
根据物品ID获取物品图片信息
| 序号 |
参数名 |
必选 |
数据类型 |
长度 |
备注 |
| 1 |
goodsId |
Y |
Integer |
1byte |
物品ID |
| 序号 |
返回值 |
中文名称 |
备注 |
| 1 |
code |
请求状态码 |
200请求成功,400请求失败 |
| 2 |
data |
返回数据 |
json格式数据,字符串 |
GET /changer/goods/img/1 HTTP/1.1Host: localhost:8080Content-Type: application/x-www-form-urlencodedCache-Control: no-cachePostman-Token: c39ebcbf-c7a8-7eb0-94fb-5b9eda05d92a
{ "code": 102, "data": [ { "img_id": 1, "img_url": "yiranblade", "goods_goods_id": 1 }, { "img_id": 2, "img_url": "yiranblade", "goods_goods_id": 1 }, { "img_id": 3, "img_url": "yiranblade", "goods_goods_id": 1 } ]}
获取所有物品信息
POST /changer/goods/page HTTP/1.1Host: localhost:8080Content-Type: application/x-www-form-urlencodedCache-Control: no-cachePostman-Token: 4dbe7caf-575d-0848-9299-25a9948d10a7currentPage=1&action=null
{ "code": 104, "data": { "currentPage": 1, "pageSize": 8, "recordCount": 9, "recordList": [ { "goods_Id": 9, "goods_name": "mysql", "goods_price": "10", "goods_tel": "15667027637", "goods_type": "编程/书籍", "goods_status": "0", "goods_catalog": "失物", "user_username": "04143160", "goods_des": "This is a test", "create_Time": "2017-02-09 11:05:05.0", "update_Time": "2017-02-09 11:05:05.0" }, { "goods_Id": 8, "goods_name": "数据结构", "goods_price": "10", "goods_tel": "15667027637", "goods_type": "编程/书籍", "goods_status": "0", "goods_catalog": "失物", "user_username": "04143160", "goods_des": "This is a test", "create_Time": "2017-02-09 11:04:46.0", "update_Time": "2017-02-09 11:04:46.0" }, { "goods_Id": 7, "goods_name": "java并发", "goods_price": "10", "goods_tel": "15667027637", "goods_type": "编程/书籍", "goods_status": "0", "goods_catalog": "失物", "user_username": "04143160", "goods_des": "This is a test", "create_Time": "2017-02-09 11:04:25.0", "update_Time": "2017-02-09 11:04:25.0" }, { "goods_Id": 6, "goods_name": "深入理解java", "goods_price": "10", "goods_tel": "15667027637", "goods_type": "编程/书籍", "goods_status": "0", "goods_catalog": "失物", "user_username": "04143160", "goods_des": "This is a test", "create_Time": "2017-02-09 11:04:05.0", "update_Time": "2017-02-09 11:04:05.0" }, { "goods_Id": 5, "goods_name": "喵帕斯", "goods_price": "10", "goods_tel": "15667027637", "goods_type": "编程/书籍", "goods_status": "0", "goods_catalog": "失物", "user_username": "04143160", "goods_des": "This is a test", "create_Time": "2017-02-09 11:03:23.0", "update_Time": "2017-02-09 11:03:23.0" }, { "goods_Id": 4, "goods_name": "神", "goods_price": "10", "goods_tel": "15667027637", "goods_type": "编程/书籍", "goods_status": "0", "goods_catalog": "失物", "user_username": "04143160", "goods_des": "This is a test", "create_Time": "2017-02-09 11:03:09.0", "update_Time": "2017-02-09 11:03:09.0" }, { "goods_Id": 3, "goods_name": "计算机科学", "goods_price": "10", "goods_tel": "15667027637", "goods_type": "编程/书籍", "goods_status": "0", "goods_catalog": "失物", "user_username": "04143160", "goods_des": "This is a test", "create_Time": "2017-02-09 11:02:58.0", "update_Time": "2017-02-09 11:02:58.0" }, { "goods_Id": 2, "goods_name": "C语言", "goods_price": "10", "goods_tel": "15667027637", "goods_type": "编程/书籍", "goods_status": "0", "goods_catalog": "失物", "user_username": "04143160", "goods_des": "This is a test", "create_Time": "2017-02-09 11:02:43.0", "update_Time": "2017-02-09 11:02:43.0" } ], "pageCount": 2, "beginPageIndex": 1, "endPageIndex": 2 }}
描述
对喜欢的物品评论
| 序号 |
参数名 |
必选 |
数据类型 |
长度 |
备注 |
| 1 |
commentDes |
Y |
String |
100byte |
评论内容 |
| 2 |
goodsGoodsId |
Y |
String |
Integer |
评论物品的Id |
| 序号 |
返回值 |
中文名称 |
备注 |
| 1 |
code |
请求状态码 |
200请求成功,400请求失败 |
| 2 |
data |
返回数据 |
json格式数据,字符串 |
POST /changer/comment HTTP/1.1Host: localhost:8080Content-Type: application/jsonCache-Control: no-cachePostman-Token: ab0d67f3-2ac1-dc46-841b-d935a02062da{ "goodsGoodsId": 9, "commentDes":"不错哦!"}
{ "code": 501, "data": "评论成功"}
描述
获取某物品下的评论
| 序号 |
参数名 |
必选 |
数据类型 |
长度 |
备注 |
| 1 |
goodsId |
Y |
Integer |
1byte |
物品id |
| 2 |
currentPage |
Y |
String |
1byte |
页码 |
| 序号 |
返回值 |
中文名称 |
备注 |
| 1 |
code |
请求状态码 |
200请求成功,400请求失败 |
| 2 |
data |
返回数据 |
json格式数据,字符串 |
GET /changer/comment/goods/1/1 HTTP/1.1Host: localhost:8080Content-Type: application/jsonCache-Control: no-cachePostman-Token: c863a093-3a99-7eeb-062c-08b7d118a0bb
{ "code": 503, "data": { "currentPage": 1, "pageSize": 8, "recordCount": 2, "recordList": [ { "comment_id": 3, "comment_des": "很喜欢", "user_username": "06151019", "goods_goods_Id": 1 }, { "comment_id": 4, "comment_des": "很喜欢", "user_username": "06151019", "goods_goods_Id": 1 } ], "pageCount": 1, "beginPageIndex": 1, "endPageIndex": 1 }}
回复消息
描述
回复某消息
| 序号 |
参数名 |
必选 |
数据类型 |
长度 |
备注 |
| 1 |
commentId |
Y |
Integer |
1byte |
消息所属评论 |
| 2 |
replycontent |
Y |
String |
1byte |
回复内容 |
| 3 |
targetUser |
Y |
回复目标 |
|
|
| 序号 |
返回值 |
中文名称 |
备注 |
| 1 |
code |
请求状态码 |
200请求成功,400请求失败 |
| 2 |
data |
返回数据 |
json格式数据,字符串 |
POST /changer/comment/reply HTTP/1.1Host: localhost:8080Content-Type: application/jsonCache-Control: no-cachePostman-Token: 11cf003d-c93c-836d-bef8-6dc0f37c3418{ "commentId":"1", "replycontent":"test", "targetUser":"06151019"}
{ "code": 504, "data": "评论成功"}
描述
获取某条评论下的回复消息
| 序号 |
参数名 |
必选 |
数据类型 |
长度 |
备注 |
| 1 |
commentId |
Y |
Integer |
1byte |
消息所属评论ID |
| 序号 |
返回值 |
中文名称 |
备注 |
| 1 |
code |
请求状态码 |
200请求成功,400请求失败 |
| 2 |
data |
返回数据 |
json格式数据,字符串 |
GET /changer/comment/reply/1 HTTP/1.1Host: localhost:8080Content-Type: application/jsonCache-Control: no-cachePostman-Token: 9083367f-6c2d-62ff-9f69-81f094ea0396
{ "code": 506, "data": [ { "replyid": 2, "comment_id": 1, "user_id": "04143160", "replycontent": "test", "target_user": "06151019" } ]}
消息模块
查看是否有新消息
描述
登录后查看是否有新的提示消息
| 序号 |
返回值 |
中文名称 |
备注 |
| 1 |
code |
请求状态码 |
200请求成功,400请求失败 |
| 2 |
data |
返回数据 |
json格式数据,字符串 |
GET /changer/userInfo/message HTTP/1.1Host: localhost:8080Content-Type: application/x-www-form-urlencodedCache-Control: no-cachePostman-Token: 420afddf-809c-b107-3643-cbbcae246f20
{ "code": 409, "data": 3//有三条新消息}
设置所有消息为已读
描述
登录后设置消息为已读
| 序号 |
返回值 |
中文名称 |
备注 |
| 1 |
code |
请求状态码 |
200请求成功,400请求失败 |
| 2 |
data |
返回数据 |
json格式数据,字符串 |
PUT /changer/userInfo/message HTTP/1.1Host: localhost:8080Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gWCache-Control: no-cachePostman-Token: 3ea49302-8242-baf5-24d7-764c89d73161------WebKitFormBoundary7MA4YWxkTrZu0gW--
{ "code": 411, "data": "更新消息成功"}
获得所有消息详情
描述
获得所有消息详情
| 序号 |
返回值 |
中文名称 |
备注 |
| 1 |
code |
请求状态码 |
200请求成功,400请求失败 |
| 2 |
data |
返回数据 |
json格式数据,字符串 |
GET /changer/userInfo/message/comments HTTP/1.1Host: localhost:8080Content-Type: application/x-www-form-urlencodedCache-Control: no-cachePostman-Token: 56b160ba-ec9f-e6af-5a72-c98d1a093dea
{ "code": 412, "data": [ { "comment_id": 2, "comment_des": "不错哦!", "user_username": "06151019", "goods_goods_Id": 9 }, { "comment_id": 4, "comment_des": "很喜欢", "user_username": "06151019", "goods_goods_Id": 1 }, { "comment_id": 6, "comment_des": "加油", "user_username": "06151019", "goods_goods_Id": 2 } ]}
举报模块
构建举报信息
描述
用户提交举报信息
| 序号 |
参数名 |
必选 |
数据类型 |
长度 |
备注 |
| 1 |
goodsId |
Y |
Integer |
1byte |
举报信息所属物品 |
| 2 |
commentId |
Y |
Integer |
1byte |
举报信息所属评论 |
| 3 |
reportReason |
Integer |
1000byte |
举报理由 |
|
| 序号 |
返回值 |
中文名称 |
备注 |
| 1 |
code |
请求状态码 |
200请求成功,400请求失败 |
| 2 |
data |
返回数据 |
json格式数据,字符串 |
POST /changer/report HTTP/1.1Host: localhost:8080Content-Type: application/jsonCache-Control: no-cachePostman-Token: 75ad1106-623e-59b6-a88f-d346b41f4e8c{ "goodsId":"1", "commentId":"1", "reportReason":"涉嫌色情"}
{ "code": 601, "data": "举报成功"}
错误状态码说明
| 序号 |
状态码 |
说明 |
| 1 |
200 |
请求发送成功 |
| 2 |
400 |
数据格式错误 |
| 4 |
500 |
服务器发生未知错误 |
| 5 |
501 |
请求过于频繁 |
ps:状态码还未和各位商量所以当前状态码不具有参考价值