92 KiB
| title | language_tabs | toc_footers | includes | search | code_clipboard | highlight_theme | headingLevel | generator | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 智慧环境 |
|
true | true | darkula | 2 | @tarslib/widdershins v4.0.28 |
智慧环境
Base URLs:
Authentication
用户管理
POST 登录
POST /api/users/login
Body 请求参数
username: admin
password: admin123
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| body | body | object | 否 | none |
| » username | body | string | 否 | none |
| » password | body | string | 否 | none |
返回示例
200 Response
{
"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 | 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 | |
| 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 请求参数
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个字符 |
| body | string | 否 | 邮箱可选,需要符合邮箱格式 | |
| » phone | body | string | 否 | 手机号可选,11位手机号,以1开头 |
| » status | body | string | 否 | 状态可选,0表示禁用,1表示启用,默认为1 |
| » expire_time | body | string | 否 | 过期时间可选,ISO格式的日期时间字符串 |
返回示例
200 Response
{
"success": true,
"message": "string",
"data": {
"id": 0
}
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | 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 请求参数
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个字符 |
| 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
{
"success": true,
"message": "string"
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | 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
{
"success": true,
"message": "string"
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | none | Inline |
返回数据结构
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » success | boolean | true | none | none | |
| » message | string | true | none | none |
POST 重置用户密码
POST /api/users/3/reset-password
Body 请求参数
id: "3"
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| Authorization | header | string | 否 | none |
| body | body | object | 否 | none |
| » id | body | string | 否 | ID 编号 |
返回示例
200 Response
{
"success": true,
"message": "string",
"data": {
"tempPassword": "string"
}
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | 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
{
"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 | 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 | |
| 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 请求参数
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
{
"success": true,
"message": "string",
"data": {
"id": 0
}
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | 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 请求参数
id: "2"
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| Authorization | header | string | 否 | none |
| body | body | object | 否 | none |
| » id | body | string | 否 | ID 编号 |
返回示例
200 Response
{
"success": true,
"message": "string",
"data": {
"id": 0,
"name": "string",
"description": "string",
"created_at": "string",
"updated_at": "string",
"permissions": [
"string"
]
}
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | 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 请求参数
{
"name": "测试人员",
"description": "系统测试人员",
"permissions": [
1,
2,
3
]
}
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| Authorization | header | string | 否 | none |
| body | body | object | 否 | none |
返回示例
200 Response
{
"success": true,
"message": "string"
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | none | Inline |
返回数据结构
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » success | boolean | true | none | none | |
| » message | string | true | none | none |
DELETE 删除角色
DELETE /api/roles/4
Body 请求参数
id: "4"
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| Authorization | header | string | 否 | none |
| body | body | object | 否 | none |
| » id | body | string | 否 | ID 编号 |
返回示例
200 Response
{
"success": true,
"message": "string"
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | none | Inline |
返回数据结构
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » success | boolean | true | none | none | |
| » message | string | true | none | none |
报告管理
GET 获取报告列表
GET /api/reports
Body 请求参数
{
"page": "数字,可选,默认1",
"pageSize": "数字,可选,默认10",
"status": "数字,可选,筛选状态",
"startDate": "日期字符串,可选,筛选开始日期",
"endDate": "日期字符串,可选,筛选结束日期",
"keyword": "字符串,可选,搜索关键词"
}
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| Authorization | header | string | 否 | none |
| body | body | object | 否 | none |
返回示例
{
"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
}
]
}
{
"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 | 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 请求参数
{
"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
{
"success": true,
"message": "string",
"data": {
"id": 0
}
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | 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
{
"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 | 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 请求参数
{
"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
{
"success": true,
"message": "string"
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 400 | Bad Request | none | Inline |
返回数据结构
状态码 400
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » success | boolean | true | none | none | |
| » message | string | true | none | none |
DELETE 删除报告
DELETE /api/reports/1
返回示例
200 Response
{}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | none | Inline |
返回数据结构
POST 提交报告审核
POST /api/reports/2/submit
Body 请求参数
{}
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| Authorization | header | string | 否 | none |
| body | body | object | 否 | none |
返回示例
400 Response
{
"success": true,
"message": "string"
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 400 | Bad Request | none | Inline |
返回数据结构
状态码 400
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » success | boolean | true | none | none | |
| » message | string | true | none | none |
POST 审核报告
POST /api/reports/2/review
Body 请求参数
"{\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
{
"success": true,
"message": "string"
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | none | Inline |
返回数据结构
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » success | boolean | true | none | none | |
| » message | string | true | none | none |
GET 获取报告统计信息
GET /api/reports/statistics
Body 请求参数
{}
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| Authorization | header | string | 否 | none |
| body | body | object | 否 | none |
返回示例
200 Response
{
"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 | 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 请求参数
"{\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 | none | Inline |
返回数据结构
POST 批量删除报告
POST /api/reports/batch/delete
返回示例
200 Response
{}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | none | Inline |
返回数据结构
POST 导出单个报告
POST /api/reports/1/export
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| Authorization | header | string | 否 | none |
返回示例
200 Response
{}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | none | Inline |
返回数据结构
报告模板
GET 获取模板列表
GET /api/reports/templates
Body 请求参数
{}
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| Authorization | header | string | 否 | none |
| body | body | object | 否 | none |
返回示例
{
"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)"
}
]
}
{
"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 | none | Inline |
返回数据结构
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » success | boolean | true | none | none | |
| » message | string | true | none | none | |
| » data | [string] | true | none | none |
POST 创建模板
POST /api/reports/templates
Body 请求参数
{
"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
{
"success": true,
"message": "string",
"data": {
"id": 0
}
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | 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 |
返回示例
{
"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 | 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 请求参数
{
"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
{
"success": true,
"message": "string"
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | none | Inline |
返回数据结构
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » success | boolean | true | none | none | |
| » message | string | true | none | none |
DELETE 删除模板
DELETE /api/reports/templates/1
返回示例
200 Response
{}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | none | Inline |
返回数据结构
PUT 更新模板状态
PUT /api/reports/templates/1/status
Body 请求参数
"{\r\n \"status\": 1 // 必填,数字类型:0-禁用,1-启用\r\n}"
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| Authorization | header | string | 否 | none |
| body | body | object | 否 | none |
返回示例
200 Response
{
"success": true,
"message": "string"
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | none | Inline |
返回数据结构
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » success | boolean | true | none | none | |
| » message | string | true | none | none |
AIGC接口
GET 预警关键词
GET /
返回示例
200 Response
{}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | none | Inline |
返回数据结构
课程管理
GET 获取课程列表
GET /api/education/courses
Body 请求参数
"{\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 |
返回示例
{
"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 | 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 请求参数
"{\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 |
返回示例
{
"success": true,
"message": "创建课程成功",
"data": {
"id": 2
}
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | 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 |
返回示例
{
"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 | 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 请求参数
"// 至少包含一个要更新的字段)\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 |
返回示例
{
"success": true,
"message": "更新课程成功"
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | 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
{
"success": true,
"message": "string"
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | none | Inline |
返回数据结构
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » success | boolean | true | none | none | |
| » message | string | true | none | none |
PUT 更新课程状态
PUT /api/education/courses/1/status
Body 请求参数
"{\r\n \"status\": 1 // 必需,0-下架 1-上架\r\n}"
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| Authorization | header | string | 否 | none |
| body | body | object | 否 | none |
返回示例
200 Response
{
"success": true,
"message": "string"
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | 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
{
"success": true,
"message": "string",
"data": [
{
"category": "string",
"total_count": 0,
"online_count": "string"
}
]
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | 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
{}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | none | Inline |
返回数据结构
研学活动管理
POST 创建活动
POST /api/education/activities
Body 请求参数
{
"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
{
"success": true,
"message": "string",
"data": {
"id": 0
}
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | 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
{
"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 | 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
{
"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 | 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 请求参数
{
"description": "通过实地考察了解湿地生态系统的构成和保护措施,包括植物观察和水质检测",
"requirements": "1. 年龄8岁以上\n2. 需要家长陪同\n3. 请穿着运动鞋\n4. 自备饮用水",
"capacity": 35
}
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| Authorization | header | string | 否 | none |
| body | body | object | 否 | none |
返回示例
200 Response
{
"success": true,
"message": "string"
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | none | Inline |
返回数据结构
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » success | boolean | true | none | none | |
| » message | string | true | none | none |
PUT 更新活动状态
PUT /api/education/activities/1/status
Body 请求参数
"{\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
{
"success": true,
"message": "string"
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | 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
{
"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 | 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 请求参数
{
"limit": 1
}
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| limit | query | string | 否 | none |
| Authorization | header | string | 否 | none |
| body | body | object | 否 | none |
返回示例
200 Response
{
"success": true,
"message": "string",
"data": {
"is_full": true
}
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | 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 请求参数
"{\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
{
"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 | 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
{
"success": true,
"message": "string"
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | none | Inline |
返回数据结构
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » success | boolean | true | none | none | |
| » message | string | true | none | none |
POST 批量取消活动
POST /api/education/activities/batch/cancel
Body 请求参数
{
"ids": [
1,
2
]
}
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| Authorization | header | string | 否 | none |
| body | body | object | 否 | none |
返回示例
200 Response
{
"success": true,
"message": "string"
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | none | Inline |
返回数据结构
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » success | boolean | true | none | none | |
| » message | string | true | none | none |
知识库管理
POST 创建知识条目
POST /api/education/knowledge
Body 请求参数
{
"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
{
"success": true,
"message": "string",
"data": {
"id": 0
}
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | 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
{
"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 | 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
{
"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 | 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 请求参数
{
"title": "湿地生态系统保护指南",
"content": "更新后的内容...",
"tags": [
"湿地保护",
"生态系统",
"环境保护",
"科普教育"
]
}
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| Authorization | header | string | 否 | none |
| body | body | object | 否 | none |
返回示例
200 Response
{
"success": true,
"message": "string"
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | none | Inline |
返回数据结构
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » success | boolean | true | none | none | |
| » message | string | true | none | none |
PUT 更新知识状态
PUT /api/education/knowledge/1/status
Body 请求参数
{
"status": 0
}
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| Authorization | header | string | 否 | none |
| body | body | object | 否 | none |
返回示例
200 Response
{
"success": true,
"message": "string"
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | 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
{
"success": true,
"message": "string"
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | 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
{
"success": true,
"message": "string"
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | none | Inline |
返回数据结构
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » success | boolean | true | none | none | |
| » message | string | true | none | none |
POST 根据标签获取知识
POST /api/education/knowledge/tags
Body 请求参数
{
"tags": [
"湿地保护",
"生态系统",
"环境保护",
"科普教育"
]
}
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| Authorization | header | string | 否 | none |
| body | body | object | 否 | none |
返回示例
200 Response
{
"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 | 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
{
"success": true,
"message": "string",
"data": [
{
"category": "string",
"total_count": 0,
"online_count": "string",
"total_views": "string",
"total_likes": "string"
}
]
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | 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 请求参数
"{\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
{
"success": true,
"message": "string"
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | none | Inline |
返回数据结构
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » success | boolean | true | none | none | |
| » message | string | true | none | none |
POST 批量删除知识
POST /api/education/knowledge/batch/delete
Body 请求参数
"{\r\n \"ids\": [1, 2] // 要删除的知识ID数组\r\n}"
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| Authorization | header | string | 否 | none |
| body | body | object | 否 | none |
返回示例
200 Response
{
"success": true,
"message": "string"
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | 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
{
"success": true,
"message": "string"
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | none | Inline |
返回数据结构
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » success | boolean | true | none | none | |
| » message | string | true | none | none |
设备接口
POST 上传设备数据
POST /api/device/update
(不要做用户鉴权)
Body 请求参数
"{\n \"temperature\":{{$number.int(max=100)}},\n \"humidity\": {{$number.int(max=100)}}\n}"
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| token | header | string | 否 | none |
| body | body | object | 否 | none |
返回示例
200 Response
{}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | none | Inline |