[关闭]
@yiranblade 2017-05-26T07:18:39.000000Z 字数 13691 阅读 259

畅二接口文档

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. POST /changer/user/login HTTP/1.1
  2. Host: localhost:8080
  3. Content-Type: application/x-www-form-urlencoded
  4. Cache-Control: no-cache
  5. Postman-Token: c5f60931-6b26-46fb-d775-965002d8be5f
  6. username=04143160&password=143160
  1. {
  2. "code": 405,
  3. "data": {
  4. "user_info_id": 1,
  5. "user_img": null,
  6. "user_re_name": "李璠涛",
  7. "user_grade": "软件1405",
  8. "user_name": null,
  9. "user_qq": null,
  10. "user_wx": null,
  11. "user_tel": null,
  12. "user_username": "04143160"
  13. }
  14. }

设置用户信息

  1. PUT /changer/userInfo HTTP/1.1
  2. Host: localhost:8080
  3. Content-Type: application/json
  4. Cache-Control: no-cache
  5. Postman-Token: 8d6cdaf4-365d-42f8-6e37-b2cf65ad9c39
  6. {"user_info_id": 1,
  7. "user_img": null,
  8. "user_re_name": "李璠涛",
  9. "user_grade": "软件1405",
  10. "user_name": "yiranblade",
  11. "user_qq": "781029434",
  12. "user_wx": "wx",
  13. "user_tel": "15667027637",
  14. "user_username": "04143160"
  15. }
  1. {
  2. "code": 407,
  3. "data": "用户更新成功"
  4. }

上传用户图像

  1. POST /changer/userImage HTTP/1.1
  2. Host: localhost:8080
  3. Cache-Control: no-cache
  4. Postman-Token: 8d06d5c4-0109-6bd7-459b-99d20c5b174a
  5. Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
  6. ------WebKitFormBoundary7MA4YWxkTrZu0gW
  7. Content-Disposition: form-data; name="image"; filename=""
  8. Content-Type:
  9. ------WebKitFormBoundary7MA4YWxkTrZu0gW--
  1. {
  2. "code": 406,
  3. "data": "图片上传成功"
  4. }

获取学生信息

  1. {
  2. "code": 408,
  3. "data": {
  4. "user_info_id": 1,
  5. "user_img": null,
  6. "user_re_name": "李璠涛",
  7. "user_grade": "软件1405",
  8. "user_name": "yiranblade",
  9. "user_qq": "781029434",
  10. "user_wx": "wx",
  11. "user_tel": "15667027637",
  12. "user_username": "04143160"
  13. }
  14. }

收藏物品

  1. POST /changer/user/collect HTTP/1.1
  2. Host: localhost:8080
  3. Content-Type: application/x-www-form-urlencoded
  4. Cache-Control: no-cache
  5. Postman-Token: 43fc0d87-fa02-06f4-632f-14673cb4c6a1
  6. goodsId=1
  1. {
  2. "code": 408,
  3. "data": "收藏成功"
  4. }

取消收藏

  1. DELETE /changer/user/collect/1 HTTP/1.1
  2. Host: localhost:8080
  3. Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
  4. Cache-Control: no-cache
  5. Postman-Token: b53fc4cd-3ca0-423b-e456-3d20c03fa5e0
  6. ------WebKitFormBoundary7MA4YWxkTrZu0gW--
  1. {
  2. "code": 409,
  3. "data": "取消收藏成功"
  4. }

查看以收藏的物品

  1. DELETE /changer/user/collect/1 HTTP/1.1
  2. Host: localhost:8080
  3. Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
  4. Cache-Control: no-cache
  5. Postman-Token: 7a0b20fc-cef4-6d49-9b76-d0fb7ff8492b
  6. ------WebKitFormBoundary7MA4YWxkTrZu0gW--
  1. {
  2. "code": 410,
  3. "data": [
  4. {
  5. "goods_Id": 2,
  6. "goods_name": "C语言",
  7. "goods_price": "10",
  8. "goods_tel": "15667027637",
  9. "goods_type": "编程/书籍",
  10. "goods_status": "0",
  11. "goods_catalog": "失物",
  12. "user_username": "04143160",
  13. "goods_des": "This is a test"
  14. },
  15. {
  16. "goods_Id": 3,
  17. "goods_name": "计算机科学",
  18. "goods_price": "10",
  19. "goods_tel": "15667027637",
  20. "goods_type": "编程/书籍",
  21. "goods_status": "0",
  22. "goods_catalog": "失物",
  23. "user_username": "04143160",
  24. "goods_des": "This is a test"
  25. }
  26. ]
  27. }

物品模块

发布新物品

  1. POST /changer/goods HTTP/1.1
  2. Host: localhost:8080
  3. Content-Type: application/json
  4. Cache-Control: no-cache
  5. Postman-Token: e4902443-815c-8206-7d00-2e4c2edba82f
  6. {
  7. "goods":{
  8. "goodsName": "C语言",
  9. "goodsPrice": "15",
  10. "goodsTel": "15667027637",
  11. "goodsType": "编程/书籍",
  12. "goodsStatus": "0",
  13. "goodsCatalog": "失物",
  14. "userUsername": "04143160",
  15. "goodsDes": "This is a test"
  16. },
  17. "goodsImg":["yiranblade","yiranblade","yiranblade"]
  18. }

更新发布物品信息

  1. PUT /changer/goods HTTP/1.1
  2. Host: localhost:8080
  3. Content-Type: application/json
  4. Cache-Control: no-cache
  5. Postman-Token: 11851543-03c2-7782-0807-d275dffc5f5d
  6. {
  7. "goodsId":"1",
  8. "goodsName": "C语言",
  9. "goodsPrice": "20",
  10. "goodsTel": "15667027637",
  11. "goodsType": "编程/书籍",
  12. "goodsStatus": "0",
  13. "goodsCatalog": "失物",
  14. "userUsername": "04143160",
  15. "goodsDes": "This is a test"
  16. }
  1. {
  2. "code": 103,
  3. "data": "信息更新成功"
  4. }

删除发布物品信息

  1. DELETE /changer/goods/10 HTTP/1.1
  2. Host: localhost:8080
  3. Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
  4. Cache-Control: no-cache
  5. Postman-Token: a961735f-8359-3d10-79ab-b21a21b51881
  6. ------WebKitFormBoundary7MA4YWxkTrZu0gW--
  1. {
  2. "code": 102,
  3. "data": "信息删除成功"
  4. }

获取物品图片信息

  1. GET /changer/goods/img/1 HTTP/1.1
  2. Host: localhost:8080
  3. Content-Type: application/x-www-form-urlencoded
  4. Cache-Control: no-cache
  5. Postman-Token: c39ebcbf-c7a8-7eb0-94fb-5b9eda05d92a
  1. {
  2. "code": 102,
  3. "data": [
  4. {
  5. "img_id": 1,
  6. "img_url": "yiranblade",
  7. "goods_goods_id": 1
  8. },
  9. {
  10. "img_id": 2,
  11. "img_url": "yiranblade",
  12. "goods_goods_id": 1
  13. },
  14. {
  15. "img_id": 3,
  16. "img_url": "yiranblade",
  17. "goods_goods_id": 1
  18. }
  19. ]
  20. }

获取所有物品信息

  1. POST /changer/goods/page HTTP/1.1
  2. Host: localhost:8080
  3. Content-Type: application/x-www-form-urlencoded
  4. Cache-Control: no-cache
  5. Postman-Token: 4dbe7caf-575d-0848-9299-25a9948d10a7
  6. currentPage=1&action=null
  1. {
  2. "code": 104,
  3. "data": {
  4. "currentPage": 1,
  5. "pageSize": 8,
  6. "recordCount": 9,
  7. "recordList": [
  8. {
  9. "goods_Id": 9,
  10. "goods_name": "mysql",
  11. "goods_price": "10",
  12. "goods_tel": "15667027637",
  13. "goods_type": "编程/书籍",
  14. "goods_status": "0",
  15. "goods_catalog": "失物",
  16. "user_username": "04143160",
  17. "goods_des": "This is a test",
  18. "create_Time": "2017-02-09 11:05:05.0",
  19. "update_Time": "2017-02-09 11:05:05.0"
  20. },
  21. {
  22. "goods_Id": 8,
  23. "goods_name": "数据结构",
  24. "goods_price": "10",
  25. "goods_tel": "15667027637",
  26. "goods_type": "编程/书籍",
  27. "goods_status": "0",
  28. "goods_catalog": "失物",
  29. "user_username": "04143160",
  30. "goods_des": "This is a test",
  31. "create_Time": "2017-02-09 11:04:46.0",
  32. "update_Time": "2017-02-09 11:04:46.0"
  33. },
  34. {
  35. "goods_Id": 7,
  36. "goods_name": "java并发",
  37. "goods_price": "10",
  38. "goods_tel": "15667027637",
  39. "goods_type": "编程/书籍",
  40. "goods_status": "0",
  41. "goods_catalog": "失物",
  42. "user_username": "04143160",
  43. "goods_des": "This is a test",
  44. "create_Time": "2017-02-09 11:04:25.0",
  45. "update_Time": "2017-02-09 11:04:25.0"
  46. },
  47. {
  48. "goods_Id": 6,
  49. "goods_name": "深入理解java",
  50. "goods_price": "10",
  51. "goods_tel": "15667027637",
  52. "goods_type": "编程/书籍",
  53. "goods_status": "0",
  54. "goods_catalog": "失物",
  55. "user_username": "04143160",
  56. "goods_des": "This is a test",
  57. "create_Time": "2017-02-09 11:04:05.0",
  58. "update_Time": "2017-02-09 11:04:05.0"
  59. },
  60. {
  61. "goods_Id": 5,
  62. "goods_name": "喵帕斯",
  63. "goods_price": "10",
  64. "goods_tel": "15667027637",
  65. "goods_type": "编程/书籍",
  66. "goods_status": "0",
  67. "goods_catalog": "失物",
  68. "user_username": "04143160",
  69. "goods_des": "This is a test",
  70. "create_Time": "2017-02-09 11:03:23.0",
  71. "update_Time": "2017-02-09 11:03:23.0"
  72. },
  73. {
  74. "goods_Id": 4,
  75. "goods_name": "神",
  76. "goods_price": "10",
  77. "goods_tel": "15667027637",
  78. "goods_type": "编程/书籍",
  79. "goods_status": "0",
  80. "goods_catalog": "失物",
  81. "user_username": "04143160",
  82. "goods_des": "This is a test",
  83. "create_Time": "2017-02-09 11:03:09.0",
  84. "update_Time": "2017-02-09 11:03:09.0"
  85. },
  86. {
  87. "goods_Id": 3,
  88. "goods_name": "计算机科学",
  89. "goods_price": "10",
  90. "goods_tel": "15667027637",
  91. "goods_type": "编程/书籍",
  92. "goods_status": "0",
  93. "goods_catalog": "失物",
  94. "user_username": "04143160",
  95. "goods_des": "This is a test",
  96. "create_Time": "2017-02-09 11:02:58.0",
  97. "update_Time": "2017-02-09 11:02:58.0"
  98. },
  99. {
  100. "goods_Id": 2,
  101. "goods_name": "C语言",
  102. "goods_price": "10",
  103. "goods_tel": "15667027637",
  104. "goods_type": "编程/书籍",
  105. "goods_status": "0",
  106. "goods_catalog": "失物",
  107. "user_username": "04143160",
  108. "goods_des": "This is a test",
  109. "create_Time": "2017-02-09 11:02:43.0",
  110. "update_Time": "2017-02-09 11:02:43.0"
  111. }
  112. ],
  113. "pageCount": 2,
  114. "beginPageIndex": 1,
  115. "endPageIndex": 2
  116. }
  117. }

评论模块

评论物品

  1. POST /changer/comment HTTP/1.1
  2. Host: localhost:8080
  3. Content-Type: application/json
  4. Cache-Control: no-cache
  5. Postman-Token: ab0d67f3-2ac1-dc46-841b-d935a02062da
  6. {
  7. "goodsGoodsId": 9,
  8. "commentDes":"不错哦!"
  9. }
  1. {
  2. "code": 501,
  3. "data": "评论成功"
  4. }

获取物品下的评论

  1. GET /changer/comment/goods/1/1 HTTP/1.1
  2. Host: localhost:8080
  3. Content-Type: application/json
  4. Cache-Control: no-cache
  5. Postman-Token: c863a093-3a99-7eeb-062c-08b7d118a0bb
  1. {
  2. "code": 503,
  3. "data": {
  4. "currentPage": 1,
  5. "pageSize": 8,
  6. "recordCount": 2,
  7. "recordList": [
  8. {
  9. "comment_id": 3,
  10. "comment_des": "很喜欢",
  11. "user_username": "06151019",
  12. "goods_goods_Id": 1
  13. },
  14. {
  15. "comment_id": 4,
  16. "comment_des": "很喜欢",
  17. "user_username": "06151019",
  18. "goods_goods_Id": 1
  19. }
  20. ],
  21. "pageCount": 1,
  22. "beginPageIndex": 1,
  23. "endPageIndex": 1
  24. }
  25. }

回复消息

  1. POST /changer/comment/reply HTTP/1.1
  2. Host: localhost:8080
  3. Content-Type: application/json
  4. Cache-Control: no-cache
  5. Postman-Token: 11cf003d-c93c-836d-bef8-6dc0f37c3418
  6. {
  7. "commentId":"1",
  8. "replycontent":"test",
  9. "targetUser":"06151019"
  10. }
  1. {
  2. "code": 504,
  3. "data": "评论成功"
  4. }

获取评论附属消息

  1. GET /changer/comment/reply/1 HTTP/1.1
  2. Host: localhost:8080
  3. Content-Type: application/json
  4. Cache-Control: no-cache
  5. Postman-Token: 9083367f-6c2d-62ff-9f69-81f094ea0396
  1. {
  2. "code": 506,
  3. "data": [
  4. {
  5. "replyid": 2,
  6. "comment_id": 1,
  7. "user_id": "04143160",
  8. "replycontent": "test",
  9. "target_user": "06151019"
  10. }
  11. ]
  12. }

消息模块

查看是否有新消息

  1. GET /changer/userInfo/message HTTP/1.1
  2. Host: localhost:8080
  3. Content-Type: application/x-www-form-urlencoded
  4. Cache-Control: no-cache
  5. Postman-Token: 420afddf-809c-b107-3643-cbbcae246f20
  1. {
  2. "code": 409,
  3. "data": 3//有三条新消息
  4. }

设置所有消息为已读

  1. PUT /changer/userInfo/message HTTP/1.1
  2. Host: localhost:8080
  3. Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
  4. Cache-Control: no-cache
  5. Postman-Token: 3ea49302-8242-baf5-24d7-764c89d73161
  6. ------WebKitFormBoundary7MA4YWxkTrZu0gW--
  1. {
  2. "code": 411,
  3. "data": "更新消息成功"
  4. }

获得所有消息详情

  1. GET /changer/userInfo/message/comments HTTP/1.1
  2. Host: localhost:8080
  3. Content-Type: application/x-www-form-urlencoded
  4. Cache-Control: no-cache
  5. Postman-Token: 56b160ba-ec9f-e6af-5a72-c98d1a093dea
  1. {
  2. "code": 412,
  3. "data": [
  4. {
  5. "comment_id": 2,
  6. "comment_des": "不错哦!",
  7. "user_username": "06151019",
  8. "goods_goods_Id": 9
  9. },
  10. {
  11. "comment_id": 4,
  12. "comment_des": "很喜欢",
  13. "user_username": "06151019",
  14. "goods_goods_Id": 1
  15. },
  16. {
  17. "comment_id": 6,
  18. "comment_des": "加油",
  19. "user_username": "06151019",
  20. "goods_goods_Id": 2
  21. }
  22. ]
  23. }

举报模块

构建举报信息

  1. POST /changer/report HTTP/1.1
  2. Host: localhost:8080
  3. Content-Type: application/json
  4. Cache-Control: no-cache
  5. Postman-Token: 75ad1106-623e-59b6-a88f-d346b41f4e8c
  6. {
  7. "goodsId":"1",
  8. "commentId":"1",
  9. "reportReason":"涉嫌色情"
  10. }
  1. {
  2. "code": 601,
  3. "data": "举报成功"
  4. }

错误状态码说明

序号 状态码 说明
1 200 请求发送成功
2 400 数据格式错误
4 500 服务器发生未知错误
5 501 请求过于频繁

ps:状态码还未和各位商量所以当前状态码不具有参考价值

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注