增加房间设备访问日志修改接口

This commit is contained in:
zhihao
2025-12-30 13:43:03 +08:00
parent 125ffd5e2b
commit 3375c23d6a
2 changed files with 105 additions and 1 deletions

View File

@@ -220,4 +220,63 @@ ALTER TABLE `tbl_roomvisitlogform` ADD COLUMN `EquipmentOnlineStatus` varchar(25
```
**开发人员**
技术团队
技术团队
## 2025-12-30
### 新增接口
#### 房间设备访问日志修改接口
**接口地址**
`/Upgrade/UpdateRoomVisitLog`
**请求方式**
`POST`
**请求参数**
| 参数名 | 类型 | 必填 | 描述 |
| --- | --- | --- | --- |
| id | int | 是 | 日志ID必填参数必须大于0 |
| faultDescription | string | 是 | 故障情况描述 |
| equipmentStatusType | string | 是 | 故障类型 |
**返回结果**
```json
{
"Status": 1, // 1成功0失败-1异常
"Message": "更新成功", // 操作结果描述
"Count": 1 // 更新记录数量
}
```
**功能描述**
该接口用于修改 `tbl_roomvisitlogform` 表中的故障描述和故障类型信息根据传入的日志ID更新对应记录。
**使用示例**
```javascript
fetch('/Upgrade/UpdateRoomVisitLog', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
body: JSON.stringify({
id: 123,
faultDescription: "设备温度过高",
equipmentStatusType: "高温故障"
})
})
.then(response => response.json())
.then(data => {
console.log(data);
// 输出:{"Status":1,"Message":"更新成功","Count":1}
});
```
**开发人员**
系统开发团队
**备注**
- 该接口使用参数化查询防止SQL注入
- 包含完整的参数验证和异常处理机制
- 与现有的查询接口 `QueryRoomVisitLog` 配套使用,实现故障记录的修改功能