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 @@ ...@@ -4,11 +4,11 @@
4 4
5 ## 📊 总体进度 5 ## 📊 总体进度
6 6
7 -- **总接口数**: 16 7 +- **总接口数**: 19
8 -- **已完成**: 11 (68.8%) 8 +- **已完成**: 11 (57.9%)
9 - **联调中**: 0 (0%) 9 - **联调中**: 0 (0%)
10 -- **已废弃**: 3 (18.8%) 10 +- **已废弃**: 3 (15.8%)
11 -- **后端开发中**: 2 (12.5%) 11 +- **后端开发中**: 5 (26.3%)
12 - **有阻塞**: 0 12 - **有阻塞**: 0
13 13
14 --- 14 ---
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
19 -**修复头像上传接口数据映射错误**:根据实际返回结构正确映射字段 19 -**修复头像上传接口数据映射错误**:根据实际返回结构正确映射字段
20 -**新增头像设置页面加载时获取用户当前头像功能**:提升用户体验 20 -**新增头像设置页面加载时获取用户当前头像功能**:提升用户体验
21 -**更新 API 文档**:完善 get_profile 和 update_profile 接口文档 21 -**更新 API 文档**:完善 get_profile 和 update_profile 接口文档
22 +- 🆕 **新增收藏模块**:添加 3 个收藏接口(addAPI、delAPI、listAPI),后端开发中
22 23
23 --- 24 ---
24 25
...@@ -615,6 +616,120 @@ ...@@ -615,6 +616,120 @@
615 616
616 --- 617 ---
617 618
619 +### 收藏模块
620 +
621 +#### 接口 1: 添加收藏
622 +
623 +**接口信息**
624 +- **接口名称**: `addAPI`
625 +- **接口路径**: `/srv/?a=favorite&t=add`
626 +- **请求方法**: POST
627 +- **负责页面**: 待确认(产品详情页、资料详情页等)
628 +- **负责人**: 后端团队
629 +
630 +**接口文档更新记录**
631 +
632 +| 日期 | 版本 | 变更内容 | 变更原因 | 文档链接 |
633 +|------|------|---------|---------|---------|
634 +| 2026-02-03 | v1.0 | 初始版本 | - | [查看](#) |
635 +
636 +**页面调试情况**
637 +
638 +| 日期 | 调试页面 | 问题记录 | 解决方案 | 状态 |
639 +|------|---------|---------|---------|------|
640 +| 2026-02-03 | - | 后端开发中 | - | 后端开发中 |
641 +
642 +**接口状态**: 后端开发中
643 +
644 +**备注**:
645 +- 参数:`meta_id`(文件ID)
646 +- 用于收藏产品或资料
647 +- 后端接口开发中
648 +- 实现位置:`src/api/favorite.js:addAPI`
649 +
650 +---
651 +
652 +#### 接口 2: 取消收藏
653 +
654 +**接口信息**
655 +- **接口名称**: `delAPI`
656 +- **接口路径**: `/srv/?a=favorite&t=del`
657 +- **请求方法**: POST
658 +- **负责页面**: 待确认(收藏列表页)
659 +- **负责人**: 后端团队
660 +
661 +**接口文档更新记录**
662 +
663 +| 日期 | 版本 | 变更内容 | 变更原因 | 文档链接 |
664 +|------|------|---------|---------|---------|
665 +| 2026-02-03 | v1.0 | 初始版本 | - | [查看](#) |
666 +
667 +**页面调试情况**
668 +
669 +| 日期 | 调试页面 | 问题记录 | 解决方案 | 状态 |
670 +|------|---------|---------|---------|------|
671 +| 2026-02-03 | - | 后端开发中 | - | 后端开发中 |
672 +
673 +**接口状态**: 后端开发中
674 +
675 +**备注**:
676 +- 参数:`meta_id`(文件ID)
677 +- 用于取消收藏的产品或资料
678 +- 后端接口开发中
679 +- 实现位置:`src/api/favorite.js:delAPI`
680 +
681 +---
682 +
683 +#### 接口 3: 收藏列表
684 +
685 +**接口信息**
686 +- **接口名称**: `listAPI`
687 +- **接口路径**: `/srv/?a=favorite&t=list`
688 +- **请求方法**: GET
689 +- **负责页面**: 待确认(我的收藏页面)
690 +- **负责人**: 后端团队
691 +
692 +**接口文档更新记录**
693 +
694 +| 日期 | 版本 | 变更内容 | 变更原因 | 文档链接 |
695 +|------|------|---------|---------|---------|
696 +| 2026-02-03 | v1.0 | 初始版本 | - | [查看](#) |
697 +
698 +**页面调试情况**
699 +
700 +| 日期 | 调试页面 | 问题记录 | 解决方案 | 状态 |
701 +|------|---------|---------|---------|------|
702 +| 2026-02-03 | - | 后端开发中 | - | 后端开发中 |
703 +
704 +**接口状态**: 后端开发中
705 +
706 +**备注**:
707 +- 参数:
708 + - `k`(可选):搜索文件名
709 + - `page`:页码,从 0 开始
710 + - `limit`:每页数量
711 +- 返回数据结构:
712 + ```javascript
713 + {
714 + code: 1,
715 + data: {
716 + list: [
717 + {
718 + meta_id: 123, // 文件ID
719 + name: "文件名称", // 文件名称
720 + src: "https://...", // 文件URL
721 + created_time: "2026-02-03 12:00:00", // 收藏时间
722 + size: "1.2MB" // 文件大小
723 + }
724 + ]
725 + }
726 + }
727 + ```
728 +- 后端接口开发中
729 +- 实现位置:`src/api/favorite.js:listAPI`
730 +
731 +---
732 +
618 ### 模块模板 733 ### 模块模板
619 734
620 复制下方模板添加新接口: 735 复制下方模板添加新接口:
...@@ -699,6 +814,7 @@ ...@@ -699,6 +814,7 @@
699 - [✅ 已完成](#产品模块) - 2个接口 814 - [✅ 已完成](#产品模块) - 2个接口
700 - [❌ 已废弃](#通用模块) - 3个接口 815 - [❌ 已废弃](#通用模块) - 3个接口
701 - [⏳ 后端开发中](#消息模块) - 2个接口 816 - [⏳ 后端开发中](#消息模块) - 2个接口
817 +- [⏳ 后端开发中](#收藏模块) - 3个接口
702 818
703 ### 按模块查看 819 ### 按模块查看
704 - [用户中心](#用户中心模块) - ✅ 6个已完成 820 - [用户中心](#用户中心模块) - ✅ 6个已完成
...@@ -706,6 +822,7 @@ ...@@ -706,6 +822,7 @@
706 - [意见反馈](#意见反馈模块) - ✅ 2个已完成 822 - [意见反馈](#意见反馈模块) - ✅ 2个已完成
707 - [产品](#产品模块) - ✅ 2个已完成 823 - [产品](#产品模块) - ✅ 2个已完成
708 - [消息](#消息模块) - ⏳ 2个后端开发中 824 - [消息](#消息模块) - ⏳ 2个后端开发中
825 +- [收藏](#收藏模块) - ⏳ 3个后端开发中
709 - [知识库](#知识库模块) - ⏳ 未开始 826 - [知识库](#知识库模块) - ⏳ 未开始
710 - [家办](#家办模块) - ⏳ 未开始 827 - [家办](#家办模块) - ⏳ 未开始
711 - [签单](#签单模块) - ⏳ 未开始 828 - [签单](#签单模块) - ⏳ 未开始
...@@ -742,19 +859,16 @@ ...@@ -742,19 +859,16 @@
742 859
743 --- 860 ---
744 861
745 -**最后更新时间**: 2026-02-03 20:00 862 +**最后更新时间**: 2026-02-03 20:30
746 -**文档版本**: v1.8 863 +**文档版本**: v1.9
747 **更新内容**: 864 **更新内容**:
748 -- 用户中心模块 v1.2 修复:2个接口 865 +- 新增收藏模块:3个接口
749 - - 获取个人信息(getProfileAPI):✅ 已修复 866 + - 添加收藏(addAPI):⏳ 后端开发中
750 - - 修复头像字段结构从 avatar_url 字符串改为 avatar 对象 867 + - 取消收藏(delAPI):⏳ 后端开发中
751 - - 修复 mine 页面头像显示问题(userInfo.avatar?.src) 868 + - 收藏列表(listAPI):⏳ 后端开发中
752 - - 更新个人资料(updateProfileAPI):✅ 已修复 869 +- 更新总体进度:19个接口(11个已完成,3个已废弃,5个后端开发中)
753 - - 修复参数结构从 avatar_meta_id 改为完整 avatar 对象
754 - - 修复上传接口响应数据映射(正确提取 name、hash、src、height、width、size 字段)
755 - - 添加页面加载时获取当前头像功能
756 -- 更新总体进度:16个接口(11个已完成,3个已废弃,2个后端开发中)
757 870
758 **历史版本**: 871 **历史版本**:
872 +- v1.8 (2026-02-03 20:00): 用户中心模块头像接口修复
759 - v1.7 (2026-02-03 23:30): 产品模块联调完成 873 - v1.7 (2026-02-03 23:30): 产品模块联调完成
760 - v1.6 (2026-02-02): 意见反馈模块联调完成 874 - v1.6 (2026-02-02): 意见反馈模块联调完成
......
1 +# 收藏
2 +
3 +## OpenAPI Specification
4 +
5 +```yaml
6 +openapi: 3.0.1
7 +info:
8 + title: ''
9 + version: 1.0.0
10 +paths:
11 + /srv/:
12 + post:
13 + summary: 收藏
14 + deprecated: false
15 + description: ''
16 + tags:
17 + - 收藏
18 + parameters:
19 + - name: f
20 + in: query
21 + description: ''
22 + required: true
23 + example: jiangedianlv
24 + schema:
25 + type: string
26 + - name: a
27 + in: query
28 + description: ''
29 + required: true
30 + example: common
31 + schema:
32 + type: string
33 + - name: t
34 + in: query
35 + description: ''
36 + required: true
37 + example: submit_feedback
38 + schema:
39 + type: string
40 + requestBody:
41 + content:
42 + application/x-www-form-urlencoded:
43 + schema:
44 + type: object
45 + properties:
46 + f:
47 + example: manulife
48 + type: string
49 + a:
50 + example: favorite
51 + type: string
52 + t:
53 + example: add
54 + type: string
55 + meta_id:
56 + description: 文件ID
57 + example: ''
58 + type: string
59 + required:
60 + - f
61 + - a
62 + - t
63 + - meta_id
64 + examples: {}
65 + responses:
66 + '200':
67 + description: ''
68 + content:
69 + application/json:
70 + schema:
71 + type: object
72 + properties:
73 + code:
74 + type: integer
75 + msg:
76 + type: string
77 + required:
78 + - code
79 + - msg
80 + x-apifox-orders:
81 + - code
82 + - msg
83 + headers: {}
84 + x-apifox-name: 成功
85 + x-apifox-ordering: 0
86 + security: []
87 + x-apifox-folder: 收藏
88 + x-apifox-status: developing
89 + x-run-in-apifox: https://app.apifox.com/web/project/7792797/apis/api-414792186-run
90 +components:
91 + schemas: {}
92 + responses: {}
93 + securitySchemes: {}
94 +servers: []
95 +security: []
96 +
97 +```
1 +# 取消收藏
2 +
3 +## OpenAPI Specification
4 +
5 +```yaml
6 +openapi: 3.0.1
7 +info:
8 + title: ''
9 + version: 1.0.0
10 +paths:
11 + /srv/:
12 + post:
13 + summary: 取消收藏
14 + deprecated: false
15 + description: ''
16 + tags:
17 + - 收藏
18 + parameters:
19 + - name: f
20 + in: query
21 + description: ''
22 + required: true
23 + example: jiangedianlv
24 + schema:
25 + type: string
26 + - name: a
27 + in: query
28 + description: ''
29 + required: true
30 + example: common
31 + schema:
32 + type: string
33 + - name: t
34 + in: query
35 + description: ''
36 + required: true
37 + example: submit_feedback
38 + schema:
39 + type: string
40 + requestBody:
41 + content:
42 + application/x-www-form-urlencoded:
43 + schema:
44 + type: object
45 + properties:
46 + f:
47 + example: manulife
48 + type: string
49 + a:
50 + example: favorite
51 + type: string
52 + t:
53 + example: del
54 + type: string
55 + meta_id:
56 + type: integer
57 + description: 文件ID
58 + example: 0
59 + required:
60 + - f
61 + - a
62 + - t
63 + - meta_id
64 + examples: {}
65 + responses:
66 + '200':
67 + description: ''
68 + content:
69 + application/json:
70 + schema:
71 + type: object
72 + properties:
73 + code:
74 + type: integer
75 + msg:
76 + type: string
77 + required:
78 + - code
79 + - msg
80 + x-apifox-orders:
81 + - code
82 + - msg
83 + headers: {}
84 + x-apifox-name: 成功
85 + x-apifox-ordering: 0
86 + security: []
87 + x-apifox-folder: 收藏
88 + x-apifox-status: developing
89 + x-run-in-apifox: https://app.apifox.com/web/project/7792797/apis/api-414792556-run
90 +components:
91 + schemas: {}
92 + responses: {}
93 + securitySchemes: {}
94 +servers: []
95 +security: []
96 +
97 +```
1 +# 收藏列表
2 +
3 +## OpenAPI Specification
4 +
5 +```yaml
6 +openapi: 3.0.1
7 +info:
8 + title: ''
9 + version: 1.0.0
10 +paths:
11 + /srv/:
12 + get:
13 + summary: 收藏列表
14 + deprecated: false
15 + description: ''
16 + tags:
17 + - 收藏
18 + parameters:
19 + - name: f
20 + in: query
21 + description: ''
22 + required: true
23 + example: manulife
24 + schema:
25 + type: string
26 + - name: a
27 + in: query
28 + description: ''
29 + required: true
30 + example: favorite
31 + schema:
32 + type: string
33 + - name: t
34 + in: query
35 + description: ''
36 + required: true
37 + example: list
38 + schema:
39 + type: string
40 + - name: k
41 + in: query
42 + description: 搜索文件名
43 + required: false
44 + schema:
45 + type: string
46 + - name: page
47 + in: query
48 + description: 页码,从0开始
49 + required: true
50 + example: '0'
51 + schema:
52 + type: string
53 + - name: limit
54 + in: query
55 + description: 每页数量
56 + required: true
57 + example: '10'
58 + schema:
59 + type: string
60 + responses:
61 + '200':
62 + description: ''
63 + content:
64 + application/json:
65 + schema:
66 + type: object
67 + properties:
68 + code:
69 + type: integer
70 + msg:
71 + type: string
72 + data:
73 + type: object
74 + properties:
75 + list:
76 + type: array
77 + items:
78 + type: object
79 + properties:
80 + meta_id:
81 + type: integer
82 + title: 文件ID
83 + name:
84 + type: string
85 + title: 文件名称
86 + src:
87 + type: string
88 + title: 文件URL
89 + created_time:
90 + type: string
91 + title: 收藏时间
92 + size:
93 + type: string
94 + title: 文件大小
95 + x-apifox-orders:
96 + - meta_id
97 + - name
98 + - src
99 + - created_time
100 + - size
101 + required:
102 + - size
103 + required:
104 + - list
105 + x-apifox-orders:
106 + - list
107 + required:
108 + - code
109 + - msg
110 + - data
111 + x-apifox-orders:
112 + - code
113 + - msg
114 + - data
115 + headers: {}
116 + x-apifox-name: 成功
117 + x-apifox-ordering: 0
118 + security: []
119 + x-apifox-folder: 收藏
120 + x-apifox-status: developing
121 + x-run-in-apifox: https://app.apifox.com/web/project/7792797/apis/api-414792151-run
122 +components:
123 + schemas: {}
124 + responses: {}
125 + securitySchemes: {}
126 +servers: []
127 +security: []
128 +
129 +```
1 +import { fn, fetch } from '@/api/fn';
2 +
3 +const Api = {
4 + Add: '/srv/?a=favorite&t=add',
5 + Del: '/srv/?a=favorite&t=del',
6 + List: '/srv/?a=favorite&t=list',
7 +}
8 +
9 +/**
10 + * @description 收藏
11 + * @remark
12 + * @param {Object} params 请求参数
13 + * @param {string} params.meta_id 文件ID
14 + * @returns {Promise<{
15 + * code: number; // 状态码
16 + * msg: string; // 消息
17 + * data: any;
18 + * }>}
19 + */
20 +export const addAPI = (params) => fn(fetch.post(Api.Add, params));
21 +
22 +/**
23 + * @description 取消收藏
24 + * @remark
25 + * @param {Object} params 请求参数
26 + * @param {integer} params.meta_id 文件ID
27 + * @returns {Promise<{
28 + * code: number; // 状态码
29 + * msg: string; // 消息
30 + * data: any;
31 + * }>}
32 + */
33 +export const delAPI = (params) => fn(fetch.post(Api.Del, params));
34 +
35 +/**
36 + * @description 收藏列表
37 + * @remark
38 + * @param {Object} params 请求参数
39 + * @param {string} params.k (可选) 搜索文件名
40 + * @param {string} params.page 页码,从0开始
41 + * @param {string} params.limit 每页数量
42 + * @returns {Promise<{
43 + * code: number; // 状态码
44 + * msg: string; // 消息
45 + * data: {
46 + * list: Array<{
47 + * meta_id: integer; // 文件ID
48 + * name: string; // 文件名称
49 + * src: string; // 文件URL
50 + * created_time: string; // 收藏时间
51 + * size: string; // 文件大小
52 + * }>;
53 + * };
54 + * }>}
55 + */
56 +export const listAPI = (params) => fn(fetch.get(Api.List, params));
...@@ -70,15 +70,9 @@ export const logoutAPI = (params) => fn(fetch.post(Api.Logout, params)); ...@@ -70,15 +70,9 @@ export const logoutAPI = (params) => fn(fetch.post(Api.Logout, params));
70 70
71 /** 71 /**
72 * @description 更新个人资料 72 * @description 更新个人资料
73 - * @remark 73 + * @remark
74 * @param {Object} params 请求参数 74 * @param {Object} params 请求参数
75 - * @param {Object} params.avatar - 头像对象(完整结构) 75 + * @param {object} params.avatar
76 - * @param {string} params.avatar.name - 文件名
77 - * @param {string} params.avatar.hash - 文件hash
78 - * @param {string} params.avatar.src - 文件地址
79 - * @param {string} params.avatar.height - 文件高度
80 - * @param {string} params.avatar.width - 文件宽度
81 - * @param {number} params.avatar.size - 文件大小
82 * @returns {Promise<{ 76 * @returns {Promise<{
83 * code: number; // 状态码 77 * code: number; // 状态码
84 * msg: string; // 消息 78 * msg: string; // 消息
......