Commit f12500f6 authored by 陈子龙's avatar 陈子龙

自动化运维 立即执行 fix

parent 478ef3ef
...@@ -33,10 +33,10 @@ type ListTaskManageReq struct { ...@@ -33,10 +33,10 @@ type ListTaskManageReq struct {
} }
type ExecScriptReq struct { type ExecScriptReq struct {
TaskId int `json:"task_id" binding:"required"` //主机分组id TaskId int `form:"task_id" binding:"required"` //主机分组id
HostGroupId int `form:"host_group_id" binding:"required"` //主机分组id HostGroupId int `form:"host_group_id" binding:"required"` //主机分组id
Type int `json:"type" binding:"oneof=1 2"` //脚本额外变量类型1yaml 2json Type int `form:"type" binding:"oneof=1 2"` //脚本额外变量类型1yaml 2json
Value string `json:"value"` //脚本额外变量值 Value string `form:"value"` //脚本额外变量值
Script string `json:"script"` //执行脚本 Script string `form:"script"` //执行脚本
YmlFileName string `json:"yml_file_name"` //执行脚本url YmlFileName string `form:"yml_file_name"` //执行脚本url
} }
...@@ -123,7 +123,7 @@ func ListTaskManage(c *gin.Context) { ...@@ -123,7 +123,7 @@ func ListTaskManage(c *gin.Context) {
func ExecScript(c *gin.Context) { func ExecScript(c *gin.Context) {
var req request.ExecScriptReq var req request.ExecScriptReq
if err := c.ShouldBindJSON(&req); err != nil { if err := c.ShouldBind(&req); err != nil {
SendJsonResponse(c, resp.InvalidParam.WithError(err), nil) SendJsonResponse(c, resp.InvalidParam.WithError(err), nil)
return return
} }
......
...@@ -232,7 +232,7 @@ func (t *TaskManageSvc) ExecScript(req request.ExecScriptReq) (err error) { ...@@ -232,7 +232,7 @@ func (t *TaskManageSvc) ExecScript(req request.ExecScriptReq) (err error) {
//新增任务历史 //新增任务历史
id, err := AddExecHistory(request.AddExecHistory{ id, err := AddExecHistory(request.AddExecHistory{
TaskId: req.TaskId, TaskId: req.TaskId,
CreateUser: t.User.SystemAccount, CreateUser: "",
}) })
if err != nil { if err != nil {
return return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment