updated startall apis
Former-commit-id: a3f4540e8df1ed68897864eb4c2e04ff94104eec
This commit is contained in:
parent
179af7cd4a
commit
96626932ea
|
@ -122,7 +122,7 @@ type (
|
||||||
}
|
}
|
||||||
|
|
||||||
StartAllByDeployTaskIdReq {
|
StartAllByDeployTaskIdReq {
|
||||||
Id string `form:"deployTaskid"`
|
Id string `form:"deployTaskId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
StartAllByDeployTaskIdResp {
|
StartAllByDeployTaskIdResp {
|
||||||
|
@ -130,7 +130,7 @@ type (
|
||||||
}
|
}
|
||||||
|
|
||||||
StopAllByDeployTaskIdReq {
|
StopAllByDeployTaskIdReq {
|
||||||
Id string `form:"deployTaskid"`
|
Id string `form:"deployTaskId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
StopAllByDeployTaskIdResp {
|
StopAllByDeployTaskIdResp {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package inference
|
package inference
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/zeromicro/go-zero/rest/httpx"
|
"github.com/zeromicro/go-zero/rest/httpx"
|
||||||
|
@ -13,16 +14,13 @@ func StartAllByDeployTaskIdHandler(svcCtx *svc.ServiceContext) http.HandlerFunc
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
var req types.StartAllByDeployTaskIdReq
|
var req types.StartAllByDeployTaskIdReq
|
||||||
if err := httpx.Parse(r, &req); err != nil {
|
if err := httpx.Parse(r, &req); err != nil {
|
||||||
httpx.ErrorCtx(r.Context(), w, err)
|
result.ParamErrorResult(r, w, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
l := inference.NewStartAllByDeployTaskIdLogic(r.Context(), svcCtx)
|
l := inference.NewStartAllByDeployTaskIdLogic(r.Context(), svcCtx)
|
||||||
resp, err := l.StartAllByDeployTaskId(&req)
|
resp, err := l.StartAllByDeployTaskId(&req)
|
||||||
if err != nil {
|
result.HttpResult(r, w, resp, err)
|
||||||
httpx.ErrorCtx(r.Context(), w, err)
|
|
||||||
} else {
|
|
||||||
httpx.OkJsonCtx(r.Context(), w, resp)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package inference
|
package inference
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"github.com/zeromicro/go-zero/rest/httpx"
|
"github.com/zeromicro/go-zero/rest/httpx"
|
||||||
|
@ -13,16 +14,13 @@ func StopAllByDeployTaskIdHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
var req types.StopAllByDeployTaskIdReq
|
var req types.StopAllByDeployTaskIdReq
|
||||||
if err := httpx.Parse(r, &req); err != nil {
|
if err := httpx.Parse(r, &req); err != nil {
|
||||||
httpx.ErrorCtx(r.Context(), w, err)
|
result.ParamErrorResult(r, w, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
l := inference.NewStopAllByDeployTaskIdLogic(r.Context(), svcCtx)
|
l := inference.NewStopAllByDeployTaskIdLogic(r.Context(), svcCtx)
|
||||||
resp, err := l.StopAllByDeployTaskId(&req)
|
resp, err := l.StopAllByDeployTaskId(&req)
|
||||||
if err != nil {
|
result.HttpResult(r, w, resp, err)
|
||||||
httpx.ErrorCtx(r.Context(), w, err)
|
|
||||||
} else {
|
|
||||||
httpx.OkJsonCtx(r.Context(), w, resp)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue