Files
han-note/http-client/gateApi.http
Hanserwei 7942a46592 feat(relation): 实现用户关注功能
- 新增关注用户接口,支持通过用户ID关注其他用户
- 添加参数校验,确保被关注用户ID不为空
- 实现关注用户时的业务逻辑,包括:
  -不能关注自己
  - 校验被关注用户是否存
  - 集成Feign客户端,调用用户服务查询用户信息
- 定义关注相关的异常码和错误信息
- 更新网关配置,路由/relation/**请求到用户关系服务- 添加HTTP客户端测试用例,用于验证关注功能
- 引入用户API依赖,支持远程调用用户服务
2025-10-12 15:02:15 +08:00

139 lines
2.8 KiB
HTTP

###
POST http://localhost:8000/auth/verification/code/send
Content-Type: application/json
{
"email": "ssw010723@gmail.com"
}
### /
POST http://localhost:8000/auth/login
Content-Type: application/json
{
"email": "ssw010723@gmail.com",
"code": "135466",
"type": 1
}
###
POST http://localhost:8000/auth/password/update
Content-Type: application/json
Authorization: Bearer {{token}}
{
"newPassword": "wwgb1314"
}
###
POST http://localhost:8000/user/user/update
Content-Type: multipart/form-data; boundary=WebAppBoundary
Authorization: Bearer {{token}}
--WebAppBoundary
Content-Disposition: form-data; name="avatar"; filename="avatar.png"
Content-Type: image/png
< ./file/img.png
--WebAppBoundary
Content-Disposition: form-data; name="nickname"
Hanserwei
--WebAppBoundary
Content-Disposition: form-data; name="hanNoteId"
hanserwei010723
--WebAppBoundary
Content-Disposition: form-data; name="sex"
1
--WebAppBoundary
Content-Disposition: form-data; name="birthday"
2001-07-23
--WebAppBoundary
Content-Disposition: form-data; name="introduction"
HttpClient
--WebAppBoundary--
Content-Disposition: form-data; name="backgroundImg"; filename="backgroundImg.png"
Content-Type: image/jpeg
< ./file/backgroundImg.jpg
###
POST http://localhost:8000/note/note/publish
Content-Type: application/json
Authorization: Bearer {{token}}
{
"type": 0,
"imgUris": [
"https://cdn.pixabay.com/photo/2025/10/05/15/06/autumn-9875155_1280.jpg"
],
"title": "",
"content": "",
"topicId": 1
}
###
POST http://localhost:8000/note/note/publish
Content-Type: application/json
Authorization: Bearer {{token}}
{
"type": 1,
"videoUri": "https://cdn.pixabay.com/photo/2025/10/05/15/06/autumn-9875155_1280.jpg",
"title": "",
"content": "",
"topicId": 2
}
###
POST http://localhost:8000/note/note/detail
Content-Type: application/json
Authorization: Bearer {{token}}
{
"id": {{noteId}}
}
###
POST http://localhost:8000/note/note/update
Content-Type: application/json
Authorization: Bearer {{token}}
{
"id": {{noteId}},
"type": 0,
"imgUris": [
"https://cdn.pixabay.com/photo/2025/10/05/15/06/autumn-9875155_1280.jpg"
],
"title": "",
"content": "",
"topicId": 1
}
###
POST http://localhost:8000/relation/relation/follow
Content-Type: application/json
Authorization: Bearer {{token}}
{
"followUserId": {{userId}}
}
###
POST http://localhost:8000/relation/relation/follow
Content-Type: application/json
Authorization: Bearer {{token}}
{
"followUserId": -1
}