package manage import ( "vamicro/iotData-service/model" "vamicro/iotData-service/serializer" ) type HandleWarningService struct { Id uint `form:"id" json:"id"` } func (service *HandleWarningService) Handle() serializer.Response { code := 200 db := model.DB.Table("warnings") if err := db.Where("id = ?", service.Id).Update("status", 1).Error; err != nil { code = 30001 return serializer.Response{ Status: code, Msg: "数据库错误", Error: err.Error(), } } return serializer.Response{ Status: code, // Data: warns, Msg: "处理成功", } }