hookehuyr

docs: 新增收藏模块接口文档并更新 API 集成日志

### 新增内容

1. **新增收藏 API 定义文件**
   - src/api/favorite.js: 收藏相关 API 封装
     - addAPI: 添加收藏
     - delAPI: 取消收藏
     - listAPI: 收藏列表

2. **新增收藏模块 API 规范文档**
   - docs/api-specs/favorite/add.md: 添加收藏接口文档
   - docs/api-specs/favorite/del.md: 取消收藏接口文档
   - docs/api-specs/favorite/list.md: 收藏列表接口文档

3. **更新 API 集成日志**
   - 新增收藏模块章节(3 个接口)
   - 更新总体进度:16 → 19 个接口
   - 更新后端开发中接口数:2 → 5 个
   - 更新快速索引(添加收藏模块)
   - 更新文档版本:v1.8 → v1.9

### 接口状态

所有收藏接口均为 **⏳ 后端开发中**:
- addAPI(添加收藏)
- delAPI(取消收藏)
- listAPI(收藏列表)

### 影响文件

- src/api/favorite.js(新增)
- docs/api-specs/favorite/add.md(新增)
- docs/api-specs/favorite/del.md(新增)
- docs/api-specs/favorite/list.md(新增)
- docs/api-integration-log.md(更新)
- src/api/user.js(linter 自动格式化)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
......@@ -4,11 +4,11 @@
## 📊 总体进度
- **总接口数**: 16
- **已完成**: 11 (68.8%)
- **总接口数**: 19
- **已完成**: 11 (57.9%)
- **联调中**: 0 (0%)
- **已废弃**: 3 (18.8%)
- **后端开发中**: 2 (12.5%)
- **已废弃**: 3 (15.8%)
- **后端开发中**: 5 (26.3%)
- **有阻塞**: 0
---
......@@ -19,6 +19,7 @@
-**修复头像上传接口数据映射错误**:根据实际返回结构正确映射字段
-**新增头像设置页面加载时获取用户当前头像功能**:提升用户体验
-**更新 API 文档**:完善 get_profile 和 update_profile 接口文档
- 🆕 **新增收藏模块**:添加 3 个收藏接口(addAPI、delAPI、listAPI),后端开发中
---
......@@ -615,6 +616,120 @@
---
### 收藏模块
#### 接口 1: 添加收藏
**接口信息**
- **接口名称**: `addAPI`
- **接口路径**: `/srv/?a=favorite&t=add`
- **请求方法**: POST
- **负责页面**: 待确认(产品详情页、资料详情页等)
- **负责人**: 后端团队
**接口文档更新记录**
| 日期 | 版本 | 变更内容 | 变更原因 | 文档链接 |
|------|------|---------|---------|---------|
| 2026-02-03 | v1.0 | 初始版本 | - | [查看](#) |
**页面调试情况**
| 日期 | 调试页面 | 问题记录 | 解决方案 | 状态 |
|------|---------|---------|---------|------|
| 2026-02-03 | - | 后端开发中 | - | 后端开发中 |
**接口状态**: 后端开发中
**备注**:
- 参数:`meta_id`(文件ID)
- 用于收藏产品或资料
- 后端接口开发中
- 实现位置:`src/api/favorite.js:addAPI`
---
#### 接口 2: 取消收藏
**接口信息**
- **接口名称**: `delAPI`
- **接口路径**: `/srv/?a=favorite&t=del`
- **请求方法**: POST
- **负责页面**: 待确认(收藏列表页)
- **负责人**: 后端团队
**接口文档更新记录**
| 日期 | 版本 | 变更内容 | 变更原因 | 文档链接 |
|------|------|---------|---------|---------|
| 2026-02-03 | v1.0 | 初始版本 | - | [查看](#) |
**页面调试情况**
| 日期 | 调试页面 | 问题记录 | 解决方案 | 状态 |
|------|---------|---------|---------|------|
| 2026-02-03 | - | 后端开发中 | - | 后端开发中 |
**接口状态**: 后端开发中
**备注**:
- 参数:`meta_id`(文件ID)
- 用于取消收藏的产品或资料
- 后端接口开发中
- 实现位置:`src/api/favorite.js:delAPI`
---
#### 接口 3: 收藏列表
**接口信息**
- **接口名称**: `listAPI`
- **接口路径**: `/srv/?a=favorite&t=list`
- **请求方法**: GET
- **负责页面**: 待确认(我的收藏页面)
- **负责人**: 后端团队
**接口文档更新记录**
| 日期 | 版本 | 变更内容 | 变更原因 | 文档链接 |
|------|------|---------|---------|---------|
| 2026-02-03 | v1.0 | 初始版本 | - | [查看](#) |
**页面调试情况**
| 日期 | 调试页面 | 问题记录 | 解决方案 | 状态 |
|------|---------|---------|---------|------|
| 2026-02-03 | - | 后端开发中 | - | 后端开发中 |
**接口状态**: 后端开发中
**备注**:
- 参数:
- `k`(可选):搜索文件名
- `page`:页码,从 0 开始
- `limit`:每页数量
- 返回数据结构:
```javascript
{
code: 1,
data: {
list: [
{
meta_id: 123, // 文件ID
name: "文件名称", // 文件名称
src: "https://...", // 文件URL
created_time: "2026-02-03 12:00:00", // 收藏时间
size: "1.2MB" // 文件大小
}
]
}
}
```
- 后端接口开发中
- 实现位置:`src/api/favorite.js:listAPI`
---
### 模块模板
复制下方模板添加新接口:
......@@ -699,6 +814,7 @@
- [✅ 已完成](#产品模块) - 2个接口
- [❌ 已废弃](#通用模块) - 3个接口
- [⏳ 后端开发中](#消息模块) - 2个接口
- [⏳ 后端开发中](#收藏模块) - 3个接口
### 按模块查看
- [用户中心](#用户中心模块) - ✅ 6个已完成
......@@ -706,6 +822,7 @@
- [意见反馈](#意见反馈模块) - ✅ 2个已完成
- [产品](#产品模块) - ✅ 2个已完成
- [消息](#消息模块) - ⏳ 2个后端开发中
- [收藏](#收藏模块) - ⏳ 3个后端开发中
- [知识库](#知识库模块) - ⏳ 未开始
- [家办](#家办模块) - ⏳ 未开始
- [签单](#签单模块) - ⏳ 未开始
......@@ -742,19 +859,16 @@
---
**最后更新时间**: 2026-02-03 20:00
**文档版本**: v1.8
**最后更新时间**: 2026-02-03 20:30
**文档版本**: v1.9
**更新内容**:
- 用户中心模块 v1.2 修复:2个接口
- 获取个人信息(getProfileAPI):✅ 已修复
- 修复头像字段结构从 avatar_url 字符串改为 avatar 对象
- 修复 mine 页面头像显示问题(userInfo.avatar?.src)
- 更新个人资料(updateProfileAPI):✅ 已修复
- 修复参数结构从 avatar_meta_id 改为完整 avatar 对象
- 修复上传接口响应数据映射(正确提取 name、hash、src、height、width、size 字段)
- 添加页面加载时获取当前头像功能
- 更新总体进度:16个接口(11个已完成,3个已废弃,2个后端开发中)
- 新增收藏模块:3个接口
- 添加收藏(addAPI):⏳ 后端开发中
- 取消收藏(delAPI):⏳ 后端开发中
- 收藏列表(listAPI):⏳ 后端开发中
- 更新总体进度:19个接口(11个已完成,3个已废弃,5个后端开发中)
**历史版本**:
- v1.8 (2026-02-03 20:00): 用户中心模块头像接口修复
- v1.7 (2026-02-03 23:30): 产品模块联调完成
- v1.6 (2026-02-02): 意见反馈模块联调完成
......
# 收藏
## OpenAPI Specification
```yaml
openapi: 3.0.1
info:
title: ''
version: 1.0.0
paths:
/srv/:
post:
summary: 收藏
deprecated: false
description: ''
tags:
- 收藏
parameters:
- name: f
in: query
description: ''
required: true
example: jiangedianlv
schema:
type: string
- name: a
in: query
description: ''
required: true
example: common
schema:
type: string
- name: t
in: query
description: ''
required: true
example: submit_feedback
schema:
type: string
requestBody:
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
f:
example: manulife
type: string
a:
example: favorite
type: string
t:
example: add
type: string
meta_id:
description: 文件ID
example: ''
type: string
required:
- f
- a
- t
- meta_id
examples: {}
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
properties:
code:
type: integer
msg:
type: string
required:
- code
- msg
x-apifox-orders:
- code
- msg
headers: {}
x-apifox-name: 成功
x-apifox-ordering: 0
security: []
x-apifox-folder: 收藏
x-apifox-status: developing
x-run-in-apifox: https://app.apifox.com/web/project/7792797/apis/api-414792186-run
components:
schemas: {}
responses: {}
securitySchemes: {}
servers: []
security: []
```
# 取消收藏
## OpenAPI Specification
```yaml
openapi: 3.0.1
info:
title: ''
version: 1.0.0
paths:
/srv/:
post:
summary: 取消收藏
deprecated: false
description: ''
tags:
- 收藏
parameters:
- name: f
in: query
description: ''
required: true
example: jiangedianlv
schema:
type: string
- name: a
in: query
description: ''
required: true
example: common
schema:
type: string
- name: t
in: query
description: ''
required: true
example: submit_feedback
schema:
type: string
requestBody:
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
f:
example: manulife
type: string
a:
example: favorite
type: string
t:
example: del
type: string
meta_id:
type: integer
description: 文件ID
example: 0
required:
- f
- a
- t
- meta_id
examples: {}
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
properties:
code:
type: integer
msg:
type: string
required:
- code
- msg
x-apifox-orders:
- code
- msg
headers: {}
x-apifox-name: 成功
x-apifox-ordering: 0
security: []
x-apifox-folder: 收藏
x-apifox-status: developing
x-run-in-apifox: https://app.apifox.com/web/project/7792797/apis/api-414792556-run
components:
schemas: {}
responses: {}
securitySchemes: {}
servers: []
security: []
```
# 收藏列表
## OpenAPI Specification
```yaml
openapi: 3.0.1
info:
title: ''
version: 1.0.0
paths:
/srv/:
get:
summary: 收藏列表
deprecated: false
description: ''
tags:
- 收藏
parameters:
- name: f
in: query
description: ''
required: true
example: manulife
schema:
type: string
- name: a
in: query
description: ''
required: true
example: favorite
schema:
type: string
- name: t
in: query
description: ''
required: true
example: list
schema:
type: string
- name: k
in: query
description: 搜索文件名
required: false
schema:
type: string
- name: page
in: query
description: 页码,从0开始
required: true
example: '0'
schema:
type: string
- name: limit
in: query
description: 每页数量
required: true
example: '10'
schema:
type: string
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
properties:
code:
type: integer
msg:
type: string
data:
type: object
properties:
list:
type: array
items:
type: object
properties:
meta_id:
type: integer
title: 文件ID
name:
type: string
title: 文件名称
src:
type: string
title: 文件URL
created_time:
type: string
title: 收藏时间
size:
type: string
title: 文件大小
x-apifox-orders:
- meta_id
- name
- src
- created_time
- size
required:
- size
required:
- list
x-apifox-orders:
- list
required:
- code
- msg
- data
x-apifox-orders:
- code
- msg
- data
headers: {}
x-apifox-name: 成功
x-apifox-ordering: 0
security: []
x-apifox-folder: 收藏
x-apifox-status: developing
x-run-in-apifox: https://app.apifox.com/web/project/7792797/apis/api-414792151-run
components:
schemas: {}
responses: {}
securitySchemes: {}
servers: []
security: []
```
import { fn, fetch } from '@/api/fn';
const Api = {
Add: '/srv/?a=favorite&t=add',
Del: '/srv/?a=favorite&t=del',
List: '/srv/?a=favorite&t=list',
}
/**
* @description 收藏
* @remark
* @param {Object} params 请求参数
* @param {string} params.meta_id 文件ID
* @returns {Promise<{
* code: number; // 状态码
* msg: string; // 消息
* data: any;
* }>}
*/
export const addAPI = (params) => fn(fetch.post(Api.Add, params));
/**
* @description 取消收藏
* @remark
* @param {Object} params 请求参数
* @param {integer} params.meta_id 文件ID
* @returns {Promise<{
* code: number; // 状态码
* msg: string; // 消息
* data: any;
* }>}
*/
export const delAPI = (params) => fn(fetch.post(Api.Del, params));
/**
* @description 收藏列表
* @remark
* @param {Object} params 请求参数
* @param {string} params.k (可选) 搜索文件名
* @param {string} params.page 页码,从0开始
* @param {string} params.limit 每页数量
* @returns {Promise<{
* code: number; // 状态码
* msg: string; // 消息
* data: {
* list: Array<{
* meta_id: integer; // 文件ID
* name: string; // 文件名称
* src: string; // 文件URL
* created_time: string; // 收藏时间
* size: string; // 文件大小
* }>;
* };
* }>}
*/
export const listAPI = (params) => fn(fetch.get(Api.List, params));
......@@ -70,15 +70,9 @@ export const logoutAPI = (params) => fn(fetch.post(Api.Logout, params));
/**
* @description 更新个人资料
* @remark
* @remark
* @param {Object} params 请求参数
* @param {Object} params.avatar - 头像对象(完整结构)
* @param {string} params.avatar.name - 文件名
* @param {string} params.avatar.hash - 文件hash
* @param {string} params.avatar.src - 文件地址
* @param {string} params.avatar.height - 文件高度
* @param {string} params.avatar.width - 文件宽度
* @param {number} params.avatar.size - 文件大小
* @param {object} params.avatar
* @returns {Promise<{
* code: number; // 状态码
* msg: string; // 消息
......