snapshot: AnsibleManager拆分前快照

This commit is contained in:
attacker committed 2026-06-15 10:01:24 +08:00
1 parent 16205fdb2b
commit e6d9f364e5
13 files changed
+660 -103

No files matched your search

@@ -205,6 +205,40 @@ func (h *AutomationHandler) DeleteScript(c *gin.Context) {
})
}
// BatchDeleteScripts 批量删除脚本
// @Summary 批量删除脚本
// @Description 批量删除脚本
// @Tags 自动化运维
// @Accept json
// @Produce json
// @Security Bearer
// @Param request body models.IDsRequest true "删除请求"
// @Success 200 {object} models.Response
// @Router /scripts/batch-delete [post]
func (h *AutomationHandler) BatchDeleteScripts(c *gin.Context) {
var req models.IDsRequest
if err := c.ShouldBindJSON(&req); err != nil {
c.JSON(http.StatusBadRequest, models.Response{
Code: 400,
Message: "请求参数错误",
})
return
}
if err := h.db.Delete(&models.Script{}, req.IDs).Error; err != nil {
c.JSON(http.StatusInternalServerError, models.Response{
Code: 500,
Message: "删除失败",
})
return
}
c.JSON(http.StatusOK, models.Response{
Code: 200,
Message: "删除成功",
})
}
// ExecuteScript 执行脚本
// @Summary 执行脚本
// @Description 在目标服务器上执行脚本