feat: 增加设备空闲状态检测配置
主要修改: 1. 在SystemConfigService中新增获取设备空闲状态的方法。 2. 更新DeviceStatusService和DeviceStatusCheckService,使用可配置的空闲状态字符串替代硬编码。 3. 在文档中添加设备检测相关配置的说明,提升系统灵活性和可维护性。 技术细节: - 通过引入设备空闲状态的配置,支持多语言环境下的设备状态标识,便于系统维护和扩展。
This commit is contained in:
53
test_device_idle_config.http
Normal file
53
test_device_idle_config.http
Normal file
@@ -0,0 +1,53 @@
|
||||
### 测试设备空闲状态配置项
|
||||
### 测试前请确保已执行数据库迁移脚本: docs/database_migration_add_device_idle_status.sql
|
||||
|
||||
### 1. 获取设备空闲状态配置
|
||||
GET http://localhost:8080/api/admin/config/key/device.idle_status
|
||||
Authorization: Bearer {{token}}
|
||||
|
||||
### 2. 创建设备空闲状态配置(如果不存在)
|
||||
POST http://localhost:8080/api/admin/config
|
||||
Content-Type: application/json
|
||||
Authorization: Bearer {{token}}
|
||||
|
||||
{
|
||||
"configKey": "device.idle_status",
|
||||
"configValue": "空闲",
|
||||
"configType": "STRING",
|
||||
"description": "设备空闲状态的字符串标识,用于判断设备是否处于空闲状态",
|
||||
"isSystem": true
|
||||
}
|
||||
|
||||
### 3. 更新设备空闲状态配置为其他值(测试灵活性)
|
||||
PUT http://localhost:8080/api/admin/config/{{configId}}
|
||||
Content-Type: application/json
|
||||
Authorization: Bearer {{token}}
|
||||
|
||||
{
|
||||
"configKey": "device.idle_status",
|
||||
"configValue": "idle",
|
||||
"configType": "STRING",
|
||||
"description": "设备空闲状态的字符串标识,用于判断设备是否处于空闲状态",
|
||||
"isSystem": true
|
||||
}
|
||||
|
||||
### 4. 恢复默认值
|
||||
PUT http://localhost:8080/api/admin/config/{{configId}}
|
||||
Content-Type: application/json
|
||||
Authorization: Bearer {{token}}
|
||||
|
||||
{
|
||||
"configKey": "device.idle_status",
|
||||
"configValue": "空闲",
|
||||
"configType": "STRING",
|
||||
"description": "设备空闲状态的字符串标识,用于判断设备是否处于空闲状态",
|
||||
"isSystem": true
|
||||
}
|
||||
|
||||
### 5. 获取所有系统配置查看是否包含新配置项
|
||||
GET http://localhost:8080/api/admin/config/list?page=1&size=50
|
||||
Authorization: Bearer {{token}}
|
||||
|
||||
### 6. 根据类型获取STRING类型配置
|
||||
GET http://localhost:8080/api/admin/config/type/STRING
|
||||
Authorization: Bearer {{token}}
|
||||
Reference in New Issue
Block a user