petsHero-AI/docs/feedback_flow.md
2026-03-21 23:39:28 +08:00

83 lines
1.9 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 举报 / 反馈流程
本文档说明举报弹窗的提交流程及接口调用顺序。字段映射详见 **petsHeroAI_client_guide.md**
---
## 一、前置校验
点击 Submit 时需校验:
| 校验项 | 要求 | 不满足时 |
|--------|------|----------|
| 文字输入 | 必填 | 提示用户填写描述 |
| 图片选择 | 必选 | 提示用户上传图片 |
---
## 二、接口调用顺序
### 2.1 获取上传 URL
| 接口 | 方法 | 说明 |
|------|------|------|
| `/v1/feedback/upload-presigned-url` | POST | 获取图片上传地址 |
**请求体(映射后)**
- `layer` (fileName):文件名
**响应 data映射后**
- `shed` (uploadUrl):上传 URL用于 PUT 请求
- `hunt` (filePath):文件路径,用于 submit 的 fileUrls
---
### 2.2 上传图片
使用 **PUT** 方式将所选图片上传到上一步返回的 `uploadUrl`
- 不经过代理,直接请求返回的 URL
- 请求体为图片二进制数据
- Content-Type 按 HTTP 规范填写(如 `image/jpeg`
---
### 2.3 提交反馈
| 接口 | 方法 | 说明 |
|------|------|------|
| `/v1/feedback/submit` | POST | 提交举报内容 |
**请求体(映射后)**
- `inventory` (fileUrls):文件路径列表,填入 2.1 返回的 `filePath`
- `cloak` (content):用户输入的文字描述
- `pauldron` (contentType):内容类型,按 HTTP 格式填写(如 `text/plain`
---
## 三、流程概览
```
用户填写描述 + 选择图片
校验:文字 + 图片均必填
POST /v1/feedback/upload-presigned-url
body: { layer: fileName }
获取 uploadUrl、filePath
PUT 图片到 uploadUrl
POST /v1/feedback/submit
body: { inventory: [filePath], cloak: content, pauldron: contentType }
提交成功,关闭弹窗
```