hookehuyr

feat(plan): 完善计划书 API 接口定义

- 修复 list.md 的 OpenAPI 文档格式问题(重复内容、YAML 结构错误)
- 新增 delete.md 和 view.md API 规范文档
- 重新生成 plan.js,补充完整的 4 个接口(add, delete, view, list)
- 为 deleteAPI 和 viewAPI 添加参数说明(params.i)
- 为 listAPI 添加详细的参数说明(status, keyword, limit, page)
- 优化 JSDoc 类型注释(integer → number)
- 添加完整的返回值类型定义

影响文件:
- docs/api-specs/plan/list.md (格式修复)
- docs/api-specs/plan/delete.md (新增)
- docs/api-specs/plan/view.md (新增)
- src/api/plan.js (接口补充)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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: false
23 + example: manulife
24 + schema:
25 + type: string
26 + - name: a
27 + in: query
28 + description: ''
29 + required: false
30 + example: proposal
31 + schema:
32 + type: string
33 + - name: t
34 + in: query
35 + description: ''
36 + required: false
37 + example: delete
38 + schema:
39 + type: string
40 + - name: i
41 + in: query
42 + description: 计划书id
43 + required: false
44 + schema:
45 + type: string
46 + responses:
47 + '200':
48 + description: ''
49 + content:
50 + application/json:
51 + schema:
52 + type: object
53 + properties:
54 + code:
55 + type: integer
56 + msg:
57 + type: string
58 + required:
59 + - code
60 + - msg
61 + x-apifox-orders:
62 + - code
63 + - msg
64 + example:
65 + code: 1
66 + msg: 订单删除成功
67 + headers: {}
68 + x-apifox-name: 成功
69 + x-apifox-ordering: 0
70 + security: []
71 + x-apifox-folder: 计划书
72 + x-apifox-status: developing
73 + x-run-in-apifox: https://app.apifox.com/web/project/7792797/apis/api-417901038-run
74 +components:
75 + schemas: {}
76 + responses: {}
77 + securitySchemes: {}
78 +servers:
79 + - url: https://manulife.onwall.cn
80 + description: 正式环境
81 +security: []
82 +
83 +```
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
5 ```yaml 5 ```yaml
6 openapi: 3.0.1 6 openapi: 3.0.1
7 info: 7 info:
8 - title: '' 8 + title: 计划书列表
9 version: 1.0.0 9 version: 1.0.0
10 paths: 10 paths:
11 /srv/: 11 /srv/:
...@@ -37,6 +37,32 @@ paths: ...@@ -37,6 +37,32 @@ paths:
37 example: list 37 example: list
38 schema: 38 schema:
39 type: string 39 type: string
40 + - name: status
41 + in: query
42 + description: '3:待处理,5:处理中,7:已生成,9:已查看'
43 + required: false
44 + schema:
45 + type: string
46 + - name: keyword
47 + in: query
48 + description: ''
49 + required: false
50 + schema:
51 + type: string
52 + - name: limit
53 + in: query
54 + description: ''
55 + required: false
56 + example: '10'
57 + schema:
58 + type: string
59 + - name: page
60 + in: query
61 + description: ''
62 + required: false
63 + example: '0'
64 + schema:
65 + type: string
40 responses: 66 responses:
41 '200': 67 '200':
42 description: '' 68 description: ''
...@@ -167,6 +193,4 @@ components: ...@@ -167,6 +193,4 @@ components:
167 servers: 193 servers:
168 - url: https://manulife.onwall.cn 194 - url: https://manulife.onwall.cn
169 description: 正式环境 195 description: 正式环境
170 -security: []
171 -
172 ``` 196 ```
......
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: false
23 + example: manulife
24 + schema:
25 + type: string
26 + - name: a
27 + in: query
28 + description: ''
29 + required: false
30 + example: proposal
31 + schema:
32 + type: string
33 + - name: t
34 + in: query
35 + description: ''
36 + required: false
37 + example: view
38 + schema:
39 + type: string
40 + - name: i
41 + in: query
42 + description: 计划书id
43 + required: false
44 + example: '2769908'
45 + schema:
46 + type: string
47 + responses:
48 + '200':
49 + description: ''
50 + content:
51 + application/json:
52 + schema:
53 + type: object
54 + properties:
55 + code:
56 + type: integer
57 + msg:
58 + type: string
59 + required:
60 + - code
61 + - msg
62 + x-apifox-orders:
63 + - code
64 + - msg
65 + example:
66 + code: 1
67 + msg: 订单状态已更新为已查看
68 + headers: {}
69 + x-apifox-name: 成功
70 + x-apifox-ordering: 0
71 + security: []
72 + x-apifox-folder: 计划书
73 + x-apifox-status: developing
74 + x-run-in-apifox: https://app.apifox.com/web/project/7792797/apis/api-417872149-run
75 +components:
76 + schemas: {}
77 + responses: {}
78 + securitySchemes: {}
79 +servers:
80 + - url: https://manulife.onwall.cn
81 + description: 正式环境
82 +security: []
83 +
84 +```
...@@ -2,62 +2,88 @@ import { fn, fetch } from '@/api/fn'; ...@@ -2,62 +2,88 @@ import { fn, fetch } from '@/api/fn';
2 2
3 const Api = { 3 const Api = {
4 Add: '/srv/?a=proposal&t=add', 4 Add: '/srv/?a=proposal&t=add',
5 + Delete: '/srv/?a=proposal&t=delete',
6 + View: '/srv/?a=proposal&t=view',
5 List: '/srv/?a=proposal&t=list', 7 List: '/srv/?a=proposal&t=list',
6 -} 8 +};
7 9
8 /** 10 /**
9 * @description 新增计划书 11 * @description 新增计划书
10 - * @remark
11 * @param {Object} params 请求参数 12 * @param {Object} params 请求参数
12 * @param {string} params.customer_name 申请人 13 * @param {string} params.customer_name 申请人
13 * @param {string} params.customer_gender 性别 14 * @param {string} params.customer_gender 性别
14 - * @param {integer} params.customer_age 年龄 15 + * @param {number} params.customer_age 年龄
15 * @param {string} params.customer_birthday 出生年月日 16 * @param {string} params.customer_birthday 出生年月日
16 - * @param {integer} params.annual_premium 保额 17 + * @param {number} params.annual_premium 保额
17 - * @param {string} params.payment_years 繳費年期 18 + * @param {string} params.payment_years 缴费年期
18 * @param {string} params.currency_type 币种 19 * @param {string} params.currency_type 币种
19 * @param {string} params.allow_reduce_amount 是否容许减少名义金额 20 * @param {string} params.allow_reduce_amount 是否容许减少名义金额
20 * @param {string} params.withdrawal_option 提取选项 21 * @param {string} params.withdrawal_option 提取选项
21 - * @param {integer} params.withdrawal_start_age 提取开始年龄 22 + * @param {number} params.withdrawal_start_age 提取开始年龄
22 - * @param {integer} params.withdrawal_period 提取期(年) 23 + * @param {number} params.withdrawal_period 提取期(年)
23 * @param {string} params.smoking_status 是否吸烟 24 * @param {string} params.smoking_status 是否吸烟
24 - * @param {integer} params.total_premium 总保费金额 25 + * @param {number} params.total_premium 总保费金额
25 - * @param {integer} params.product_id 产品id 26 + * @param {number} params.product_id 产品id
26 * @returns {Promise<{ 27 * @returns {Promise<{
27 * code: number; // 状态码 28 * code: number; // 状态码
28 * msg: string; // 消息 29 * msg: string; // 消息
29 * data: { 30 * data: {
30 - order_id: string; // 31 + * order_id: string; // 订单ID
31 * }; 32 * };
32 * }>} 33 * }>}
33 */ 34 */
34 export const addAPI = (params) => fn(fetch.post(Api.Add, params)); 35 export const addAPI = (params) => fn(fetch.post(Api.Add, params));
35 36
36 /** 37 /**
38 + * @description 删除计划书
39 + * @param {Object} params 请求参数
40 + * @param {string} params.i 计划书id
41 + * @returns {Promise<{
42 + * code: number; // 状态码
43 + * msg: string; // 消息
44 + * }>}
45 + */
46 +export const deleteAPI = (params) => fn(fetch.post(Api.Delete, params));
47 +
48 +/**
49 + * @description 查看计划书
50 + * @param {Object} params 请求参数
51 + * @param {string} params.i 计划书id
52 + * @returns {Promise<{
53 + * code: number; // 状态码
54 + * msg: string; // 消息
55 + * }>}
56 + */
57 +export const viewAPI = (params) => fn(fetch.post(Api.View, params));
58 +
59 +/**
37 * @description 计划书列表 60 * @description 计划书列表
38 - * @remark
39 * @param {Object} params 请求参数 61 * @param {Object} params 请求参数
62 + * @param {string} [params.status] 状态筛选(3:待处理,5:处理中,7:已生成,9:已查看)
63 + * @param {string} [params.keyword] 搜索关键词
64 + * @param {string} [params.limit] 每页数量(默认10)
65 + * @param {string} [params.page] 页码(默认0)
40 * @returns {Promise<{ 66 * @returns {Promise<{
41 * code: number; // 状态码 67 * code: number; // 状态码
42 * msg: string; // 消息 68 * msg: string; // 消息
43 * data: { 69 * data: {
44 - list: Array<{ 70 + * list: Array<{
45 - id: integer; // 71 + * id: number; // 计划书id
46 - customer_name: string; // 申请人 72 + * customer_name: string; // 申请人
47 - product_name: string; // 产品名 73 + * product_name: string; // 产品名
48 - categories: Array<{ 74 + * categories: Array<{
49 - id: string; // 分类id 75 + * id: string; // 分类id
50 - name: string; // 分类名 76 + * name: string; // 分类名
51 - }>; 77 + * }>; // 分类
52 - created_time: string; // 创建时间 78 + * created_time: string; // 创建时间
53 - order_status: string; // 状态 79 + * order_status: string; // 状态
54 - proposal_files: Array<{ 80 + * proposal_files: Array<{
55 - file_name: string; // 名称 81 + * file_name: string; // 文件名称
56 - file_url: string; // 地址 82 + * file_url: string; // 文件地址
57 - id: integer; // 83 + * id: number; // 文件id
58 - }>; 84 + * }>; // 生成的计划书
59 - }>; 85 + * }>; // 计划书列表
60 - total: string; // 86 + * total: string; // 总数
61 * }; 87 * };
62 * }>} 88 * }>}
63 */ 89 */
......