去掉设备信息中的status字段
This commit is contained in:
@@ -119,7 +119,6 @@ func (c *Controller) Create(ctx *gin.Context) {
|
||||
Name: req.Name,
|
||||
Type: req.Type,
|
||||
ParentID: req.ParentID,
|
||||
Status: "active", // 默认设置为active状态
|
||||
}
|
||||
|
||||
if err := c.deviceRepo.Create(device); err != nil {
|
||||
@@ -176,9 +175,7 @@ func (c *Controller) Update(ctx *gin.Context) {
|
||||
device.Name = req.Name
|
||||
device.Type = req.Type
|
||||
device.ParentID = req.ParentID
|
||||
// TODO: 设备状态应该由系统自动获取,而不是由用户指定
|
||||
// 这里保持设备原有状态,后续需要实现自动状态检测
|
||||
// device.Status = req.Status
|
||||
// 设备状态现在只在内存中维护,不持久化到数据库
|
||||
|
||||
if err := c.deviceRepo.Update(device); err != nil {
|
||||
c.logger.Error("更新设备失败: " + err.Error())
|
||||
|
||||
Reference in New Issue
Block a user