- 修改消费者组名称,统一命名规范 - 更新 HTTP 客户端测试用例中的授权令牌和笔记 ID - 引入 NoteLikeDOMapper 并替换原有的 service 查询方式 - 将布隆过滤器相关逻辑全部替换为 Roaring Bitmap 实现 - 新增多个 Lua 脚本支持 Roaring Bitmap 的操作与初始化 - 添加 Roaring Bitmap 相关的 Redis Key 构建方法 - 删除旧有的布隆过滤器校验逻辑及冗余代码 - 更新 Redis Key 常量类,增加 Roaring Bitmap 相关定义 - 日志字典文件中新增 rbitmap 关键词 - 优化点赞和取消点赞流程,提升性能与准确性
406 lines
8.1 KiB
HTTP
406 lines
8.1 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": "116253",
|
||
"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": [
|
||
"http://116.62.199.48:9000/weblog/c58c6db953d24922803a65ca4f79a0a9.png",
|
||
"http://116.62.199.48:9000/weblog/04c7312e0b4b41be996004517c247e2b.jpg"
|
||
],
|
||
"title": "最美的风景不是诗和远方,而就在身边",
|
||
"content": "最美的风景不是诗和远方,而就在身边",
|
||
"topicId": 2
|
||
}
|
||
|
||
|
||
### 发布视频笔记
|
||
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/note/note/delete
|
||
Content-Type: application/json
|
||
Authorization: Bearer {{token}}
|
||
|
||
{
|
||
"id": 1981322504056078370
|
||
}
|
||
|
||
### 关注自己
|
||
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": 2100
|
||
}
|
||
|
||
### 取消关注
|
||
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
|
||
}
|
||
|
||
### 查询用户粉丝列表
|
||
POST http://localhost:8000/relation/relation/fans/list
|
||
Content-Type: application/json
|
||
Authorization: Bearer {{token}}
|
||
|
||
{
|
||
"userId": 100,
|
||
"pageNo": 1
|
||
}
|
||
|
||
### 笔记点赞入口
|
||
POST http://localhost:8000/note/note/like
|
||
Content-Type: application/json
|
||
Authorization: Bearer {{thirdToken}}
|
||
|
||
{
|
||
"id": 1985254482941837349
|
||
}
|
||
|
||
### 笔记取消点赞入口
|
||
POST http://localhost:8000/note/note/unlike
|
||
Content-Type: application/json
|
||
Authorization: Bearer {{thirdToken}}
|
||
|
||
{
|
||
"id": 1985254482941837349
|
||
}
|
||
|
||
### 笔记收藏入口
|
||
POST http://localhost:8000/note/note/collect
|
||
Content-Type: application/json
|
||
Authorization: Bearer {{thirdToken}}
|
||
|
||
{
|
||
"id": 1981698494959714362
|
||
}
|
||
|
||
### 笔记取消收藏入口
|
||
POST http://localhost:8000/note/note/uncollect
|
||
Content-Type: application/json
|
||
Authorization: Bearer {{otherToken}}
|
||
|
||
{
|
||
"id": 1977249693272375330
|
||
}
|
||
|
||
### 创建索引
|
||
PUT http://localhost:9200/note
|
||
Content-Type: application/json
|
||
|
||
### 创建文档
|
||
PUT http://localhost:9200/note/_doc/1
|
||
Content-Type: application/json
|
||
|
||
{
|
||
"title": "夏日旅游攻略",
|
||
"content": "去海边玩耍的必备攻略,推荐三亚和青岛。",
|
||
"create_time": "2024-08-16 16:49:35"
|
||
}
|
||
|
||
### 创建文档
|
||
PUT http://localhost:9200/note/_doc/2
|
||
Content-Type: application/json
|
||
|
||
{
|
||
"title": "美食笔记",
|
||
"content": "推荐几家成都的火锅店,真的很辣很过瘾!",
|
||
"create_time": "2024-11-02 17:00:36"
|
||
}
|
||
|
||
### 创建文档
|
||
PUT http://localhost:9200/note/_doc/3
|
||
Content-Type: application/json
|
||
|
||
{
|
||
"title": "秋季穿搭指南",
|
||
"content": "分享适合秋天的服装搭配技巧,风衣必不可少。",
|
||
"create_time": "2024-11-03 16:59:58"
|
||
}
|
||
|
||
### 搜索文档
|
||
GET http://localhost:9200/note/_search
|
||
Content-Type: application/json
|
||
|
||
{
|
||
"query": {
|
||
"multi_match": {
|
||
"query": "攻略",
|
||
"fields": [
|
||
"title",
|
||
"content"
|
||
]
|
||
}
|
||
}
|
||
}
|
||
|
||
### 搜索用户(搜索服务)
|
||
POST http://localhost:8092/search/user
|
||
Content-Type: application/json
|
||
|
||
{
|
||
"keyword": "憨憨",
|
||
"pageNo": 1
|
||
}
|
||
|
||
### 发布评论
|
||
POST http://localhost:8000/comment/comment/publish
|
||
Content-Type: application/json
|
||
Authorization: Bearer {{token}}
|
||
|
||
{
|
||
"noteId": 1862481582414102549,
|
||
"content": "这是一条测试同步Redis更新计数的评论",
|
||
"imageUrl": "https://cdn.pixabay.com/photo/2025/10/05/15/06/autumn-9875155_1280.jpg",
|
||
"replyCommentId": 4002
|
||
}
|
||
|
||
### 批量添加评论
|
||
POST http://localhost:8084/kv/comment/content/batchAdd
|
||
Content-Type: application/json
|
||
|
||
{
|
||
"comments": [
|
||
{
|
||
"noteId": 1862481582414102548,
|
||
"yearMonth": "2024-12",
|
||
"contentId": "db8339cd-beba-40a5-9182-c51c2588ae04",
|
||
"content": "这是一条评论内容1"
|
||
},
|
||
{
|
||
"noteId": 1862481582414102539,
|
||
"yearMonth": "2024-12",
|
||
"contentId": "db8339cd-beba-40a5-9182-c51c2588ae05",
|
||
"content": "这是一条评论内容2"
|
||
},
|
||
{
|
||
"noteId": 1862481582414102540,
|
||
"yearMonth": "2024-12",
|
||
"contentId": "db8339cd-beba-40a5-9182-c51c2588ae06",
|
||
"content": "这是一条评论内容3"
|
||
}
|
||
]
|
||
}
|
||
|
||
### 批量查询评论内容
|
||
POST http://localhost:8084/kv/comment/content/batchFind
|
||
Content-Type: application/json
|
||
|
||
{
|
||
"noteId": 1862481582414102549,
|
||
"commentContentKeys": [
|
||
{
|
||
"yearMonth": "2025-11",
|
||
"contentId": "a2537301-dc80-4fd6-ab2f-a9a908baebba"
|
||
},
|
||
{
|
||
"yearMonth": "2025-11",
|
||
"contentId": "a66b06ce-bf45-4a21-a5f2-31e5fb5fb5eb"
|
||
}
|
||
]
|
||
}
|
||
|
||
### 分页查询评论
|
||
POST http://localhost:8093/comment/list
|
||
Content-Type: application/json
|
||
|
||
{
|
||
"noteId": 1862481582414102549,
|
||
"pageNo": 1
|
||
}
|
||
|
||
### 分页查询子评论
|
||
POST http://localhost:8000/comment/comment/child/list
|
||
Content-Type: application/json
|
||
Authorization: Bearer {{token}}
|
||
|
||
{
|
||
"parentCommentId": 4002,
|
||
"pageNo": 1
|
||
}
|
||
|
||
### 点赞评论
|
||
POST http://localhost:8000/comment/comment/like
|
||
Content-Type: application/json
|
||
Authorization: Bearer {{token}}
|
||
|
||
{
|
||
"commentId": 8001
|
||
}
|
||
|
||
### 取消点赞评论
|
||
POST http://localhost:8000/comment/comment/unlike
|
||
Content-Type: application/json
|
||
Authorization: Bearer {{token}}
|
||
|
||
{
|
||
"commentId": 8001
|
||
}
|
||
|
||
### 删除评论
|
||
POST http://localhost:8084/kv/comment/content/delete
|
||
Content-Type: application/json
|
||
|
||
{
|
||
"noteId": 1862481582414102549,
|
||
"yearMonth": "2025-11",
|
||
"contentId": "0fa4376f-a098-4fee-821b-f5b7e627a72c"
|
||
}
|
||
|
||
### 删除评论,同步删除一切相关缓存
|
||
POST http://localhost:8000/comment/comment/delete
|
||
Content-Type: application/json
|
||
Authorization: Bearer {{token}}
|
||
|
||
{
|
||
"commentId": 8001
|
||
}
|