feat: support ins pause and enable

This commit is contained in:
engigu
2024-01-14 17:05:35 +08:00
parent c935182412
commit 6349c1e1b7
8 changed files with 115 additions and 26 deletions
+9
View File
@@ -9,6 +9,7 @@ type SendTasksIns struct {
ContentType string `json:"content_type" gorm:"type:varchar(100) comment '实例类型';default:'';index:content_type"`
Config string `json:"config" gorm:"type:text comment '实例配置';"`
Extra string `json:"extra" gorm:"type:text comment '额外信息';"`
Enable int `json:"enable" gorm:"type:int comment '开启、暂停状态';default:1;"`
}
// InsEmailConfig 实例里面的邮箱config
@@ -61,3 +62,11 @@ func DeleteMsgTaskIns(id string) error {
}
return nil
}
// UpdateMsgTaskIns 更新实例
func UpdateMsgTaskIns(id string, data map[string]interface{}) error {
if err := db.Model(&SendTasksIns{}).Where("id = ?", id).Updates(data).Error; err != nil {
return err
}
return nil
}