- 新增查询用户关注列表接口,支持分页查询 - 新增批量查询用户信息接口,提升查询效率 - 优化 MQ 消费模式为顺序消费,确保关注/取关操作有序性 - 完善用户信息 DTO,新增简介字段 - 新增分页响应封装类,支持分页查询结果返回 - 优化 Redis 查询逻辑,支持从缓存中分页获取关注列表 - 新增 Lua 脚本结果类型设置,确保脚本执行结果正确解析 - 添加 HTTP 接口测试用例,覆盖关注列表及批量查询接口 - 实现缓存与数据库双写一致性,提高数据查询性能
176 lines
3.4 KiB
HTTP
176 lines
3.4 KiB
HTTP
### 获取验证码
|
|
POST http://localhost:8000/auth/verification/code/send
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"email": "2628273921@qq.com"
|
|
}
|
|
|
|
### 登录/注册
|
|
POST http://localhost:8000/auth/login
|
|
Content-Type: application/json
|
|
|
|
{
|
|
"email": "2628273921@qq.com",
|
|
"code": "825004",
|
|
"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
|
|
}
|
|
|
|
### 正常关注用户
|
|
POST http://localhost:8000/relation/relation/follow
|
|
Content-Type: application/json
|
|
Authorization: Bearer {{token}}
|
|
|
|
{
|
|
"followUserId": {{otherUserId}}
|
|
}
|
|
|
|
### 取消关注
|
|
POST http://localhost:8000/relation/relation/unfollow
|
|
Content-Type: application/json
|
|
Authorization: Bearer {{token}}
|
|
|
|
{
|
|
"unfollowUserId": 2100
|
|
}
|
|
|
|
### 批量查询用户信息
|
|
POST http://localhost:8000/user/user/findByIds
|
|
Content-Type: application/json
|
|
Authorization: Bearer {{token}}
|
|
|
|
{
|
|
"ids": [100,2100,4100]
|
|
}
|
|
|
|
### 查询用户关注列表
|
|
POST http://localhost:8000/relation/relation/following/list
|
|
Content-Type: application/json
|
|
Authorization: Bearer {{token}}
|
|
|
|
{
|
|
"userId": 100,
|
|
"pageNo": 1
|
|
} |