feat(http): 添加用户信息更新和笔记管理接口测试用例

- 新增更新用户信息的 multipart/form-data 请求示例
- 添加发布图文笔记和视频笔记的 JSON 请求示例- 添加笔记详情查询和笔记修改的请求示例
- 在私有环境变量中增加 noteId 字段用于笔记相关接口测试
- 调整包名路径以符合项目结构规范
This commit is contained in:
2025-10-12 14:13:52 +08:00
parent 04b891e73d
commit 16ab8a13d2
5 changed files with 97 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
package com.hanserwei.hannote.user.relation.biz.domain;
package com.hanserwei.hannote.user.relation.biz;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;

Binary file not shown.

After

Width:  |  Height:  |  Size: 744 KiB

BIN
http-client/file/img.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

View File

@@ -25,3 +25,97 @@ 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
}

View File

@@ -1,5 +1,6 @@
{
"dev": {
"token": "4bXpiBbjXEDFE4ZpqjCOHu1rP81qepl2ROOygrxRGb61K536ckLuyAwfyQHSMcyRdUzf8CxntLEMfbU2ynbYx9nJKlx4vpWZrHqv2mI4iMhnShQ4mPBi7OPPgZi22O2f"
"token": "4bXpiBbjXEDFE4ZpqjCOHu1rP81qepl2ROOygrxRGb61K536ckLuyAwfyQHSMcyRdUzf8CxntLEMfbU2ynbYx9nJKlx4vpWZrHqv2mI4iMhnShQ4mPBi7OPPgZi22O2f",
"noteId": "1977249693272375330"
}
}