Update documentation structure and enhance API descriptions

- Revised README.md to provide a clearer documentation structure for multiple mini programs, including a new table of contents.
- Added references to common authentication documentation in both the remove watermark API and README files.
- Improved clarity of the login interface description and error handling messages in the remove watermark API documentation.
This commit is contained in:
nepiedg
2025-12-31 03:02:00 +00:00
parent bbc2f5f1d5
commit 2884f54666
9 changed files with 320 additions and 57 deletions
+24 -6
View File
@@ -6,6 +6,8 @@
`POST /api/v1/auth/login`
登录与认证的公共说明见:`docs/common/auth.md`
## 接口
### `POST /api/v1/auth/login`
@@ -35,6 +37,15 @@
| 必填校验 | `content` 必须包含一个合法的 http/https 链接 |
| 响应 | `provider` 固定为 `23bt``raw` 为第三方原始 JSON`free_quota_used` 表示是否占用免费额度 |
curl 示例:
```bash
curl -X POST 'http://127.0.0.1:8080/api/v1/video/remove_watermark' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer wx-session-key' \
-d '{"content":"帮我解析 https://v.douyin.com/xxxx/"}'
```
**成功示例**
```json
@@ -57,12 +68,12 @@
| HTTP 码 | code | message | 说明 |
| --- | --- | --- | --- |
| 400 | 400 | `content must contain a valid url` | 未找到链接 |
| 401 | 401 | `unauthorized` | Token 缺失/失效 |
| 403 | 403 | `daily free quota exceeded, please watch an ad to continue` | 超过每日免费额度,需要走广告解锁 |
| 502 | 502 | `third-party api error: ...` | 第三方返回异常 |
| 503 | 503 | `short video api key missing` | 未配置 `SHORT_VIDEO_API_KEY` |
| 500 | 500 | `remove watermark failed` | 其他内部错误 |
| 400 | 400 | `请求参数错误` / `请检查分享链接是否正确` | 请求体非法或内容未包含有效链接 |
| 401 | 401 | `未登录或登录已过期` | Token 缺失/失效 |
| 403 | 403 | `今日免费次数已用完,观看广告后今天可无限制使用` | 超过每日免费额度,需要走广告解锁 |
| 502 | 502 | `解析服务异常,请稍后重试` | 第三方返回异常 |
| 503 | 503 | `服务暂不可用,请联系管理员` | 未配置 `SHORT_VIDEO_API_KEY` 等关键配置 |
| 500 | 500 | `去水印失败,请稍后重试` | 其他内部错误 |
## 3. 完成广告解锁
@@ -74,6 +85,13 @@
| 请求体 | 空 |
| 响应 | `{"code":200,"message":"success","data":{"unlocked":true}}` |
curl 示例:
```bash
curl -X POST 'http://127.0.0.1:8080/api/v1/video/remove_watermark/unlock' \
-H 'Authorization: Bearer wx-session-key'
```
说明:调用该接口表示用户当天已经观看完广告,服务端会写入 `video_parse_unlocks`,当天余下时间不再校验免费额度。
## 4. 数据落地
+2
View File
@@ -4,6 +4,8 @@
小程序需要提供“短视频去水印”功能。用户提交的文本中包含短视频分享链接,后台需调用第三方接口 `https://api.23bt.cn/api/d1w/index?key=<你的key>&url=<分享链接>` 获取解析结果并返回。该接口仅向已登录用户开放。
公共登录与认证说明见:`docs/common/auth.md`
## 功能需求
1. **访问控制**