gohub.http 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. ### POST /signup/phone/exist 注册手机号是否已存在
  2. POST {{base_url}}/v1/auth/signup/phone/exist HTTP/1.1
  3. Content-Type: application/json
  4. {
  5. "phone": "15968875425"
  6. }
  7. ### POST /signup/email/exist 注册邮箱是否已存在
  8. POST {{base_url}}/v1/auth/signup/email/exist HTTP/1.1
  9. Content-Type: application/json
  10. {
  11. "email": "ynwdlxm@163.com"
  12. }
  13. ### POST /verify_code/captcha 图片验证码
  14. POST {{base_url}}/v1/auth/verify_code/captcha HTTP/1.1
  15. Content-Type: application/json
  16. ### POST /verify_code/phone 发送手机验证码
  17. POST {{base_url}}/v1/auth/verify_code/phone HTTP/1.1
  18. Content-Type: application/json
  19. {
  20. "phone": "15968875425",
  21. "captcha_id": "captcha_skip_test",
  22. "captcha_answer": "888888"
  23. }
  24. ### POST /verify_code/email 发送邮箱验证码
  25. POST {{base_url}}/v1/auth/verify_code/email HTTP/1.1
  26. Content-Type: application/json
  27. {
  28. "email": "summer@example.com",
  29. "captcha_id": "captcha_skip_test",
  30. "captcha_answer": "123456"
  31. }
  32. ### 注册用户
  33. POST {{base_url}}/v1/auth/signup/using-phone HTTP/1.1
  34. Content-Type: application/json
  35. {
  36. "name": "summer",
  37. "password": "secret",
  38. "password_confirm": "secret",
  39. "verify_code": "439665",
  40. "phone": "00011059149"
  41. }
  42. ### 注册用户
  43. POST {{base_url}}/v1/auth/signup/using-email HTTP/1.1
  44. Content-Type: application/json
  45. {
  46. "name": "summer3",
  47. "password": "secret",
  48. "password_confirm": "secret",
  49. "verify_code": "123123",
  50. "email": "summer3@testing.com"
  51. }
  52. ### 登录用户
  53. POST {{base_url}}/v1/auth/login/using-password HTTP/1.1
  54. Content-Type: application/json
  55. {
  56. "captcha_id": "xTS6AtcgjUVABJj2M9NE",
  57. "captcha_answer": "338750",
  58. "login_id": "summer",
  59. "password": "secret"
  60. }
  61. ### 刷新token
  62. POST {{base_url}}/v1/auth/login/refresh-token HTTP/1.1
  63. Authorization: Bearer {{access_token}}
  64. Content-Type: application/json
  65. {}
  66. ### /test_auth 测试认证
  67. GET {{base_url}}/test_auth HTTP/1.1
  68. Authorization: Bearer {{access_token}}
  69. ### /test_gust 测试认证
  70. GET {{base_url}}/test_gust HTTP/1.1
  71. Authorization: Bearer {{access_token}}
  72. ### GET /current_user 当前登陆用户
  73. GET {{base_url}}/v1/auth/user HTTP/1.1
  74. Authorization: Bearer {{access_token}}
  75. ### 用户列表
  76. GET {{base_url}}/v1/users HTTP/1.1
  77. ### 创建分类
  78. POST {{base_url}}/v1/categories HTTP/1.1
  79. Authorization: Bearer {{access_token}}
  80. Content-Type: application/json
  81. {
  82. "name": "分类1",
  83. "description": "分类1描述"
  84. }
  85. ### 更新分类
  86. PUT {{base_url}}/v1/categories/1 HTTP/1.1
  87. Authorization: Bearer {{access_token}}
  88. Content-Type: application/json
  89. {
  90. "name": "新分类名称",
  91. "description": "分类1描述"
  92. }
  93. ### 分类列表
  94. GET {{base_url}}/v1/categories?page=2&sort=id&order=asc&per_page=10 HTTP/1.1
  95. Content-Type: application/json
  96. ### 删除分类
  97. DELETE {{base_url}}/v1/categories/1 HTTP/1.1
  98. Authorization: Bearer {{access_token}}
  99. Content-Type: application/json
  100. ### 创建话题
  101. POST {{base_url}}/v1/topics HTTP/1.1
  102. Authorization: Bearer {{access_token}}
  103. Content-Type: application/json
  104. {
  105. "title": "我的的帖子2",
  106. "body": "话题1内容, 这里是帖子描述内容帖子描述内容",
  107. "category_id": "3"
  108. }
  109. ### 更新话题
  110. PUT {{base_url}}/v1/topics/1 HTTP/1.1
  111. Authorization: Bearer {{access_token}}
  112. Content-Type: application/json
  113. {
  114. "title": "我的的帖子3",
  115. "body": "话题1内容, 这里是帖子描述内容帖子描述内容",
  116. "category_id": "3"
  117. }