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