--- title: 智慧环境 language_tabs: - shell: Shell - http: HTTP· - javascript: JavaScript - ruby: Ruby - python: Python - php: PHP - java: Java - go: Go toc_footers: [] includes: [] search: true code_clipboard: true highlight_theme: darkula headingLevel: 2 generator: "@tarslib/widdershins v4.0.28" --- # 智慧环境 Base URLs: # Authentication # 用户管理 ## POST 登录 POST /api/users/login > Body 请求参数 ```yaml username: admin password: admin123 ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |body|body|object| 否 |none| |» username|body|string| 否 |none| |» password|body|string| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": { "user": { "id": 0, "username": "string", "real_name": "string", "email": "string", "phone": null, "role_id": 0, "status": 0, "last_login": null, "created_at": "string" }, "token": "string" } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» user|object|true|none||none| |»»» id|integer|true|none||none| |»»» username|string|true|none||none| |»»» real_name|string|true|none||none| |»»» email|string|true|none||none| |»»» phone|null|true|none||none| |»»» role_id|integer|true|none||none| |»»» status|integer|true|none||none| |»»» last_login|null|true|none||none| |»»» created_at|string|true|none||none| |»» token|string|true|none||none| ## POST 创建用户 POST /api/users > Body 请求参数 ```yaml username: abc password: abc123 role_id: "3" real_name: 张三 email: 110@qq.com phone: "18888888888" status: "1" expire_time: "" ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| |» username|body|string| 否 |用户名(必选)| |» password|body|string| 否 |密码(必选)| |» role_id|body|string| 否 |角色ID(必选)| |» real_name|body|string| 否 |真实姓名可选,最大50个字符| |» email|body|string| 否 |邮箱可选,需要符合邮箱格式| |» phone|body|string| 否 |手机号可选,11位手机号,以1开头| |» status|body|string| 否 |状态可选,0表示禁用,1表示启用,默认为1| |» expire_time|body|string| 否 |过期时间可选,ISO格式的日期时间字符串| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": { "id": 0 } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» id|integer|true|none||none| ## PUT 更新用户 PUT /api/users/3 > Body 请求参数 ```yaml id: "3" real_name: 李四 email: 1234@qq.com phone: "18888887777" role_id: "" status: "" expire_time: "" password: "" ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| |» id|body|string| 否 |ID 编号| |» real_name|body|string| 否 |新的真实姓名可选,最大50个字符| |» email|body|string| 否 |新邮箱可选,需要符合邮箱格式| |» phone|body|string| 否 |新手机号可选,11位手机号| |» role_id|body|string| 否 |新角色ID可选,角色ID(1:超级管理员,2:管理人员,3:普通用户)| |» status|body|string| 否 |新状态可选,0:禁用,1:启用| |» expire_time|body|string| 否 |过期时间可选,ISO格式的日期时间| |» password|body|string| 否 |新密码可选,6-30个字符,必须包含字母和数字。都是可选的,但至少需要提供一个| > 返回示例 > 200 Response ```json { "success": true, "message": "string" } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| ## DELETE 删除用户 DELETE /api/users/3 ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |id|query|string| 否 |ID 编号| |Authorization|header|string| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string" } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| ## POST 重置用户密码 POST /api/users/3/reset-password > Body 请求参数 ```yaml id: "3" ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| |» id|body|string| 否 |ID 编号| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": { "tempPassword": "string" } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» tempPassword|string|true|none||none| # 角色管理接口 ## GET 获取所有角色 GET /api/roles ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": [ { "id": 0, "name": "string", "description": "string", "created_at": "string", "updated_at": "string", "permissions": [ { "id": 0, "name": "string", "code": "string", "description": "string", "created_at": "string" } ], "users": [ { "id": 0, "username": "string", "real_name": "string", "email": "string", "phone": null, "role_id": 0, "status": 0, "created_at": "string", "updated_at": "string" } ] } ] } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|[object]|true|none||none| |»» id|integer|true|none||none| |»» name|string|true|none||none| |»» description|string|true|none||none| |»» created_at|string|true|none||none| |»» updated_at|string|true|none||none| |»» permissions|[object]|true|none||none| |»»» id|integer|true|none||none| |»»» name|string|true|none||none| |»»» code|string|true|none||none| |»»» description|string|true|none||none| |»»» created_at|string|true|none||none| |»» users|[object]|true|none||none| |»»» id|integer|true|none||none| |»»» username|string|true|none||none| |»»» real_name|string|true|none||none| |»»» email|string¦null|true|none||none| |»»» phone|null|true|none||none| |»»» role_id|integer|true|none||none| |»»» status|integer|true|none||none| |»»» created_at|string|true|none||none| |»»» updated_at|string|true|none||none| ## POST 创建角色 POST /api/roles > Body 请求参数 ```yaml name: 运维人员 description: 负责系统运维工作 permissions: "[1, 2, 3]" ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| |» name|body|string| 否 |角色名称必填,最大50个字符| |» description|body|string| 否 |角色描述可选,最大500个字符| |» permissions|body|string| 否 |[1, 2, 3]可选,权限ID数组| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": { "id": 0 } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» id|integer|true|none||none| ## GET 获取单个角色 GET /api/roles/2 > Body 请求参数 ```yaml id: "2" ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| |» id|body|string| 否 |ID 编号| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": { "id": 0, "name": "string", "description": "string", "created_at": "string", "updated_at": "string", "permissions": [ "string" ] } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» id|integer|true|none||none| |»» name|string|true|none||none| |»» description|string|true|none||none| |»» created_at|string|true|none||none| |»» updated_at|string|true|none||none| |»» permissions|[string]|true|none||none| ## PUT 更新角色 PUT /api/roles/4 > Body 请求参数 ```json { "name": "测试人员", "description": "系统测试人员", "permissions": [ 1, 2, 3 ] } ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string" } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| ## DELETE 删除角色 DELETE /api/roles/4 > Body 请求参数 ```yaml id: "4" ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| |» id|body|string| 否 |ID 编号| > 返回示例 > 200 Response ```json { "success": true, "message": "string" } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| # 报告管理 ## GET 获取报告列表 GET /api/reports > Body 请求参数 ```json { "page": "数字,可选,默认1", "pageSize": "数字,可选,默认10", "status": "数字,可选,筛选状态", "startDate": "日期字符串,可选,筛选开始日期", "endDate": "日期字符串,可选,筛选结束日期", "keyword": "字符串,可选,搜索关键词" } ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 ```json { "success": true, "message": "获取报告列表成功", "data": [ { "id": 2, "report_code": "RPT202502130002", "template_id": 1, "title": "2024年2月13日湿地日常巡检报告", "content": { "基本信息": { "weather": "晴", "inspector": "张三", "temperature": 25, "inspection_time": "2024-02-13 09:00:00" }, "水质监测": { "ph_value": 7.2, "turbidity": 3.2, "dissolved_oxygen": 6.5, "water_temperature": 18 }, "生态观察": { "photos": [ "photo1.jpg", "photo2.jpg" ], "plant_status": "植物生长状况良好,未发现外来物种", "animal_observation": "观察到水鸟15只,其中包括..." } }, "start_date": "2024-02-12T16:00:00.000Z", "end_date": "2024-02-12T16:00:00.000Z", "status": 2, "reviewer_id": 1, "review_time": "2025-02-12T23:41:23.000Z", "review_comment": "这里是审核意见", "created_at": "2025-02-13T07:02:49.000Z", "updated_at": "2025-02-13T07:41:23.000Z", "created_by": 1, "updated_by": 1 }, { "id": 1, "report_code": "RPT202502130001", "template_id": 1, "title": "2024年2月13日湿地日常巡检报告", "content": { "基本信息": { "weather": "晴", "inspector": "张三", "temperature": 25, "inspection_time": "2024-02-13 09:00:00" }, "水质监测": { "ph_value": 7.2, "turbidity": 3.2, "dissolved_oxygen": 6.5, "water_temperature": 18 }, "生态观察": { "photos": [ "photo1.jpg", "photo2.jpg" ], "plant_status": "植物生长状况良好,未发现外来物种", "animal_observation": "观察到水鸟15只,其中包括..." } }, "start_date": "2024-02-12T16:00:00.000Z", "end_date": "2024-02-12T16:00:00.000Z", "status": 2, "reviewer_id": 1, "review_time": "2025-02-12T23:05:25.000Z", "review_comment": "这里是审核意见", "created_at": "2025-02-13T06:56:31.000Z", "updated_at": "2025-02-13T07:05:25.000Z", "created_by": 1, "updated_by": 1 } ] } ``` ```json { "success": true, "message": "获取报告列表成功", "data": [ { "id": 2, "report_code": "RPT202502130002", "template_id": 1, "title": "2024年2月13日湿地日常巡检报告", "content": { "基本信息": { "weather": "晴", "inspector": "张三", "temperature": 25, "inspection_time": "2024-02-13 09:00:00" }, "水质监测": { "ph_value": 7.2, "turbidity": 3.2, "dissolved_oxygen": 6.5, "water_temperature": 18 }, "生态观察": { "photos": [ "photo1.jpg", "photo2.jpg" ], "plant_status": "植物生长状况良好,未发现外来物种", "animal_observation": "观察到水鸟15只,其中包括..." } }, "start_date": "2024-02-12T16:00:00.000Z", "end_date": "2024-02-12T16:00:00.000Z", "status": 2, "reviewer_id": 1, "review_time": "2025-02-12T23:41:23.000Z", "review_comment": "这里是审核意见", "created_at": "2025-02-13T07:02:49.000Z", "updated_at": "2025-02-13T07:41:23.000Z", "created_by": 1, "updated_by": 1 }, { "id": 1, "report_code": "RPT202502130001", "template_id": 1, "title": "2024年2月13日湿地日常巡检报告", "content": { "基本信息": { "weather": "晴", "inspector": "张三", "temperature": 25, "inspection_time": "2024-02-13 09:00:00" }, "水质监测": { "ph_value": 7.2, "turbidity": 3.2, "dissolved_oxygen": 6.5, "water_temperature": 18 }, "生态观察": { "photos": [ "photo1.jpg", "photo2.jpg" ], "plant_status": "植物生长状况良好,未发现外来物种", "animal_observation": "观察到水鸟15只,其中包括..." } }, "start_date": "2024-02-12T16:00:00.000Z", "end_date": "2024-02-12T16:00:00.000Z", "status": 2, "reviewer_id": 1, "review_time": "2025-02-12T23:05:25.000Z", "review_comment": "这里是审核意见", "created_at": "2025-02-13T06:56:31.000Z", "updated_at": "2025-02-13T07:05:25.000Z", "created_by": 1, "updated_by": 1 } ] } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|[object]|true|none||none| |»» id|integer|true|none||none| |»» report_code|string|true|none||none| |»» template_id|integer|true|none||none| |»» title|string|true|none||none| |»» content|object|true|none||none| |»»» 基本信息|object|true|none||none| |»»»» weather|string|true|none||none| |»»»» inspector|string|true|none||none| |»»»» temperature|integer|true|none||none| |»»»» inspection_time|string|true|none||none| |»»» 水质监测|object|true|none||none| |»»»» ph_value|number|true|none||none| |»»»» turbidity|number|true|none||none| |»»»» dissolved_oxygen|number|true|none||none| |»»»» water_temperature|integer|true|none||none| |»»» 生态观察|object|true|none||none| |»»»» photos|[string]|true|none||none| |»»»» plant_status|string|true|none||none| |»»»» animal_observation|string|true|none||none| |»» start_date|string|true|none||none| |»» end_date|string|true|none||none| |»» status|integer|true|none||none| |»» reviewer_id|integer|true|none||none| |»» review_time|string|true|none||none| |»» review_comment|string|true|none||none| |»» created_at|string|true|none||none| |»» updated_at|string|true|none||none| |»» created_by|integer|true|none||none| |»» updated_by|integer|true|none||none| ## POST 创建报告 POST /api/reports > Body 请求参数 ```json { "template_id": 1, "title": "2024年2月13日湿地日常巡检报告", "content": { "基本信息": { "inspector": "张三", "inspection_time": "2024-02-13 09:00:00", "weather": "晴", "temperature": 25 }, "水质监测": { "water_temperature": 18, "ph_value": 7.2, "dissolved_oxygen": 6.5, "turbidity": 3.2 }, "生态观察": { "plant_status": "植物生长状况良好,未发现外来物种", "animal_observation": "观察到水鸟15只,其中包括...", "photos": [ "photo1.jpg", "photo2.jpg" ] } }, "start_date": "2024-02-13", "end_date": "2024-02-13" } ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": { "id": 0 } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» id|integer|true|none||none| ## GET 获取报告详情 GET /api/reports/1 ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": { "id": 0, "report_code": "string", "template_id": 0, "report_type": "string", "title": "string", "content": { "基本信息": { "weather": "string", "inspector": "string", "temperature": 0, "inspection_time": "string" }, "水质监测": { "ph_value": 0, "turbidity": 0, "dissolved_oxygen": 0, "water_temperature": 0 }, "生态观察": { "photos": [ "string" ], "plant_status": "string", "animal_observation": "string" } }, "start_date": "string", "end_date": "string", "status": 0, "reviewer_id": null, "review_time": null, "review_comment": null, "created_at": "string", "updated_at": "string", "created_by": 0, "updated_by": 0 } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» id|integer|true|none||none| |»» report_code|string|true|none||none| |»» template_id|integer|true|none||none| |»» report_type|string|true|none||none| |»» title|string|true|none||none| |»» content|object|true|none||none| |»»» 基本信息|object|true|none||none| |»»»» weather|string|true|none||none| |»»»» inspector|string|true|none||none| |»»»» temperature|integer|true|none||none| |»»»» inspection_time|string|true|none||none| |»»» 水质监测|object|true|none||none| |»»»» ph_value|number|true|none||none| |»»»» turbidity|number|true|none||none| |»»»» dissolved_oxygen|number|true|none||none| |»»»» water_temperature|integer|true|none||none| |»»» 生态观察|object|true|none||none| |»»»» photos|[string]|true|none||none| |»»»» plant_status|string|true|none||none| |»»»» animal_observation|string|true|none||none| |»» start_date|string|true|none||none| |»» end_date|string|true|none||none| |»» status|integer|true|none||none| |»» reviewer_id|null|true|none||none| |»» review_time|null|true|none||none| |»» review_comment|null|true|none||none| |»» created_at|string|true|none||none| |»» updated_at|string|true|none||none| |»» created_by|integer|true|none||none| |»» updated_by|integer|true|none||none| ## PUT 更新报告 PUT /api/reports/1 > Body 请求参数 ```json { "template_id": 1, "title": "2024年2月日常巡检报告", "content": { "基本信息": { "inspector": "李四", "inspection_time": "2024-02-13 09:00:00", "weather": "多云", "temperature": 25 }, "水质监测": { "water_temperature": 18, "ph_value": 7.2, "dissolved_oxygen": 6.5, "turbidity": 3.2 } }, "start_date": "2024-02-13", "end_date": "2024-02-13" } ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 400 Response ```json { "success": true, "message": "string" } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|none|Inline| ### 返回数据结构 状态码 **400** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| ## DELETE 删除报告 DELETE /api/reports/1 > 返回示例 > 200 Response ```json {} ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 ## POST 提交报告审核 POST /api/reports/2/submit > Body 请求参数 ```json {} ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 400 Response ```json { "success": true, "message": "string" } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |400|[Bad Request](https://tools.ietf.org/html/rfc7231#section-6.5.1)|none|Inline| ### 返回数据结构 状态码 **400** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| ## POST 审核报告 POST /api/reports/2/review > Body 请求参数 ```json "{\r\n \"status\": 2, // 必需,审核状态:2-通过,3-驳回\r\n \"review_comment\": \"这里是审核意见\" // 当status=3(驳回)时必需,不超过500字符\r\n}" ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string" } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| ## GET 获取报告统计信息 GET /api/reports/statistics > Body 请求参数 ```json {} ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": { "overview": { "total_reports": 0, "approval_rate": "string", "avg_review_time": "string", "within_24h_rate": "string" }, "status_distribution": [ { "status": 0, "count": 0 } ], "template_usage": [ { "id": 0, "template_name": "string", "usage_count": 0 } ], "user_submissions": [ { "id": 0, "username": "string", "total_submissions": 0, "approved_count": "string", "rejected_count": "string" } ], "time_trends": [ { "time_period": "string", "total_count": 0, "approved_count": "string", "rejected_count": "string" } ], "review_efficiency": { "avg_review_hours": 0, "min_review_hours": 0, "max_review_hours": 0, "total_reviewed": 0, "within_24h": 0 }, "reviewer_performance": [ { "reviewer_id": 0, "reviewer_name": "string", "total_reviewed": 0, "approved_count": "string", "rejected_count": "string", "avg_review_hours": "string" } ], "period_info": { "start_date": "string", "end_date": "string", "interval": "string" } } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» overview|object|true|none||none| |»»» total_reports|integer|true|none||none| |»»» approval_rate|string|true|none||none| |»»» avg_review_time|string|true|none||none| |»»» within_24h_rate|string|true|none||none| |»» status_distribution|[object]|true|none||none| |»»» status|integer|true|none||none| |»»» count|integer|true|none||none| |»» template_usage|[object]|true|none||none| |»»» id|integer|false|none||none| |»»» template_name|string|false|none||none| |»»» usage_count|integer|false|none||none| |»» user_submissions|[object]|true|none||none| |»»» id|integer|true|none||none| |»»» username|string|true|none||none| |»»» total_submissions|integer|true|none||none| |»»» approved_count|string|true|none||none| |»»» rejected_count|string|true|none||none| |»» time_trends|[object]|true|none||none| |»»» time_period|string|false|none||none| |»»» total_count|integer|false|none||none| |»»» approved_count|string|false|none||none| |»»» rejected_count|string|false|none||none| |»» review_efficiency|object|true|none||none| |»»» avg_review_hours|integer|true|none||none| |»»» min_review_hours|integer|true|none||none| |»»» max_review_hours|integer|true|none||none| |»»» total_reviewed|integer|true|none||none| |»»» within_24h|integer|true|none||none| |»» reviewer_performance|[object]|true|none||none| |»»» reviewer_id|integer|false|none||none| |»»» reviewer_name|string|false|none||none| |»»» total_reviewed|integer|false|none||none| |»»» approved_count|string|false|none||none| |»»» rejected_count|string|false|none||none| |»»» avg_review_hours|string|false|none||none| |»» period_info|object|true|none||none| |»»» start_date|string|true|none||none| |»»» end_date|string|true|none||none| |»»» interval|string|true|none||none| ## POST 批量导出报告 POST /api/reports/batch/export > Body 请求参数 ```json "{\r\n \"ids\": [1,2], // 要导出的报告ID数组\r\n \"format\": \"excel\" // 导出格式:excel/pdf/word\r\n}" ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 ## POST 批量删除报告 POST /api/reports/batch/delete > 返回示例 > 200 Response ```json {} ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 ## POST 导出单个报告 POST /api/reports/1/export ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| > 返回示例 > 200 Response ```json {} ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 # 报告模板 ## GET 获取模板列表 GET /api/reports/templates > Body 请求参数 ```yaml {} ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 ```json { "success": true, "message": "获取报告模板列表成功", "data": [ { "id": 1, "template_code": "DATPL001", "template_name": "日常湿地巡检报告模板", "template_type": "daily", "content_structure": { "sections": [ { "title": "基本信息", "fields": [ { "name": "inspector", "type": "text", "label": "巡检人员3", "required": true }, { "name": "inspection_time", "type": "datetime", "label": "巡检时间", "required": true }, { "name": "weather", "type": "select", "label": "天气状况", "options": [ "晴", "多云", "阴", "雨", "雪" ], "required": true }, { "name": "temperature", "type": "number", "label": "温度(℃)", "required": true } ] }, { "title": "水质监测", "fields": [ { "name": "water_temperature", "type": "number", "label": "水温(℃)", "required": true }, { "max": 14, "min": 0, "name": "ph_value", "type": "number", "label": "pH值", "required": true }, { "name": "dissolved_oxygen", "type": "number", "label": "溶解氧(mg/L)", "required": true }, { "name": "turbidity", "type": "number", "label": "浊度(NTU)", "required": true } ] }, { "title": "生态观察", "fields": [ { "name": "plant_status", "type": "textarea", "label": "植物状况", "required": true, "placeholder": "请描述植物生长情况、是否发现外来物种等" }, { "name": "animal_observation", "type": "textarea", "label": "动物观察", "required": true, "placeholder": "请记录观察到的动物种类、数量等" }, { "name": "photos", "type": "image", "label": "现场照片", "required": true, "max_count": 5 } ] }, { "title": "问题记录", "fields": [ { "name": "issues", "type": "checkbox", "label": "发现的问题", "options": [ "水质异常", "植物病虫害", "外来物种入侵", "人为破坏", "设备故障", "其他" ], "required": false }, { "name": "issue_description", "type": "textarea", "label": "问题描述", "required": false, "placeholder": "请详细描述发现的问题" }, { "name": "emergency_level", "type": "radio", "label": "紧急程度", "options": [ "一般", "较急", "紧急", "特急" ], "required": false } ] }, { "title": "处理建议", "fields": [ { "name": "suggestions", "type": "textarea", "label": "处理建议", "required": false, "placeholder": "请提出处理问题的建议" } ] } ] }, "variables": { "location": { "type": "string", "label": "巡检地点", "default": "主湿地公园" }, "department": { "type": "string", "label": "巡检部门", "default": "生态保护科" } }, "status": 1, "created_at": "2025-02-13T06:43:48.000Z", "updated_at": "2025-02-13T06:56:26.000Z", "created_by": 1, "updated_by": 1, "creator_name": "系统管理员(admin)", "updater_name": "系统管理员(admin)" } ] } ``` ```json { "success": true, "message": "获取报告模板列表成功", "data": [ { "id": 1, "template_code": "DATPL001", "template_name": "日常湿地巡检报告模板", "template_type": "daily", "content_structure": { "sections": [ { "title": "基本信息", "fields": [ { "name": "inspector", "type": "text", "label": "巡检人员3", "required": true }, { "name": "inspection_time", "type": "datetime", "label": "巡检时间", "required": true }, { "name": "weather", "type": "select", "label": "天气状况", "options": [ "晴", "多云", "阴", "雨", "雪" ], "required": true }, { "name": "temperature", "type": "number", "label": "温度(℃)", "required": true } ] }, { "title": "水质监测", "fields": [ { "name": "water_temperature", "type": "number", "label": "水温(℃)", "required": true }, { "max": 14, "min": 0, "name": "ph_value", "type": "number", "label": "pH值", "required": true }, { "name": "dissolved_oxygen", "type": "number", "label": "溶解氧(mg/L)", "required": true }, { "name": "turbidity", "type": "number", "label": "浊度(NTU)", "required": true } ] }, { "title": "生态观察", "fields": [ { "name": "plant_status", "type": "textarea", "label": "植物状况", "required": true, "placeholder": "请描述植物生长情况、是否发现外来物种等" }, { "name": "animal_observation", "type": "textarea", "label": "动物观察", "required": true, "placeholder": "请记录观察到的动物种类、数量等" }, { "name": "photos", "type": "image", "label": "现场照片", "required": true, "max_count": 5 } ] }, { "title": "问题记录", "fields": [ { "name": "issues", "type": "checkbox", "label": "发现的问题", "options": [ "水质异常", "植物病虫害", "外来物种入侵", "人为破坏", "设备故障", "其他" ], "required": false }, { "name": "issue_description", "type": "textarea", "label": "问题描述", "required": false, "placeholder": "请详细描述发现的问题" }, { "name": "emergency_level", "type": "radio", "label": "紧急程度", "options": [ "一般", "较急", "紧急", "特急" ], "required": false } ] }, { "title": "处理建议", "fields": [ { "name": "suggestions", "type": "textarea", "label": "处理建议", "required": false, "placeholder": "请提出处理问题的建议" } ] } ] }, "variables": { "location": { "type": "string", "label": "巡检地点", "default": "主湿地公园" }, "department": { "type": "string", "label": "巡检部门", "default": "生态保护科" } }, "status": 1, "created_at": "2025-02-13T06:43:48.000Z", "updated_at": "2025-02-13T06:56:26.000Z", "created_by": 1, "updated_by": 1, "creator_name": "系统管理员(admin)", "updater_name": "系统管理员(admin)" } ] } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|[string]|true|none||none| ## POST 创建模板 POST /api/reports/templates > Body 请求参数 ```json { "template_name": "日常湿地巡检报告模板", "template_type": "daily", "content_structure": { "sections": [ { "title": "基本信息", "fields": [ { "name": "inspector", "label": "巡检人员", "type": "text", "required": true }, { "name": "inspection_time", "label": "巡检时间", "type": "datetime", "required": true }, { "name": "weather", "label": "天气状况", "type": "select", "options": [ "晴", "多云", "阴", "雨", "雪" ], "required": true }, { "name": "temperature", "label": "温度(℃)", "type": "number", "required": true } ] }, { "title": "水质监测", "fields": [ { "name": "water_temperature", "label": "水温(℃)", "type": "number", "required": true }, { "name": "ph_value", "label": "pH值", "type": "number", "required": true, "min": 0, "max": 14 }, { "name": "dissolved_oxygen", "label": "溶解氧(mg/L)", "type": "number", "required": true }, { "name": "turbidity", "label": "浊度(NTU)", "type": "number", "required": true } ] }, { "title": "生态观察", "fields": [ { "name": "plant_status", "label": "植物状况", "type": "textarea", "required": true, "placeholder": "请描述植物生长情况、是否发现外来物种等" }, { "name": "animal_observation", "label": "动物观察", "type": "textarea", "required": true, "placeholder": "请记录观察到的动物种类、数量等" }, { "name": "photos", "label": "现场照片", "type": "image", "required": true, "max_count": 5 } ] }, { "title": "问题记录", "fields": [ { "name": "issues", "label": "发现的问题", "type": "checkbox", "options": [ "水质异常", "植物病虫害", "外来物种入侵", "人为破坏", "设备故障", "其他" ], "required": false }, { "name": "issue_description", "label": "问题描述", "type": "textarea", "required": false, "placeholder": "请详细描述发现的问题" }, { "name": "emergency_level", "label": "紧急程度", "type": "radio", "options": [ "一般", "较急", "紧急", "特急" ], "required": false } ] }, { "title": "处理建议", "fields": [ { "name": "suggestions", "label": "处理建议", "type": "textarea", "required": false, "placeholder": "请提出处理问题的建议" } ] } ] }, "variables": { "location": { "type": "string", "label": "巡检地点", "default": "主湿地公园" }, "department": { "type": "string", "label": "巡检部门", "default": "生态保护科" } }, "status": 1 } ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": { "id": 0 } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» id|integer|true|none||none| ## GET 获取模板详情 GET /api/reports/templates/1 ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| > 返回示例 ```json { "success": true, "message": "获取报告模板详情成功", "data": { "id": 1, "template_code": "DATPL001", "template_name": "日常湿地巡检报告模板", "template_type": "daily", "content_structure": { "sections": [ { "title": "基本信息", "fields": [ { "name": "inspector", "type": "text", "label": "巡检人员3", "required": true }, { "name": "inspection_time", "type": "datetime", "label": "巡检时间", "required": true }, { "name": "weather", "type": "select", "label": "天气状况", "options": [ "晴", "多云", "阴", "雨", "雪" ], "required": true }, { "name": "temperature", "type": "number", "label": "温度(℃)", "required": true } ] }, { "title": "水质监测", "fields": [ { "name": "water_temperature", "type": "number", "label": "水温(℃)", "required": true }, { "max": 14, "min": 0, "name": "ph_value", "type": "number", "label": "pH值", "required": true }, { "name": "dissolved_oxygen", "type": "number", "label": "溶解氧(mg/L)", "required": true }, { "name": "turbidity", "type": "number", "label": "浊度(NTU)", "required": true } ] }, { "title": "生态观察", "fields": [ { "name": "plant_status", "type": "textarea", "label": "植物状况", "required": true, "placeholder": "请描述植物生长情况、是否发现外来物种等" }, { "name": "animal_observation", "type": "textarea", "label": "动物观察", "required": true, "placeholder": "请记录观察到的动物种类、数量等" }, { "name": "photos", "type": "image", "label": "现场照片", "required": true, "max_count": 5 } ] }, { "title": "问题记录", "fields": [ { "name": "issues", "type": "checkbox", "label": "发现的问题", "options": [ "水质异常", "植物病虫害", "外来物种入侵", "人为破坏", "设备故障", "其他" ], "required": false }, { "name": "issue_description", "type": "textarea", "label": "问题描述", "required": false, "placeholder": "请详细描述发现的问题" }, { "name": "emergency_level", "type": "radio", "label": "紧急程度", "options": [ "一般", "较急", "紧急", "特急" ], "required": false } ] }, { "title": "处理建议", "fields": [ { "name": "suggestions", "type": "textarea", "label": "处理建议", "required": false, "placeholder": "请提出处理问题的建议" } ] } ] }, "variables": { "location": { "type": "string", "label": "巡检地点", "default": "主湿地公园" }, "department": { "type": "string", "label": "巡检部门", "default": "生态保护科" } }, "status": 1, "created_at": "2025-02-13T06:43:48.000Z", "updated_at": "2025-02-13T06:56:26.000Z", "created_by": 1, "updated_by": 1, "creator_name": "系统管理员(admin)", "updater_name": "系统管理员(admin)" } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» id|integer|true|none||none| |»» template_code|string|true|none||none| |»» template_name|string|true|none||none| |»» template_type|string|true|none||none| |»» content_structure|object|true|none||none| |»»» sections|[object]|true|none||none| |»»»» title|string|true|none||none| |»»»» fields|[object]|true|none||none| |»»»»» name|string|true|none||none| |»»»»» type|string|true|none||none| |»»»»» label|string|true|none||none| |»»»»» required|boolean|true|none||none| |»»»»» options|[string]|true|none||none| |»»»»» max|integer|false|none||none| |»»»»» min|integer|false|none||none| |»»»»» placeholder|string|true|none||none| |»»»»» max_count|integer|false|none||none| |»» variables|object|true|none||none| |»»» location|object|true|none||none| |»»»» type|string|true|none||none| |»»»» label|string|true|none||none| |»»»» default|string|true|none||none| |»»» department|object|true|none||none| |»»»» type|string|true|none||none| |»»»» label|string|true|none||none| |»»»» default|string|true|none||none| |»» status|integer|true|none||none| |»» created_at|string|true|none||none| |»» updated_at|string|true|none||none| |»» created_by|integer|true|none||none| |»» updated_by|integer|true|none||none| |»» creator_name|string|true|none||none| |»» updater_name|string|true|none||none| ## PUT 更新模板 PUT /api/reports/templates/1 > Body 请求参数 ```json { "template_name": "日常湿地巡检报告模板", "template_type": "daily", "content_structure": { "sections": [ { "title": "基本信息", "fields": [ { "name": "inspector", "label": "巡检人员3", "type": "text", "required": true }, { "name": "inspection_time", "label": "巡检时间", "type": "datetime", "required": true }, { "name": "weather", "label": "天气状况", "type": "select", "options": [ "晴", "多云", "阴", "雨", "雪" ], "required": true }, { "name": "temperature", "label": "温度(℃)", "type": "number", "required": true } ] }, { "title": "水质监测", "fields": [ { "name": "water_temperature", "label": "水温(℃)", "type": "number", "required": true }, { "name": "ph_value", "label": "pH值", "type": "number", "required": true, "min": 0, "max": 14 }, { "name": "dissolved_oxygen", "label": "溶解氧(mg/L)", "type": "number", "required": true }, { "name": "turbidity", "label": "浊度(NTU)", "type": "number", "required": true } ] }, { "title": "生态观察", "fields": [ { "name": "plant_status", "label": "植物状况", "type": "textarea", "required": true, "placeholder": "请描述植物生长情况、是否发现外来物种等" }, { "name": "animal_observation", "label": "动物观察", "type": "textarea", "required": true, "placeholder": "请记录观察到的动物种类、数量等" }, { "name": "photos", "label": "现场照片", "type": "image", "required": true, "max_count": 5 } ] }, { "title": "问题记录", "fields": [ { "name": "issues", "label": "发现的问题", "type": "checkbox", "options": [ "水质异常", "植物病虫害", "外来物种入侵", "人为破坏", "设备故障", "其他" ], "required": false }, { "name": "issue_description", "label": "问题描述", "type": "textarea", "required": false, "placeholder": "请详细描述发现的问题" }, { "name": "emergency_level", "label": "紧急程度", "type": "radio", "options": [ "一般", "较急", "紧急", "特急" ], "required": false } ] }, { "title": "处理建议", "fields": [ { "name": "suggestions", "label": "处理建议", "type": "textarea", "required": false, "placeholder": "请提出处理问题的建议" } ] } ] }, "variables": { "location": { "type": "string", "label": "巡检地点", "default": "主湿地公园" }, "department": { "type": "string", "label": "巡检部门", "default": "生态保护科" } }, "status": 1 } ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string" } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| ## DELETE 删除模板 DELETE /api/reports/templates/1 > 返回示例 > 200 Response ```json {} ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 ## PUT 更新模板状态 PUT /api/reports/templates/1/status > Body 请求参数 ```json "{\r\n \"status\": 1 // 必填,数字类型:0-禁用,1-启用\r\n}" ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string" } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| # AIGC接口 ## GET 预警关键词 GET / > 返回示例 > 200 Response ```json {} ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 # 课程管理 ## GET 获取课程列表 GET /api/education/courses > Body 请求参数 ```json "{\r\n \"keyword\": \"搜索关键词\", // 可选,搜索标题或描述\r\n \"category\": \"wetland\", // 可选,课程类别:wetland/ecology/species/environment\r\n \"difficulty_level\": 1, // 可选,难度等级:1-入门 2-初级 3-中级 4-高级\r\n \"target_audience\": \"all\", // 可选,目标受众:child/teenager/adult/senior/all\r\n \"page\": 1, // 可选,默认1\r\n \"pageSize\": 10 // 可选,默认10\r\n}" ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 ```json { "success": true, "message": "获取课程列表成功", "data": [ { "id": 1, "course_code": "C2502160001", "title": "课程标题", "category": "wetland", "cover_image": "图片URL", "description": "课程描述", "content": {}, "duration": 60, "target_audience": "all", "difficulty_level": 1, "status": 1, "created_at": "2025-02-16T02:28:18.000Z", "updated_at": "2025-02-16T02:28:18.000Z", "created_by": 1, "updated_by": 1 }, { "id": 2, "course_code": "C2502160002", "title": "课程标题", "category": "wetland", "cover_image": "图片URL", "description": "课程描述", "content": {}, "duration": 60, "target_audience": "all", "difficulty_level": 1, "status": 1, "created_at": "2025-02-16T02:30:05.000Z", "updated_at": "2025-02-16T02:30:05.000Z", "created_by": 1, "updated_by": 1 } ] } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|[object]|true|none||none| |»» id|integer|true|none||none| |»» course_code|string|true|none||none| |»» title|string|true|none||none| |»» category|string|true|none||none| |»» cover_image|string|true|none||none| |»» description|string|true|none||none| |»» content|object|true|none||none| |»» duration|integer|true|none||none| |»» target_audience|string|true|none||none| |»» difficulty_level|integer|true|none||none| |»» status|integer|true|none||none| |»» created_at|string|true|none||none| |»» updated_at|string|true|none||none| |»» created_by|integer|true|none||none| |»» updated_by|integer|true|none||none| ## POST 创建课程 POST /api/education/courses > Body 请求参数 ```json "{\r\n \"title\": \"课程标题\", // 必需,最大200字符\r\n \"category\": \"wetland\", // 必需,课程类别wetland/ecology/species/environment\r\n \"cover_image\": \"图片URL\", // 可选,封面图片\r\n \"description\": \"课程描述\", // 可选,课程描述\r\n \"content\": { // 必需,课程内容(JSON对象)\r\n // 课程具体内容结构\r\n },\r\n \"duration\": 60, // 可选,课程时长(分钟)\r\n \"target_audience\": \"all\", // 可选,目标受众\r\n \"difficulty_level\": 1, // 可选,难度等级\r\n \"status\": 1 // 可选,状态:0-下架 1-上架,默认0\r\n}" ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 ```json { "success": true, "message": "创建课程成功", "data": { "id": 2 } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» id|integer|true|none||none| ## GET 获取课程详情 GET /api/education/courses/1 ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| > 返回示例 ```json { "success": true, "message": "获取课程详情成功", "data": { "id": 1, "course_code": "C2502160001", "title": "课程标题", "category": "wetland", "cover_image": "图片URL", "description": "课程描述", "content": {}, "duration": 60, "target_audience": "all", "difficulty_level": 1, "status": 1, "created_at": "2025-02-16T02:28:18.000Z", "updated_at": "2025-02-16T02:28:18.000Z", "created_by": 1, "updated_by": 1 } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» id|integer|true|none||none| |»» course_code|string|true|none||none| |»» title|string|true|none||none| |»» category|string|true|none||none| |»» cover_image|string|true|none||none| |»» description|string|true|none||none| |»» content|object|true|none||none| |»» duration|integer|true|none||none| |»» target_audience|string|true|none||none| |»» difficulty_level|integer|true|none||none| |»» status|integer|true|none||none| |»» created_at|string|true|none||none| |»» updated_at|string|true|none||none| |»» created_by|integer|true|none||none| |»» updated_by|integer|true|none||none| ## PUT 更新课程 PUT /api/education/courses/1 > Body 请求参数 ```json "// 至少包含一个要更新的字段)\r\n{\r\n \"title\": \"新标题\", // 可选\r\n \"category\": \"ecology\", // 可选\r\n \"cover_image\": \"\", // 可选\r\n \"description\": \"新描述\", // 可选\r\n \"content\": {}, // 可选\r\n \"duration\": 90, // 可选\r\n \"target_audience\": \"adult\", // 可选\r\n \"difficulty_level\": 2, // 可选\r\n \"status\": 0 // 可选\r\n}" ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 ```json { "success": true, "message": "更新课程成功" } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| ## DELETE 删除课程 DELETE /api/education/courses/2 ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string" } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| ## PUT 更新课程状态 PUT /api/education/courses/1/status > Body 请求参数 ```json "{\r\n \"status\": 1 // 必需,0-下架 1-上架\r\n}" ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string" } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| ## GET 获取课程统计 GET /api/education/courses/statistics/overview ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": [ { "category": "string", "total_count": 0, "online_count": "string" } ] } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|[object]|true|none||none| |»» category|string|false|none||none| |»» total_count|integer|false|none||none| |»» online_count|string|false|none||none| ## GET 获取热门课程 GET /api/education/courses/hot ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| > 返回示例 > 200 Response ```json {} ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 # 研学活动管理 ## POST 创建活动 POST /api/education/activities > Body 请求参数 ```json { "title": "湿地生态系统考察活动", "category": "field_study", "start_time": "2024-03-20 09:00:00", "end_time": "2024-03-20 16:00:00", "location": "杭州西湖湿地公园", "capacity": 30, "description": "通过实地考察了解湿地生态系统的构成和保护措施", "requirements": "1. 年龄8岁以上\n2. 需要家长陪同\n3. 请穿着运动鞋", "cost": 50, "status": 1 } ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": { "id": 0 } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» id|integer|true|none||none| ## GET 获取活动列表 GET /api/education/activities ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": [ { "id": 0, "activity_code": "string", "title": "string", "category": "string", "start_time": "string", "end_time": "string", "location": "string", "capacity": 0, "enrolled_count": 0, "description": "string", "requirements": "string", "cost": "string", "status": 0, "created_at": "string", "updated_at": "string", "created_by": 0, "updated_by": 0 } ] } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|[object]|true|none||none| |»» id|integer|false|none||none| |»» activity_code|string|false|none||none| |»» title|string|false|none||none| |»» category|string|false|none||none| |»» start_time|string|false|none||none| |»» end_time|string|false|none||none| |»» location|string|false|none||none| |»» capacity|integer|false|none||none| |»» enrolled_count|integer|false|none||none| |»» description|string|false|none||none| |»» requirements|string|false|none||none| |»» cost|string|false|none||none| |»» status|integer|false|none||none| |»» created_at|string|false|none||none| |»» updated_at|string|false|none||none| |»» created_by|integer|false|none||none| |»» updated_by|integer|false|none||none| ## GET 获取活动详情 GET /api/education/activities/1 ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": { "id": 0, "activity_code": "string", "title": "string", "category": "string", "start_time": "string", "end_time": "string", "location": "string", "capacity": 0, "enrolled_count": 0, "description": "string", "requirements": "string", "cost": "string", "status": 0, "created_at": "string", "updated_at": "string", "created_by": 0, "updated_by": 0 } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» id|integer|true|none||none| |»» activity_code|string|true|none||none| |»» title|string|true|none||none| |»» category|string|true|none||none| |»» start_time|string|true|none||none| |»» end_time|string|true|none||none| |»» location|string|true|none||none| |»» capacity|integer|true|none||none| |»» enrolled_count|integer|true|none||none| |»» description|string|true|none||none| |»» requirements|string|true|none||none| |»» cost|string|true|none||none| |»» status|integer|true|none||none| |»» created_at|string|true|none||none| |»» updated_at|string|true|none||none| |»» created_by|integer|true|none||none| |»» updated_by|integer|true|none||none| ## PUT 更新活动 PUT /api/education/activities/1 > Body 请求参数 ```json { "description": "通过实地考察了解湿地生态系统的构成和保护措施,包括植物观察和水质检测", "requirements": "1. 年龄8岁以上\n2. 需要家长陪同\n3. 请穿着运动鞋\n4. 自备饮用水", "capacity": 35 } ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string" } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| ## PUT 更新活动状态 PUT /api/education/activities/1/status > Body 请求参数 ```json "{\r\n \"status\": 1 // 设置为报名中\r\n}\r\n// {\r\n// 0: \"已取消\",\r\n// 1: \"报名中\",\r\n// 2: \"已截止\",\r\n// 3: \"进行中\",\r\n// 4: \"已结束\"\r\n// }" ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string" } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| ## GET 获取活动统计 GET /api/education/activities/statistics/overview ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": [ { "category": "string", "total_count": 0, "enrolling_count": "string", "in_progress_count": "string", "completed_count": "string", "total_enrollments": "string" } ] } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|[object]|true|none||none| |»» category|string|false|none||none| |»» total_count|integer|false|none||none| |»» enrolling_count|string|false|none||none| |»» in_progress_count|string|false|none||none| |»» completed_count|string|false|none||none| |»» total_enrollments|string|false|none||none| ## GET 检查活动容量 GET /api/education/activities/1/capacity > Body 请求参数 ```json { "limit": 1 } ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |limit|query|string| 否 |none| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": { "is_full": true } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» is_full|boolean|true|none||none| ## GET 获取分类活动 GET /api/education/activities/category/field_study > Body 请求参数 ```json "{\r\n \"field_study\": \"野外考察\",\r\n// \"experiment\": \"科学实验\",\r\n// \"workshop\": \"工作坊\",\r\n// \"lecture\": \"专题讲座\",\r\n// \"competition\": \"科普竞赛\"\r\n}" ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": [ { "id": 0, "activity_code": "string", "title": "string", "category": "string", "start_time": "string", "end_time": "string", "location": "string", "capacity": 0, "enrolled_count": 0, "description": "string", "requirements": "string", "cost": "string", "status": 0, "created_at": "string", "updated_at": "string", "created_by": 0, "updated_by": 0 } ] } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|[object]|true|none||none| |»» id|integer|false|none||none| |»» activity_code|string|false|none||none| |»» title|string|false|none||none| |»» category|string|false|none||none| |»» start_time|string|false|none||none| |»» end_time|string|false|none||none| |»» location|string|false|none||none| |»» capacity|integer|false|none||none| |»» enrolled_count|integer|false|none||none| |»» description|string|false|none||none| |»» requirements|string|false|none||none| |»» cost|string|false|none||none| |»» status|integer|false|none||none| |»» created_at|string|false|none||none| |»» updated_at|string|false|none||none| |»» created_by|integer|false|none||none| |»» updated_by|integer|false|none||none| ## POST 取消活动 POST /api/education/activities/1/cancel ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string" } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| ## POST 批量取消活动 POST /api/education/activities/batch/cancel > Body 请求参数 ```json { "ids": [ 1, 2 ] } ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string" } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| # 知识库管理 ## POST 创建知识条目 POST /api/education/knowledge > Body 请求参数 ```json { "title": "湿地生态系统的重要性", "category": "wetland_science", "content": "湿地生态系统是地球上最重要的生态系统之一...", "cover_image": "https://example.com/images/wetland.jpg", "tags": [ "湿地保护", "生态系统", "生物多样性" ], "status": 1 } ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": { "id": 0 } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» id|integer|true|none||none| ## GET 获取知识列表 GET /api/education/knowledge ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": [ { "id": 0, "title": "string", "category": "string", "content": "string", "cover_image": "string", "tags": [ "string" ], "view_count": 0, "like_count": 0, "status": 0, "created_at": "string", "updated_at": "string", "created_by": 0, "updated_by": 0 } ] } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|[object]|true|none||none| |»» id|integer|false|none||none| |»» title|string|false|none||none| |»» category|string|false|none||none| |»» content|string|false|none||none| |»» cover_image|string|false|none||none| |»» tags|[string]|false|none||none| |»» view_count|integer|false|none||none| |»» like_count|integer|false|none||none| |»» status|integer|false|none||none| |»» created_at|string|false|none||none| |»» updated_at|string|false|none||none| |»» created_by|integer|false|none||none| |»» updated_by|integer|false|none||none| ## GET 获取知识详情 GET /api/education/knowledge/1 ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": { "id": 0, "title": "string", "category": "string", "content": "string", "cover_image": "string", "tags": [ "string" ], "view_count": 0, "like_count": 0, "status": 0, "created_at": "string", "updated_at": "string", "created_by": 0, "updated_by": 0 } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» id|integer|true|none||none| |»» title|string|true|none||none| |»» category|string|true|none||none| |»» content|string|true|none||none| |»» cover_image|string|true|none||none| |»» tags|[string]|true|none||none| |»» view_count|integer|true|none||none| |»» like_count|integer|true|none||none| |»» status|integer|true|none||none| |»» created_at|string|true|none||none| |»» updated_at|string|true|none||none| |»» created_by|integer|true|none||none| |»» updated_by|integer|true|none||none| ## PUT 更新知识条目 PUT /api/education/knowledge/1 > Body 请求参数 ```json { "title": "湿地生态系统保护指南", "content": "更新后的内容...", "tags": [ "湿地保护", "生态系统", "环境保护", "科普教育" ] } ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string" } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| ## PUT 更新知识状态 PUT /api/education/knowledge/1/status > Body 请求参数 ```json { "status": 0 } ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string" } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| ## POST 增加浏览次数 POST /api/education/knowledge/1/view ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string" } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| ## POST 增加点赞次数 POST /api/education/knowledge/1/like ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string" } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| ## POST 根据标签获取知识 POST /api/education/knowledge/tags > Body 请求参数 ```json { "tags": [ "湿地保护", "生态系统", "环境保护", "科普教育" ] } ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": [ { "id": 0, "title": "string", "category": "string", "content": "string", "cover_image": "string", "tags": [ "string" ], "view_count": 0, "like_count": 0, "status": 0, "created_at": "string", "updated_at": "string", "created_by": 0, "updated_by": 0 } ] } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|[object]|true|none||none| |»» id|integer|false|none||none| |»» title|string|false|none||none| |»» category|string|false|none||none| |»» content|string|false|none||none| |»» cover_image|string|false|none||none| |»» tags|[string]|false|none||none| |»» view_count|integer|false|none||none| |»» like_count|integer|false|none||none| |»» status|integer|false|none||none| |»» created_at|string|false|none||none| |»» updated_at|string|false|none||none| |»» created_by|integer|false|none||none| |»» updated_by|integer|false|none||none| ## GET 获取知识统计 GET /api/education/knowledge/statistics/overview ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": [ { "category": "string", "total_count": 0, "online_count": "string", "total_views": "string", "total_likes": "string" } ] } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|[object]|true|none||none| |»» category|string|false|none||none| |»» total_count|integer|false|none||none| |»» online_count|string|false|none||none| |»» total_views|string|false|none||none| |»» total_likes|string|false|none||none| ## POST 批量更新知识状态 POST /api/education/knowledge/batch/status > Body 请求参数 ```json "{\r\n \"ids\": [1, 2, 3], // 要更新的知识ID数组\r\n \"status\": 1 // 要更新的状态值:0-下架,1-上架\r\n}" ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string" } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| ## POST 批量删除知识 POST /api/education/knowledge/batch/delete > Body 请求参数 ```json "{\r\n \"ids\": [1, 2] // 要删除的知识ID数组\r\n}" ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string" } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| ## DELETE 删除知识条目 DELETE /api/education/knowledge/3 ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string" } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| # 设备接口 ## POST 上传设备数据 POST /api/device/update (不要做用户鉴权) > Body 请求参数 ```json "{\n \"temperature\":{{$number.int(max=100)}},\n \"humidity\": {{$number.int(max=100)}}\n}" ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |token|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json {} ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 # 课程报名/管理端接口 ## GET 获取报名记录列表 GET /api/admin/courses/{courseId}/enrollments > Body 请求参数 ```json "// GET /api/admin/courses/:courseId/enrollments\r\n\r\n// 请求参数:\r\n// - courseId: 课程ID(路径参数,必填)\r\n\r\n// 响应数据:\r\n// {\r\n// \"success\": true,\r\n// \"message\": \"获取报名记录列表成功\",\r\n// \"data\": [\r\n// {\r\n// \"id\": \"报名记录ID\",\r\n// \"course_id\": \"课程ID\",\r\n// \"user_id\": \"用户ID\",\r\n// \"username\": \"用户名\",\r\n// \"real_name\": \"真实姓名\",\r\n// \"enrollment_time\": \"报名时间\",\r\n// \"start_time\": \"开始学习时间\",\r\n// \"complete_time\": \"完成时间\",\r\n// \"progress\": \"学习进度\",\r\n// \"status\": \"状态\"\r\n// }\r\n// ]\r\n// }" ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |courseId|path|string| 是 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json {} ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 ## GET 获取报名统计信息 GET /api/admin/courses/{courseId}/enrollments/statistics > Body 请求参数 ```json "// 请求参数:\r\n// - courseId: 课程ID(路径参数,必填)\r\n\r\n// 响应数据:\r\n// {\r\n// \"success\": true,\r\n// \"message\": \"获取报名统计信息成功\",\r\n// \"data\": {\r\n// \"total_enrollments\": \"总报名人数\",\r\n// \"in_progress_count\": \"学习中人数\",\r\n// \"completed_count\": \"已完成人数\",\r\n// \"cancelled_count\": \"已取消人数\",\r\n// \"average_progress\": \"平均学习进度\"\r\n// }\r\n// }" ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |courseId|path|string| 是 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json {} ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 ## GET 导出报名数据 GET /api/admin/courses/{courseId}/enrollments/export > Body 请求参数 ```json "// 请求参数:\r\n// - courseId: 课程ID(路径参数,必填)\r\n\r\n// 响应数据:\r\n// {\r\n// \"success\": true,\r\n// \"message\": \"导出报名数据成功\",\r\n// \"data\": {\r\n// \"file_path\": \"导出文件路径\"\r\n// }\r\n// }" ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |courseId|path|string| 是 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json {} ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 # 课程报名/客户端接口 ## GET 获取我的报名记录 GET /api/client/courses/enrollments/my > Body 请求参数 ```json "\r\n// 请求参数:\r\n// - 无(通过token获取用户ID)\r\n\r\n// 响应数据:\r\n// {\r\n// \"success\": true,\r\n// \"message\": \"获取报名记录列表成功\",\r\n// \"data\": [\r\n// {\r\n// \"id\": \"报名记录ID\",\r\n// \"course_id\": \"课程ID\",\r\n// \"course_title\": \"课程标题\",\r\n// \"course_category\": \"课程类别\",\r\n// \"course_cover\": \"课程封面\",\r\n// \"enrollment_time\": \"报名时间\",\r\n// \"start_time\": \"开始学习时间\",\r\n// \"complete_time\": \"完成时间\",\r\n// \"progress\": \"学习进度\",\r\n// \"status\": \"状态\"\r\n// }\r\n// ]\r\n// }" ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json {} ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 ## POST 报名课程 POST /api/client/courses/{courseId}/enroll > Body 请求参数 ```json "// 请求参数:\r\n// - courseId: 课程ID(路径参数,必填)\r\n// - 用户ID通过token获取\r\n\r\n// 响应数据:\r\n// {\r\n// \"success\": true,\r\n// \"message\": \"报名课程成功\",\r\n// \"data\": {\r\n// \"id\": \"报名记录ID\"\r\n// }\r\n// }" ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |courseId|path|string| 是 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json {} ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 ## GET 获取报名记录详情 GET /api/client/courses/enrollments/{enrollmentId} > Body 请求参数 ```json "// 请求参数:\r\n// - enrollmentId: 报名记录ID(路径参数,必填)\r\n// - 用户ID通过token获取\r\n\r\n// 响应数据:\r\n// {\r\n// \"success\": true,\r\n// \"message\": \"获取报名记录详情成功\",\r\n// \"data\": {\r\n// \"id\": \"报名记录ID\",\r\n// \"course_id\": \"课程ID\",\r\n// \"course_title\": \"课程标题\",\r\n// \"enrollment_time\": \"报名时间\",\r\n// \"start_time\": \"开始学习时间\",\r\n// \"complete_time\": \"完成时间\",\r\n// \"progress\": \"学习进度\",\r\n// \"status\": \"状态\"\r\n// }\r\n// }" ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |enrollmentId|path|string| 是 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json {} ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 ## POST 取消报名 POST /api/client/courses/enrollments/{enrollmentId}/cancel > Body 请求参数 ```json "// 请求参数:\r\n// - enrollmentId: 报名记录ID(路径参数,必填)\r\n// - 用户ID通过token获取\r\n\r\n// 响应数据:\r\n// {\r\n// \"success\": true,\r\n// \"message\": \"取消报名成功\"\r\n// }" ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |enrollmentId|path|string| 是 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json {} ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 ## PUT 更新学习进度 PUT /api/client/courses/enrollments/{enrollmentId}/progress > Body 请求参数 ```json "// 请求参数:\r\n// - enrollmentId: 报名记录ID(路径参数,必填)\r\n// - 用户ID通过token获取\r\n// 请求体:\r\n// {\r\n// \"progress\": \"学习进度(0-100的数字)\",\r\n// \"duration\": \"本次学习时长(秒,可选)\"\r\n// }\r\n\r\n// 响应数据:\r\n// {\r\n// \"success\": true,\r\n// \"message\": \"更新学习进度成功\"\r\n// }" ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |enrollmentId|path|string| 是 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json {} ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 # 意见反馈/管理端 ## GET 获取反馈列表 GET /api/admin/feedbacks ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": { "list": [ "string" ], "pagination": { "total": 0, "total_pages": null } } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» list|[string]|true|none||none| |»» pagination|object|true|none||none| |»»» total|integer|true|none||none| |»»» total_pages|null|true|none||none| ## GET 获取反馈详情 GET /api/admin/feedbacks/1 ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": { "id": 0, "user_id": 0, "feedback_type": "string", "title": "string", "content": "string", "image_urls": [ "string" ], "location_point": { "x": 0, "y": 0 }, "location_description": "string", "status": 0, "handler_id": null, "handling_time": null, "handling_result": null, "created_at": "string", "updated_at": "string", "longitude": 0, "latitude": 0, "user_name": "string", "user_real_name": "string", "handler_name": null, "handler_real_name": null } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» id|integer|true|none||none| |»» user_id|integer|true|none||none| |»» feedback_type|string|true|none||none| |»» title|string|true|none||none| |»» content|string|true|none||none| |»» image_urls|[string]|true|none||none| |»» location_point|object|true|none||none| |»»» x|number|true|none||none| |»»» y|number|true|none||none| |»» location_description|string|true|none||none| |»» status|integer|true|none||none| |»» handler_id|null|true|none||none| |»» handling_time|null|true|none||none| |»» handling_result|null|true|none||none| |»» created_at|string|true|none||none| |»» updated_at|string|true|none||none| |»» longitude|number|true|none||none| |»» latitude|number|true|none||none| |»» user_name|string|true|none||none| |»» user_real_name|string|true|none||none| |»» handler_name|null|true|none||none| |»» handler_real_name|null|true|none||none| ## PUT 更新反馈状态 PUT /api/admin/feedbacks/1/status > Body 请求参数 ```json "// 更新为处理中\r\n{\r\n \"status\": 1\r\n}\r\n\r\n// // 更新为已处理\r\n// {\r\n// \"status\": 2,\r\n// \"handling_result\": \"问题已解决:...\"\r\n// }\r\n\r\n// // 更新为已关闭\r\n// {\r\n// \"status\": 3\r\n// }" ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string" } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| # 意见反馈/客户端 ## POST 创建反馈 POST /api/client/feedbacks > Body 请求参数 ```json "{\r\n \"feedback_type\": \"problem\", // 必填,反馈类型:problem-问题报告/suggestion-建议/complaint-投诉/other-其他\r\n \"title\": \"标题\", // 必填,2-200个字符\r\n \"content\": \"反馈内容\", // 必填\r\n \"image_urls\": [ // 可选,图片URL数组\r\n \"http://example.com/image1.jpg\",\r\n \"http://example.com/image2.jpg\"\r\n ],\r\n \"location_point\": { // 必填,位置坐标\r\n \"latitude\": 30.123456, // 纬度,范围:-90到90\r\n \"longitude\": 120.123456 // 经度,范围:-180到180\r\n },\r\n \"location_description\": \"位置描述\" // 可选,最大255个字符\r\n}" ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": { "id": 0 } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» id|integer|true|none||none| ## GET 获取用户的反馈列表 GET /api/client/feedbacks/my ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": { "list": [ { "id": 0, "user_id": 0, "feedback_type": "string", "title": "string", "content": "string", "image_urls": [ "string" ], "location_point": { "x": 0, "y": 0 }, "location_description": "string", "status": 0, "handler_id": null, "handling_time": null, "handling_result": null, "created_at": "string", "updated_at": "string", "longitude": 0, "latitude": 0, "handler_name": null, "handler_real_name": null } ], "pagination": { "total": 0, "page": 0, "page_size": 0, "total_pages": 0 } } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» list|[object]|true|none||none| |»»» id|integer|false|none||none| |»»» user_id|integer|false|none||none| |»»» feedback_type|string|false|none||none| |»»» title|string|false|none||none| |»»» content|string|false|none||none| |»»» image_urls|[string]|false|none||none| |»»» location_point|object|false|none||none| |»»»» x|number|true|none||none| |»»»» y|number|true|none||none| |»»» location_description|string|false|none||none| |»»» status|integer|false|none||none| |»»» handler_id|null|false|none||none| |»»» handling_time|null|false|none||none| |»»» handling_result|null|false|none||none| |»»» created_at|string|false|none||none| |»»» updated_at|string|false|none||none| |»»» longitude|number|false|none||none| |»»» latitude|number|false|none||none| |»»» handler_name|null|false|none||none| |»»» handler_real_name|null|false|none||none| |»» pagination|object|true|none||none| |»»» total|integer|true|none||none| |»»» page|integer|true|none||none| |»»» page_size|integer|true|none||none| |»»» total_pages|integer|true|none||none| ## GET 获取反馈详情 GET /api/client/feedbacks/1 ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": { "id": 0, "user_id": 0, "feedback_type": "string", "title": "string", "content": "string", "image_urls": [ "string" ], "location_point": { "x": 0, "y": 0 }, "location_description": "string", "status": 0, "handler_id": null, "handling_time": null, "handling_result": null, "created_at": "string", "updated_at": "string", "longitude": 0, "latitude": 0, "user_name": "string", "user_real_name": "string", "handler_name": null, "handler_real_name": null } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» id|integer|true|none||none| |»» user_id|integer|true|none||none| |»» feedback_type|string|true|none||none| |»» title|string|true|none||none| |»» content|string|true|none||none| |»» image_urls|[string]|true|none||none| |»» location_point|object|true|none||none| |»»» x|number|true|none||none| |»»» y|number|true|none||none| |»» location_description|string|true|none||none| |»» status|integer|true|none||none| |»» handler_id|null|true|none||none| |»» handling_time|null|true|none||none| |»» handling_result|null|true|none||none| |»» created_at|string|true|none||none| |»» updated_at|string|true|none||none| |»» longitude|number|true|none||none| |»» latitude|number|true|none||none| |»» user_name|string|true|none||none| |»» user_real_name|string|true|none||none| |»» handler_name|null|true|none||none| |»» handler_real_name|null|true|none||none| # 观察记录 ## POST 创建观察记录 POST /api/admin/observations > Body 请求参数 ```json { "title": "发现一只黑脸琵鹭", "content": "今天在湿地公园观察到一只黑脸琵鹭,正在觅食。这是今年第一次在此区域发现此物种。", "species_id": 1, "image_urls": [ "http://example.com/images/bird1.jpg", "http://example.com/images/bird2.jpg" ], "video_urls": [ "http://example.com/videos/bird_feeding.mp4" ], "location_point": { "latitude": 23.1291, "longitude": 113.2644 }, "location_description": "湿地公园北区浅水区", "weather": "晴朗", "temperature": 26.5 } ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": { "id": 0 } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» id|integer|true|none||none| ## GET 获取观察记录列表 GET /api/admin/observations ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": { "list": [ { "id": 0, "user_id": 0, "title": "string", "content": "string", "species_id": 0, "image_urls": [ "string" ], "video_urls": [ "string" ], "location_point": { "x": 0, "y": 0 }, "location_description": "string", "weather": "string", "temperature": "string", "status": 0, "reviewer_id": 0, "review_time": "string", "review_comment": null, "created_at": "string", "updated_at": "string", "longitude": 0, "latitude": 0, "user_name": "string", "user_real_name": "string", "species_name": "string", "species_latin_name": "string", "reviewer_name": "string", "reviewer_real_name": "string" } ], "pagination": { "total": 0, "page": 0, "page_size": 0, "total_pages": 0 } } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» list|[object]|true|none||none| |»»» id|integer|false|none||none| |»»» user_id|integer|false|none||none| |»»» title|string|false|none||none| |»»» content|string|false|none||none| |»»» species_id|integer|false|none||none| |»»» image_urls|[string]|false|none||none| |»»» video_urls|[string]|false|none||none| |»»» location_point|object|false|none||none| |»»»» x|number|true|none||none| |»»»» y|number|true|none||none| |»»» location_description|string|false|none||none| |»»» weather|string|false|none||none| |»»» temperature|string|false|none||none| |»»» status|integer|false|none||none| |»»» reviewer_id|integer|false|none||none| |»»» review_time|string|false|none||none| |»»» review_comment|null|false|none||none| |»»» created_at|string|false|none||none| |»»» updated_at|string|false|none||none| |»»» longitude|number|false|none||none| |»»» latitude|number|false|none||none| |»»» user_name|string|false|none||none| |»»» user_real_name|string|false|none||none| |»»» species_name|string|false|none||none| |»»» species_latin_name|string|false|none||none| |»»» reviewer_name|string|false|none||none| |»»» reviewer_real_name|string|false|none||none| |»» pagination|object|true|none||none| |»»» total|integer|true|none||none| |»»» page|integer|true|none||none| |»»» page_size|integer|true|none||none| |»»» total_pages|integer|true|none||none| ## PUT 更新观察记录 PUT /api/admin/observations/2 > Body 请求参数 ```json { "title": "黑脸琵鹭群体活动观察", "content": "更新:经过仔细观察,发现是一个3只黑脸琵鹭的小群体", "image_urls": [ "http://example.com/images/bird_group1.jpg", "http://example.com/images/bird_group2.jpg" ], "weather": "多云", "temperature": 25.8 } ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string" } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| ## DELETE 删除观察记录 DELETE /api/admin/observations/2 ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| > 返回示例 > 200 Response ```json {} ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 ## PUT 更新观察记录状态 PUT /api/admin/observations/2/status > Body 请求参数 ```json "// 通过审核\r\n{\r\n \"status\": 1\r\n}\r\n\r\n// // 拒绝审核\r\n// {\r\n// \"status\": 2,\r\n// \"review_comment\": \"图片不够清晰,请重新上传更清晰的照片,并补充观察时间段信息。\"\r\n// }" ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string" } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| # 物种信息 ## POST 创建物种信息 POST /api/admin/species > Body 请求参数 ```json "{\r\n \"species_code\": \"BIRD001\", // 物种编号,必填,最大50字符\r\n \"chinese_name\": \"东方白鹳\", // 中文名称,必填,最大100字符\r\n \"latin_name\": \"Ciconia boyciana\", // 拉丁名称,选填,最大100字符\r\n \"category\": \"bird\", // 物种类别,必填,可选值:bird(鸟类)、mammal(哺乳类)、fish(鱼类)、amphibian(两栖类)、reptile(爬行类)、insect(昆虫类)、plant(植物)\r\n \"protection_level\": \"national_first\", // 保护等级,选填,默认normal,可选值:national_first(国家一级)、national_second(国家二级)、provincial(省级)、normal(普通)\r\n \"characteristics\": \"体型大,羽毛白色,喙长而直...\", // 特征描述,选填\r\n \"habits\": \"常在沼泽、湿地等水域觅食...\", // 生活习性,选填\r\n \"distribution\": \"主要分布在东北地区...\", // 分布区域,选填\r\n \"image_urls\": [\"http://example.com/image1.jpg\"], // 图片URL数组,选填\r\n \"status\": 1 // 状态,选填,默认1,可选值:0(禁用)、1(启用)\r\n}" ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": { "id": 0 } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» id|integer|true|none||none| ## GET 获取物种列表 GET /api/admin/species ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": { "list": [ { "id": 0, "species_code": "string", "chinese_name": "string", "latin_name": "string", "category": "string", "protection_level": "string", "characteristics": "string", "habits": "string", "distribution": "string", "image_urls": [ "string" ], "status": 0, "created_at": "string", "updated_at": "string", "created_by": 0, "updated_by": 0 } ], "pagination": { "total": 0, "page": 0, "page_size": 0, "total_pages": 0 } } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» list|[object]|true|none||none| |»»» id|integer|false|none||none| |»»» species_code|string|false|none||none| |»»» chinese_name|string|false|none||none| |»»» latin_name|string|false|none||none| |»»» category|string|false|none||none| |»»» protection_level|string|false|none||none| |»»» characteristics|string|false|none||none| |»»» habits|string|false|none||none| |»»» distribution|string|false|none||none| |»»» image_urls|[string]|false|none||none| |»»» status|integer|false|none||none| |»»» created_at|string|false|none||none| |»»» updated_at|string|false|none||none| |»»» created_by|integer|false|none||none| |»»» updated_by|integer|false|none||none| |»» pagination|object|true|none||none| |»»» total|integer|true|none||none| |»»» page|integer|true|none||none| |»»» page_size|integer|true|none||none| |»»» total_pages|integer|true|none||none| ## GET 获取物种详情 GET /api/admin/species/1 ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": { "id": 0, "species_code": "string", "chinese_name": "string", "latin_name": "string", "category": "string", "protection_level": "string", "characteristics": "string", "habits": "string", "distribution": "string", "image_urls": [ "string" ], "status": 0, "created_at": "string", "updated_at": "string", "created_by": 0, "updated_by": 0 } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» id|integer|true|none||none| |»» species_code|string|true|none||none| |»» chinese_name|string|true|none||none| |»» latin_name|string|true|none||none| |»» category|string|true|none||none| |»» protection_level|string|true|none||none| |»» characteristics|string|true|none||none| |»» habits|string|true|none||none| |»» distribution|string|true|none||none| |»» image_urls|[string]|true|none||none| |»» status|integer|true|none||none| |»» created_at|string|true|none||none| |»» updated_at|string|true|none||none| |»» created_by|integer|true|none||none| |»» updated_by|integer|true|none||none| ## PUT 更新物种信息 PUT /api/admin/species/1 > Body 请求参数 ```json "{\r\n \"species_code\": \"BIRD001\", // 物种编号,必填,最大50字符\r\n \"chinese_name\": \"东方白鹳1\", // 中文名称,必填,最大100字符\r\n \"latin_name\": \"Ciconia boyciana\", // 拉丁名称,选填,最大100字符\r\n \"category\": \"bird\", // 物种类别,必填,可选值:bird(鸟类)、mammal(哺乳类)、fish(鱼类)、amphibian(两栖类)、reptile(爬行类)、insect(昆虫类)、plant(植物)\r\n \"protection_level\": \"national_first\", // 保护等级,选填,默认normal,可选值:national_first(国家一级)、national_second(国家二级)、provincial(省级)、normal(普通)\r\n \"characteristics\": \"体型大,羽毛白色,喙长而直...\", // 特征描述,选填\r\n \"habits\": \"常在沼泽、湿地等水域觅食...\", // 生活习性,选填\r\n \"distribution\": \"主要分布在东北地区...\", // 分布区域,选填\r\n \"image_urls\": [\"http://example.com/image1.jpg\"], // 图片URL数组,选填\r\n \"status\": 1 // 状态,选填,默认1,可选值:0(禁用)、1(启用)\r\n}" ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string" } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| ## GET 获取物种统计信息 GET /api/admin/species/statistics/overview ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": { "categories": { "bird": { "total_count": 0, "enabled_count": "string" } }, "protection_levels": { "national_first": 0 } } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» categories|object|true|none||none| |»»» bird|object|true|none||none| |»»»» total_count|integer|true|none||none| |»»»» enabled_count|string|true|none||none| |»» protection_levels|object|true|none||none| |»»» national_first|integer|true|none||none| ## PUT 更新物种状态 PUT /api/admin/species/1/status > Body 请求参数 ```json "{\r\n \"status\": 0 // 必填,状态值:0(禁用)或1(启用)\r\n}" ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string" } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| # 满意度调查/管理端 ## POST 创建调查 POST /api/admin/surveys > Body 请求参数 ```json { "title": "2024春季湿地公园环境满意度调查", "description": "为了持续改善湿地公园环境,提升游客体验,特开展此次调查", "questions": [ { "question_id": 1, "question_type": "single", "question_content": "您对湿地公园的整体环境是否满意?", "options": [ "非常满意", "比较满意", "一般", "不太满意", "非常不满意" ], "required": true }, { "question_id": 2, "question_type": "multiple", "question_content": "您觉得以下哪些设施需要改进?", "options": [ "步道", "座椅", "标识牌", "垃圾桶", "卫生间", "停车场" ], "required": true }, { "question_id": 3, "question_type": "text", "question_content": "您对湿地公园环境改善有什么建议?", "options": [], "required": false } ], "start_time": "2024-03-20 00:00:00", "end_time": "2024-04-20 23:59:59", "status": 1 } ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": { "id": 0 } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» id|integer|true|none||none| ## GET 获取调查列表 GET /api/admin/surveys ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": { "list": [ { "id": 0, "title": "string", "description": "string", "questions": [ "string" ], "start_time": "string", "end_time": "string", "status": 0, "created_at": "string", "updated_at": "string", "created_by": 0, "updated_by": 0 } ], "pagination": { "total": 0, "page": 0, "page_size": 0 } } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» list|[object]|true|none||none| |»»» id|integer|false|none||none| |»»» title|string|false|none||none| |»»» description|string|false|none||none| |»»» questions|[string]|false|none||none| |»»» start_time|string|false|none||none| |»»» end_time|string|false|none||none| |»»» status|integer|false|none||none| |»»» created_at|string|false|none||none| |»»» updated_at|string|false|none||none| |»»» created_by|integer|false|none||none| |»»» updated_by|integer|false|none||none| |»» pagination|object|true|none||none| |»»» total|integer|true|none||none| |»»» page|integer|true|none||none| |»»» page_size|integer|true|none||none| ## PUT 更新调查 PUT /api/admin/surveys/1 > Body 请求参数 ```json { "title": "2024春季湿地公园环境满意度调查", "description": "为了持续改善湿地公园环境,提升游客体验,特开展此次调查", "questions": [ { "question_id": 1, "question_type": "single", "question_content": "您对湿地公园的整体环境是否满意?", "options": [ "非常满意", "比较满意", "一般", "不太满意", "非常不满意" ], "required": true }, { "question_id": 2, "question_type": "multiple", "question_content": "您觉得以下哪些设施需要改进?", "options": [ "步道", "座椅", "标识牌", "垃圾桶", "卫生间", "停车场" ], "required": true }, { "question_id": 3, "question_type": "text", "question_content": "您对湿地公园环境改善有什么建议?", "options": [], "required": false } ], "start_time": "2024-03-20 00:00:00", "end_time": "2025-05-20 23:59:59", "status": 1 } ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string" } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| ## DELETE 删除调查 DELETE /api/admin/surveys/1 ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| > 返回示例 > 200 Response ```json {} ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 ## GET 获取调查详情 GET /api/admin/surveys/1 ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": { "id": 0, "title": "string", "description": "string", "questions": [ { "options": [ "string" ], "required": true, "question_id": 0, "question_type": "string", "question_content": "string" } ], "start_time": "string", "end_time": "string", "status": 0, "created_at": "string", "updated_at": "string", "created_by": 0, "updated_by": 0 } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» id|integer|true|none||none| |»» title|string|true|none||none| |»» description|string|true|none||none| |»» questions|[object]|true|none||none| |»»» options|[string]|true|none||none| |»»» required|boolean|true|none||none| |»»» question_id|integer|true|none||none| |»»» question_type|string|true|none||none| |»»» question_content|string|true|none||none| |»» start_time|string|true|none||none| |»» end_time|string|true|none||none| |»» status|integer|true|none||none| |»» created_at|string|true|none||none| |»» updated_at|string|true|none||none| |»» created_by|integer|true|none||none| |»» updated_by|integer|true|none||none| # 满意度调查/客户端 ## GET 获取进行中的调查列表 GET /api/client/surveys ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": { "list": [ "string" ], "pagination": { "total": 0, "page": 0, "page_size": 0 } } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» list|[string]|true|none||none| |»» pagination|object|true|none||none| |»»» total|integer|true|none||none| |»»» page|integer|true|none||none| |»»» page_size|integer|true|none||none| ## GET 获取调查详情 GET /api/client/surveys/1 ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": { "id": 0, "title": "string", "description": "string", "questions": [ { "options": [ "string" ], "required": true, "question_id": 0, "question_type": "string", "question_content": "string" } ], "start_time": "string", "end_time": "string", "status": 0, "created_at": "string", "updated_at": "string", "created_by": 0, "updated_by": 0 } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» id|integer|true|none||none| |»» title|string|true|none||none| |»» description|string|true|none||none| |»» questions|[object]|true|none||none| |»»» options|[string]|true|none||none| |»»» required|boolean|true|none||none| |»»» question_id|integer|true|none||none| |»»» question_type|string|true|none||none| |»»» question_content|string|true|none||none| |»» start_time|string|true|none||none| |»» end_time|string|true|none||none| |»» status|integer|true|none||none| |»» created_at|string|true|none||none| |»» updated_at|string|true|none||none| |»» created_by|integer|true|none||none| |»» updated_by|integer|true|none||none| ## POST 提交调查答案 POST /api/client/surveys/1/submit > Body 请求参数 ```json { "answers": [ { "question_id": 1, "answer": "非常满意" }, { "question_id": 2, "answer": [ "步道", "座椅", "标识牌" ] }, { "question_id": 3, "answer": "建议增加更多遮阳设施,并在主要景点增加饮水点。步道的指示牌可以做得更清晰一些。" } ] } ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": { "id": 0 } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» id|integer|true|none||none| # 巡护计划 ## POST 创建计划 POST /api/admin/patrol/plans > Body 请求参数 ```json "{\r\n \"plan_name\": \"2025年春季湿地巡护计划\", // 必填,最大100字符\r\n \"plan_type\": \"daily\", // 必填,枚举值:daily(日常巡护)、special(专项巡护)\r\n \"start_date\": \"2024-02-20\", // 必填,ISO日期格式\r\n \"end_date\": \"2024-03-20\", // 必填,必须大于start_date\r\n \"area_scope\": [ // 必填,至少3个点位\r\n {\r\n \"latitude\": 30.5866,\r\n \"longitude\": 114.2995\r\n },\r\n {\r\n \"latitude\": 30.5868,\r\n \"longitude\": 114.3001\r\n },\r\n {\r\n \"latitude\": 30.5862,\r\n \"longitude\": 114.2999\r\n }\r\n ],\r\n \"task_frequency\": \"daily\", // 可选,枚举值:daily、weekly、monthly\r\n \"description\": \"春季重点关注候鸟迁徙情况\", // 可选,最大1000字符\r\n \"status\": 1 // 可选,默认1,0:禁用 1:启用\r\n}" ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": { "id": 0 } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» id|integer|true|none||none| ## GET 获取计划列表 GET /api/admin/patrol/plans ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": { "list": [ { "id": 0, "plan_name": "string", "plan_type": "string", "start_date": "string", "end_date": "string", "area_scope": [ { "latitude": null, "longitude": null } ], "task_frequency": "string", "description": "string", "status": 0, "created_at": "string", "updated_at": "string", "created_by": 0, "updated_by": 0 } ], "pagination": { "total": 0, "page": 0, "page_size": 0, "total_pages": 0 } } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» list|[object]|true|none||none| |»»» id|integer|true|none||none| |»»» plan_name|string|true|none||none| |»»» plan_type|string|true|none||none| |»»» start_date|string|true|none||none| |»»» end_date|string|true|none||none| |»»» area_scope|[object]|true|none||none| |»»»» latitude|number|true|none||none| |»»»» longitude|number|true|none||none| |»»» task_frequency|string|true|none||none| |»»» description|string|true|none||none| |»»» status|integer|true|none||none| |»»» created_at|string|true|none||none| |»»» updated_at|string|true|none||none| |»»» created_by|integer|true|none||none| |»»» updated_by|integer|true|none||none| |»» pagination|object|true|none||none| |»»» total|integer|true|none||none| |»»» page|integer|true|none||none| |»»» page_size|integer|true|none||none| |»»» total_pages|integer|true|none||none| ## GET 查询巡护计划详情 GET /api/admin/patrol/plans/1 ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": { "id": 0, "plan_name": "string", "plan_type": "string", "start_date": "string", "end_date": "string", "area_scope": [ { "latitude": 0, "longitude": 0 } ], "task_frequency": "string", "description": "string", "status": 0, "created_at": "string", "updated_at": "string", "created_by": 0, "updated_by": 0 } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» id|integer|true|none||none| |»» plan_name|string|true|none||none| |»» plan_type|string|true|none||none| |»» start_date|string|true|none||none| |»» end_date|string|true|none||none| |»» area_scope|[object]|true|none||none| |»»» latitude|number|true|none||none| |»»» longitude|number|true|none||none| |»» task_frequency|string|true|none||none| |»» description|string|true|none||none| |»» status|integer|true|none||none| |»» created_at|string|true|none||none| |»» updated_at|string|true|none||none| |»» created_by|integer|true|none||none| |»» updated_by|integer|true|none||none| ## PUT 更新计划状态 PUT /api/admin/patrol/plans/1/status > Body 请求参数 ```json "{\r\n \"status\": 1 // 必填,0:禁用 1:启用\r\n}" ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string" } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| ## POST 检查计划名称 POST /api/admin/patrol/plans/check-name > Body 请求参数 ```json "{\r\n \"plan_name\": \"2025年春季湿地巡护计划\" // 必填\r\n}" ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": { "exists": true } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» exists|boolean|true|none||none| # 巡护任务 ## PUT 更新任务 PUT /api/admin/patrol/plans/1 > Body 请求参数 ```json "{\r\n \"plan_name\": \"巡护计划名称\", // 字符串,最大100个字符\r\n \"plan_type\": \"daily\", // 字符串,可选值: \"daily\"(日常巡护) 或 \"special\"(专项巡护)\r\n \"start_date\": \"2024-02-20\", // 日期,格式:YYYY-MM-DD\r\n \"end_date\": \"2024-03-20\", // 日期,格式:YYYY-MM-DD,必须大于开始日期\r\n \"area_scope\": [ // 数组,至少需要3个坐标点\r\n {\r\n \"latitude\": 30.5, // 纬度,范围:-90到90\r\n \"longitude\": 114.3 // 经度,范围:-180到180\r\n },\r\n // ... 更多坐标点\r\n ],\r\n \"task_frequency\": \"daily\", // 字符串,可选值: \"daily\"(每日)、\"weekly\"(每周)、\"monthly\"(每月)\r\n \"description\": \"巡护计划描述\", // 字符串,最大1000个字符\r\n \"status\": 1 // 数字,可选值: 0(禁用)、1(启用)\r\n}" ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string" } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| ## POST 创建任务 POST /api/admin/patrol/tasks > Body 请求参数 ```json "{\r\n \"plan_id\": 1, // 必填,关联的巡护计划ID\r\n \"task_name\": \"早班巡护任务\", // 必填,最大100字符\r\n \"task_type\": \"regular\", // 必填,枚举值:regular(常规)、emergency(紧急)\r\n \"patrol_date\": \"2024-02-20\", // 必填,巡护日期\r\n \"start_time\": \"08:00\", // 必填,格式HH:mm\r\n \"end_time\": \"10:00\", // 必填,格式HH:mm\r\n \"route_points\": [ // 可选,巡护路线点位\r\n {\r\n \"latitude\": 30.5866,\r\n \"longitude\": 114.2995\r\n }\r\n ],\r\n \"executor_ids\": [1, 2], // 必填,执行人ID列表,至少1人\r\n \"description\": \"重点检查湖区水质情况\", // 可选,最大1000字符\r\n \"priority\": 2, // 可选,默认2,1:高 2:中 3:低\r\n \"status\": 0 // 可选,默认0,0:待执行 1:执行中 2:已完成 3:已取消\r\n}" ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": { "id": 0 } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» id|integer|true|none||none| ## GET 获取任务列表 GET /api/admin/patrol/tasks ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": { "list": [ { "id": 0, "plan_id": 0, "task_name": "string", "task_type": "string", "patrol_date": "string", "start_time": "string", "end_time": "string", "route_points": [ { "latitude": null, "longitude": null } ], "executor_ids": [ 0 ], "description": "string", "priority": 0, "status": 0, "created_at": "string", "updated_at": "string", "created_by": 0, "updated_by": 0, "plan_name": "string", "plan_type": "string" } ], "pagination": { "total": 0, "page": 0, "page_size": 0, "total_pages": 0 } } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» list|[object]|true|none||none| |»»» id|integer|false|none||none| |»»» plan_id|integer|false|none||none| |»»» task_name|string|false|none||none| |»»» task_type|string|false|none||none| |»»» patrol_date|string|false|none||none| |»»» start_time|string|false|none||none| |»»» end_time|string|false|none||none| |»»» route_points|[object]|false|none||none| |»»»» latitude|number|false|none||none| |»»»» longitude|number|false|none||none| |»»» executor_ids|[integer]|false|none||none| |»»» description|string|false|none||none| |»»» priority|integer|false|none||none| |»»» status|integer|false|none||none| |»»» created_at|string|false|none||none| |»»» updated_at|string|false|none||none| |»»» created_by|integer|false|none||none| |»»» updated_by|integer|false|none||none| |»»» plan_name|string|false|none||none| |»»» plan_type|string|false|none||none| |»» pagination|object|true|none||none| |»»» total|integer|true|none||none| |»»» page|integer|true|none||none| |»»» page_size|integer|true|none||none| |»»» total_pages|integer|true|none||none| ## GET 获取计划详情 GET /api/admin/patrol/tasks/1 ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string", "data": { "id": 0, "plan_id": 0, "task_name": "string", "task_type": "string", "patrol_date": "string", "start_time": "string", "end_time": "string", "route_points": [ { "latitude": 0, "longitude": 0 } ], "executor_ids": [ 0 ], "description": "string", "priority": 0, "status": 0, "created_at": "string", "updated_at": "string", "created_by": 0, "updated_by": 0, "plan_name": "string", "plan_type": "string" } } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| |» data|object|true|none||none| |»» id|integer|true|none||none| |»» plan_id|integer|true|none||none| |»» task_name|string|true|none||none| |»» task_type|string|true|none||none| |»» patrol_date|string|true|none||none| |»» start_time|string|true|none||none| |»» end_time|string|true|none||none| |»» route_points|[object]|true|none||none| |»»» latitude|number|false|none||none| |»»» longitude|number|false|none||none| |»» executor_ids|[integer]|true|none||none| |»» description|string|true|none||none| |»» priority|integer|true|none||none| |»» status|integer|true|none||none| |»» created_at|string|true|none||none| |»» updated_at|string|true|none||none| |»» created_by|integer|true|none||none| |»» updated_by|integer|true|none||none| |»» plan_name|string|true|none||none| |»» plan_type|string|true|none||none| ## GET 获取执行人任务 GET /api/admin/patrol/tasks/executor/{executorId} > Body 请求参数 ```json "// 如果要查询ID为15的用户被分配的任务:\r\n// GET /api/admin/patrol/tasks/executor/15" ``` ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |executorId|path|string| 是 |none| |Authorization|header|string| 否 |none| |body|body|object| 否 |none| > 返回示例 > 200 Response ```json {} ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 ## POST 取消任务 POST /api/admin/patrol/tasks/1/cancel ### 请求参数 |名称|位置|类型|必选|说明| |---|---|---|---|---| |Authorization|header|string| 否 |none| > 返回示例 > 200 Response ```json { "success": true, "message": "string" } ``` ### 返回结果 |状态码|状态码含义|说明|数据模型| |---|---|---|---| |200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|none|Inline| ### 返回数据结构 状态码 **200** |名称|类型|必选|约束|中文名|说明| |---|---|---|---|---|---| |» success|boolean|true|none||none| |» message|string|true|none||none| # 数据模型