diff --git a/api/desc/core/pcm-core.api b/api/desc/core/pcm-core.api index a61f1a35..56751a8e 100644 --- a/api/desc/core/pcm-core.api +++ b/api/desc/core/pcm-core.api @@ -109,7 +109,6 @@ type ( ) type ( - commitVmTaskReq { Name string `json:"name"` NsID string `json:"nsID"` diff --git a/api/desc/hpc/pcm-hpc.api b/api/desc/hpc/pcm-hpc.api index 23bb516c..2a971c4d 100644 --- a/api/desc/hpc/pcm-hpc.api +++ b/api/desc/hpc/pcm-hpc.api @@ -38,12 +38,15 @@ type ( StdErrFile string `json:"stdErrFile,optional"` StdInput string `json:"stdInput,optional"` Environment map[string]string `json:"environment,optional"` + ClusterType string `json:"clusterType,optional"` } ) type ( commitHpcTaskResp { TaskId int64 `json:"taskId"` + Code int32 `json:"code"` + Msg string `json:"msg"` } ) diff --git a/api/internal/handler/adapters/adapterslisthandler.go b/api/internal/handler/adapters/adapterslisthandler.go deleted file mode 100644 index 3d84c0c8..00000000 --- a/api/internal/handler/adapters/adapterslisthandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package adapters - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/adapters" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func AdaptersListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.AdapterQueryReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := adapters.NewAdaptersListLogic(r.Context(), svcCtx) - resp, err := l.AdaptersList(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/adapters/clusterlisthandler.go b/api/internal/handler/adapters/clusterlisthandler.go deleted file mode 100644 index f1863304..00000000 --- a/api/internal/handler/adapters/clusterlisthandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package adapters - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/adapters" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ClusterListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ClusterReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := adapters.NewClusterListLogic(r.Context(), svcCtx) - resp, err := l.ClusterList(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/adapters/createadapterhandler.go b/api/internal/handler/adapters/createadapterhandler.go deleted file mode 100644 index 42b60968..00000000 --- a/api/internal/handler/adapters/createadapterhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package adapters - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/adapters" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func CreateAdapterHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.AdapterCreateReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := adapters.NewCreateAdapterLogic(r.Context(), svcCtx) - resp, err := l.CreateAdapter(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/adapters/createclusterhandler.go b/api/internal/handler/adapters/createclusterhandler.go deleted file mode 100644 index 80eaa0de..00000000 --- a/api/internal/handler/adapters/createclusterhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package adapters - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/adapters" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func CreateClusterHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ClusterCreateReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := adapters.NewCreateClusterLogic(r.Context(), svcCtx) - resp, err := l.CreateCluster(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/adapters/deleteadapterhandler.go b/api/internal/handler/adapters/deleteadapterhandler.go deleted file mode 100644 index b2e1c7ca..00000000 --- a/api/internal/handler/adapters/deleteadapterhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package adapters - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/adapters" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func DeleteAdapterHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.AdapterDelReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := adapters.NewDeleteAdapterLogic(r.Context(), svcCtx) - resp, err := l.DeleteAdapter(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/adapters/deleteclusterhandler.go b/api/internal/handler/adapters/deleteclusterhandler.go deleted file mode 100644 index 62e800f1..00000000 --- a/api/internal/handler/adapters/deleteclusterhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package adapters - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/adapters" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func DeleteClusterHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.FId - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := adapters.NewDeleteClusterLogic(r.Context(), svcCtx) - resp, err := l.DeleteCluster(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/adapters/getadapterhandler.go b/api/internal/handler/adapters/getadapterhandler.go deleted file mode 100644 index 2e4e189d..00000000 --- a/api/internal/handler/adapters/getadapterhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package adapters - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/adapters" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func GetAdapterHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.AdapterDelReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := adapters.NewGetAdapterLogic(r.Context(), svcCtx) - resp, err := l.GetAdapter(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/adapters/getadapterrelationhandler.go b/api/internal/handler/adapters/getadapterrelationhandler.go deleted file mode 100644 index 13212c35..00000000 --- a/api/internal/handler/adapters/getadapterrelationhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package adapters - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/adapters" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func GetAdapterRelationHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.AdapterRelationQueryReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := adapters.NewGetAdapterRelationLogic(r.Context(), svcCtx) - resp, err := l.GetAdapterRelation(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/adapters/getclusterhandler.go b/api/internal/handler/adapters/getclusterhandler.go deleted file mode 100644 index 865e861f..00000000 --- a/api/internal/handler/adapters/getclusterhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package adapters - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/adapters" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func GetClusterHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.FId - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := adapters.NewGetClusterLogic(r.Context(), svcCtx) - resp, err := l.GetCluster(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/adapters/getclustersumhandler.go b/api/internal/handler/adapters/getclustersumhandler.go deleted file mode 100644 index 18fd747e..00000000 --- a/api/internal/handler/adapters/getclustersumhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package adapters - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/adapters" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func GetClusterSumHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ClusterSumReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := adapters.NewGetClusterSumLogic(r.Context(), svcCtx) - resp, err := l.GetClusterSum(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/adapters/updateadapterhandler.go b/api/internal/handler/adapters/updateadapterhandler.go deleted file mode 100644 index 3800fc16..00000000 --- a/api/internal/handler/adapters/updateadapterhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package adapters - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/adapters" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func UpdateAdapterHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.AdapterReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := adapters.NewUpdateAdapterLogic(r.Context(), svcCtx) - resp, err := l.UpdateAdapter(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/adapters/updateclusterhandler.go b/api/internal/handler/adapters/updateclusterhandler.go deleted file mode 100644 index f5405d64..00000000 --- a/api/internal/handler/adapters/updateclusterhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package adapters - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/adapters" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func UpdateClusterHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ClusterCreateReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := adapters.NewUpdateClusterLogic(r.Context(), svcCtx) - resp, err := l.UpdateCluster(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/ai/createalgorithmhandler.go b/api/internal/handler/ai/createalgorithmhandler.go deleted file mode 100644 index e0ebcb34..00000000 --- a/api/internal/handler/ai/createalgorithmhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package ai - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/ai" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func CreateAlgorithmHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.CreateAlgorithmReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := ai.NewCreateAlgorithmLogic(r.Context(), svcCtx) - resp, err := l.CreateAlgorithm(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/ai/createdatasethandler.go b/api/internal/handler/ai/createdatasethandler.go deleted file mode 100644 index 57bb2728..00000000 --- a/api/internal/handler/ai/createdatasethandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package ai - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/ai" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func CreateDataSetHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.CreateDataSetReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := ai.NewCreateDataSetLogic(r.Context(), svcCtx) - resp, err := l.CreateDataSet(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/ai/createexporttaskhandler.go b/api/internal/handler/ai/createexporttaskhandler.go deleted file mode 100644 index bcc64381..00000000 --- a/api/internal/handler/ai/createexporttaskhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package ai - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/ai" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func CreateExportTaskHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.CreateExportTaskReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := ai.NewCreateExportTaskLogic(r.Context(), svcCtx) - resp, err := l.CreateExportTask(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/ai/createnotebookhandler.go b/api/internal/handler/ai/createnotebookhandler.go deleted file mode 100644 index 4bf997fc..00000000 --- a/api/internal/handler/ai/createnotebookhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package ai - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/ai" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func CreateNotebookHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.CreateNotebookReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := ai.NewCreateNotebookLogic(r.Context(), svcCtx) - resp, err := l.CreateNotebook(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/ai/createprocessortaskhandler.go b/api/internal/handler/ai/createprocessortaskhandler.go deleted file mode 100644 index b2dc6f55..00000000 --- a/api/internal/handler/ai/createprocessortaskhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package ai - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/ai" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func CreateProcessorTaskHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.CreateProcessorTaskReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := ai.NewCreateProcessorTaskLogic(r.Context(), svcCtx) - resp, err := l.CreateProcessorTask(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/ai/createservicehandler.go b/api/internal/handler/ai/createservicehandler.go deleted file mode 100644 index dd8ef32a..00000000 --- a/api/internal/handler/ai/createservicehandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package ai - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/ai" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func CreateServiceHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.CreateServiceReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := ai.NewCreateServiceLogic(r.Context(), svcCtx) - resp, err := l.CreateService(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/ai/createtaskhandler.go b/api/internal/handler/ai/createtaskhandler.go deleted file mode 100644 index c1632e63..00000000 --- a/api/internal/handler/ai/createtaskhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package ai - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/ai" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func CreateTaskHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ImportTaskDataReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := ai.NewCreateTaskLogic(r.Context(), svcCtx) - resp, err := l.CreateTask(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/ai/createtrainingjobhandler.go b/api/internal/handler/ai/createtrainingjobhandler.go deleted file mode 100644 index f159bf06..00000000 --- a/api/internal/handler/ai/createtrainingjobhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package ai - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/ai" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func CreateTrainingJobHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.CreateTrainingJobReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := ai.NewCreateTrainingJobLogic(r.Context(), svcCtx) - resp, err := l.CreateTrainingJob(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/ai/createvisualizationjobhandler.go b/api/internal/handler/ai/createvisualizationjobhandler.go deleted file mode 100644 index b66ffa7c..00000000 --- a/api/internal/handler/ai/createvisualizationjobhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package ai - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/ai" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func CreateVisualizationJobHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.CreateVisualizationJobReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := ai.NewCreateVisualizationJobLogic(r.Context(), svcCtx) - resp, err := l.CreateVisualizationJob(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/ai/deletealgorithmhandler.go b/api/internal/handler/ai/deletealgorithmhandler.go deleted file mode 100644 index 57630af0..00000000 --- a/api/internal/handler/ai/deletealgorithmhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package ai - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/ai" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func DeleteAlgorithmHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.DeleteAlgorithmReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := ai.NewDeleteAlgorithmLogic(r.Context(), svcCtx) - resp, err := l.DeleteAlgorithm(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/ai/deletedatasethandler.go b/api/internal/handler/ai/deletedatasethandler.go deleted file mode 100644 index 84288d1c..00000000 --- a/api/internal/handler/ai/deletedatasethandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package ai - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/ai" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func DeleteDataSetHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.DeleteDataSetReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := ai.NewDeleteDataSetLogic(r.Context(), svcCtx) - resp, err := l.DeleteDataSet(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/ai/deleteservicehandler.go b/api/internal/handler/ai/deleteservicehandler.go deleted file mode 100644 index effb9aad..00000000 --- a/api/internal/handler/ai/deleteservicehandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package ai - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/ai" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func DeleteServiceHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.DeleteServiceReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := ai.NewDeleteServiceLogic(r.Context(), svcCtx) - resp, err := l.DeleteService(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/ai/deletetrainingjobhandler.go b/api/internal/handler/ai/deletetrainingjobhandler.go deleted file mode 100644 index d0666ef7..00000000 --- a/api/internal/handler/ai/deletetrainingjobhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package ai - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/ai" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func DeleteTrainingJobHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.DeleteTrainingJobReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := ai.NewDeleteTrainingJobLogic(r.Context(), svcCtx) - resp, err := l.DeleteTrainingJob(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/ai/getexporttasksofdatasethandler.go b/api/internal/handler/ai/getexporttasksofdatasethandler.go deleted file mode 100644 index bf45832a..00000000 --- a/api/internal/handler/ai/getexporttasksofdatasethandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package ai - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/ai" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func GetExportTasksOfDatasetHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.GetExportTasksOfDatasetReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := ai.NewGetExportTasksOfDatasetLogic(r.Context(), svcCtx) - resp, err := l.GetExportTasksOfDataset(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/ai/getexporttaskstatusofdatasethandler.go b/api/internal/handler/ai/getexporttaskstatusofdatasethandler.go deleted file mode 100644 index 3a7c0337..00000000 --- a/api/internal/handler/ai/getexporttaskstatusofdatasethandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package ai - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/ai" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func GetExportTaskStatusOfDatasetHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.GetExportTaskStatusOfDatasetReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := ai.NewGetExportTaskStatusOfDatasetLogic(r.Context(), svcCtx) - resp, err := l.GetExportTaskStatusOfDataset(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/ai/getlisttrainingjobshandler.go b/api/internal/handler/ai/getlisttrainingjobshandler.go deleted file mode 100644 index 3f978dba..00000000 --- a/api/internal/handler/ai/getlisttrainingjobshandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package ai - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/ai" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func GetListTrainingJobsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ListTrainingJobsreq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := ai.NewGetListTrainingJobsLogic(r.Context(), svcCtx) - resp, err := l.GetListTrainingJobs(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/ai/getnotebookstoragehandler.go b/api/internal/handler/ai/getnotebookstoragehandler.go deleted file mode 100644 index 2c7618c8..00000000 --- a/api/internal/handler/ai/getnotebookstoragehandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package ai - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/ai" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func GetNotebookStorageHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.GetNotebookStorageReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := ai.NewGetNotebookStorageLogic(r.Context(), svcCtx) - resp, err := l.GetNotebookStorage(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/ai/getvisualizationjobhandler.go b/api/internal/handler/ai/getvisualizationjobhandler.go deleted file mode 100644 index 51f41ed1..00000000 --- a/api/internal/handler/ai/getvisualizationjobhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package ai - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/ai" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func GetVisualizationJobHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.GetVisualizationJobReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := ai.NewGetVisualizationJobLogic(r.Context(), svcCtx) - resp, err := l.GetVisualizationJob(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/ai/listalgorithmshandler.go b/api/internal/handler/ai/listalgorithmshandler.go deleted file mode 100644 index 56c2ded7..00000000 --- a/api/internal/handler/ai/listalgorithmshandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package ai - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/ai" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ListAlgorithmsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ListAlgorithmsReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := ai.NewListAlgorithmsLogic(r.Context(), svcCtx) - resp, err := l.ListAlgorithms(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/ai/listclustershandler.go b/api/internal/handler/ai/listclustershandler.go deleted file mode 100644 index 50ad73bd..00000000 --- a/api/internal/handler/ai/listclustershandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package ai - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/ai" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ListClustersHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ListClustersReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := ai.NewListClustersLogic(r.Context(), svcCtx) - resp, err := l.ListClusters(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/ai/listdatasethandler.go b/api/internal/handler/ai/listdatasethandler.go deleted file mode 100644 index 78f06ffa..00000000 --- a/api/internal/handler/ai/listdatasethandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package ai - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/ai" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ListDataSetHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.DataSetReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := ai.NewListDataSetLogic(r.Context(), svcCtx) - resp, err := l.ListDataSet(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/ai/listimporthandler.go b/api/internal/handler/ai/listimporthandler.go deleted file mode 100644 index 32a8c6d0..00000000 --- a/api/internal/handler/ai/listimporthandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package ai - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/ai" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ListImportHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ListImportTasksReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := ai.NewListImportLogic(r.Context(), svcCtx) - resp, err := l.ListImport(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/ai/listnotebookhandler.go b/api/internal/handler/ai/listnotebookhandler.go deleted file mode 100644 index b1375aeb..00000000 --- a/api/internal/handler/ai/listnotebookhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package ai - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/ai" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ListNotebookHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ListNotebookReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := ai.NewListNotebookLogic(r.Context(), svcCtx) - resp, err := l.ListNotebook(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/ai/listserviceshandler.go b/api/internal/handler/ai/listserviceshandler.go deleted file mode 100644 index df823191..00000000 --- a/api/internal/handler/ai/listserviceshandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package ai - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/ai" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ListServicesHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ListServicesReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := ai.NewListServicesLogic(r.Context(), svcCtx) - resp, err := l.ListServices(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/ai/mountnotebookstoragehandler.go b/api/internal/handler/ai/mountnotebookstoragehandler.go deleted file mode 100644 index 324c9708..00000000 --- a/api/internal/handler/ai/mountnotebookstoragehandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package ai - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/ai" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func MountNotebookStorageHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.MountNotebookStorageReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := ai.NewMountNotebookStorageLogic(r.Context(), svcCtx) - resp, err := l.MountNotebookStorage(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/ai/showalgorithmbyuuidhandler.go b/api/internal/handler/ai/showalgorithmbyuuidhandler.go deleted file mode 100644 index a2951560..00000000 --- a/api/internal/handler/ai/showalgorithmbyuuidhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package ai - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/ai" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ShowAlgorithmByUuidHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ShowAlgorithmByUuidReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := ai.NewShowAlgorithmByUuidLogic(r.Context(), svcCtx) - resp, err := l.ShowAlgorithmByUuid(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/ai/showservicehandler.go b/api/internal/handler/ai/showservicehandler.go deleted file mode 100644 index d6a9f4b4..00000000 --- a/api/internal/handler/ai/showservicehandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package ai - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/ai" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ShowServiceHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ShowServiceReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := ai.NewShowServiceLogic(r.Context(), svcCtx) - resp, err := l.ShowService(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/ai/startnotebookhandler.go b/api/internal/handler/ai/startnotebookhandler.go deleted file mode 100644 index 1416d911..00000000 --- a/api/internal/handler/ai/startnotebookhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package ai - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/ai" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func StartNotebookHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.StartNotebookReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := ai.NewStartNotebookLogic(r.Context(), svcCtx) - resp, err := l.StartNotebook(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/ai/stopnotebookhandler.go b/api/internal/handler/ai/stopnotebookhandler.go deleted file mode 100644 index b6fd7cce..00000000 --- a/api/internal/handler/ai/stopnotebookhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package ai - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/ai" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func StopNotebookHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.StopNotebookReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := ai.NewStopNotebookLogic(r.Context(), svcCtx) - resp, err := l.StopNotebook(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/apps/appdetailhandler.go b/api/internal/handler/apps/appdetailhandler.go deleted file mode 100644 index d668a226..00000000 --- a/api/internal/handler/apps/appdetailhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package apps - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/apps" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func AppDetailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.AppDetailReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := apps.NewAppDetailLogic(r.Context(), svcCtx) - resp, err := l.AppDetail(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/apps/applisthandler.go b/api/internal/handler/apps/applisthandler.go deleted file mode 100644 index 823cb985..00000000 --- a/api/internal/handler/apps/applisthandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package apps - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/apps" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func AppListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.AppListReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := apps.NewAppListLogic(r.Context(), svcCtx) - resp, err := l.AppList(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/apps/apppodshandler.go b/api/internal/handler/apps/apppodshandler.go deleted file mode 100644 index ef3e0466..00000000 --- a/api/internal/handler/apps/apppodshandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package apps - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/apps" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func AppPodsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.AppDetailReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := apps.NewAppPodsLogic(r.Context(), svcCtx) - resp, err := l.AppPods(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/apps/deleteappbyappnamehandler.go b/api/internal/handler/apps/deleteappbyappnamehandler.go deleted file mode 100644 index a6c9efa6..00000000 --- a/api/internal/handler/apps/deleteappbyappnamehandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package apps - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/apps" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func DeleteAppByAppNameHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.DeleteAppReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := apps.NewDeleteAppByAppNameLogic(r.Context(), svcCtx) - resp, err := l.DeleteAppByAppName(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/apps/getappbyappnamehandler.go b/api/internal/handler/apps/getappbyappnamehandler.go deleted file mode 100644 index d7dd16c2..00000000 --- a/api/internal/handler/apps/getappbyappnamehandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package apps - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/apps" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func GetAppByAppNameHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.AppDetailReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := apps.NewGetAppByAppNameLogic(r.Context(), svcCtx) - resp, err := l.GetAppByAppName(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/apps/pauseappbyappnamehandler.go b/api/internal/handler/apps/pauseappbyappnamehandler.go deleted file mode 100644 index a53de1ab..00000000 --- a/api/internal/handler/apps/pauseappbyappnamehandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package apps - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/apps" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func PauseAppByAppNameHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.DeleteAppReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := apps.NewPauseAppByAppNameLogic(r.Context(), svcCtx) - resp, err := l.PauseAppByAppName(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/apps/restartappbyappnamehandler.go b/api/internal/handler/apps/restartappbyappnamehandler.go deleted file mode 100644 index 94b246af..00000000 --- a/api/internal/handler/apps/restartappbyappnamehandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package apps - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/apps" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func RestartAppByAppNameHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.DeleteAppReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := apps.NewRestartAppByAppNameLogic(r.Context(), svcCtx) - resp, err := l.RestartAppByAppName(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/apps/startappbyappnamehandler.go b/api/internal/handler/apps/startappbyappnamehandler.go deleted file mode 100644 index 02b6a98b..00000000 --- a/api/internal/handler/apps/startappbyappnamehandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package apps - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/apps" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func StartAppByAppNameHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.DeleteAppReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := apps.NewStartAppByAppNameLogic(r.Context(), svcCtx) - resp, err := l.StartAppByAppName(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/apps/updateappbyappnamehandler.go b/api/internal/handler/apps/updateappbyappnamehandler.go deleted file mode 100644 index e72740b8..00000000 --- a/api/internal/handler/apps/updateappbyappnamehandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package apps - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/apps" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func UpdateAppByAppNameHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.DeleteAppReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := apps.NewUpdateAppByAppNameLogic(r.Context(), svcCtx) - resp, err := l.UpdateAppByAppName(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/cloud/cloudlisthandler.go b/api/internal/handler/cloud/cloudlisthandler.go deleted file mode 100644 index 22c759c4..00000000 --- a/api/internal/handler/cloud/cloudlisthandler.go +++ /dev/null @@ -1,21 +0,0 @@ -package cloud - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/cloud" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" -) - -func CloudListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - l := cloud.NewCloudListLogic(r.Context(), svcCtx) - resp, err := l.CloudList() - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/cloud/controllermetricshandler.go b/api/internal/handler/cloud/controllermetricshandler.go deleted file mode 100644 index 2e02cf43..00000000 --- a/api/internal/handler/cloud/controllermetricshandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package cloud - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/cloud" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ControllerMetricsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ControllerMetricsReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := cloud.NewControllerMetricsLogic(r.Context(), svcCtx) - resp, err := l.ControllerMetrics(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/cloud/deleteclusterhandler.go b/api/internal/handler/cloud/deleteclusterhandler.go deleted file mode 100644 index 323c25f3..00000000 --- a/api/internal/handler/cloud/deleteclusterhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package cloud - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/cloud" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func DeleteClusterHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.DeleteClusterReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := cloud.NewDeleteClusterLogic(r.Context(), svcCtx) - resp, err := l.DeleteCluster(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/cloud/deleteyamlhandler.go b/api/internal/handler/cloud/deleteyamlhandler.go deleted file mode 100644 index 60a01556..00000000 --- a/api/internal/handler/cloud/deleteyamlhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package cloud - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/cloud" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func DeleteYamlHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ApplyReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := cloud.NewDeleteYamlLogic(r.Context(), svcCtx) - resp, err := l.DeleteYaml(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/cloud/getclusterlisthandler.go b/api/internal/handler/cloud/getclusterlisthandler.go deleted file mode 100644 index cc04e75d..00000000 --- a/api/internal/handler/cloud/getclusterlisthandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package cloud - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/cloud" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func GetClusterListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.GetClusterListReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := cloud.NewGetClusterListLogic(r.Context(), svcCtx) - resp, err := l.GetClusterList(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/cloud/noticetenanthandler.go b/api/internal/handler/cloud/noticetenanthandler.go deleted file mode 100644 index 9b3fea29..00000000 --- a/api/internal/handler/cloud/noticetenanthandler.go +++ /dev/null @@ -1,21 +0,0 @@ -package cloud - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/cloud" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" -) - -func NoticeTenantHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - l := cloud.NewNoticeTenantLogic(r.Context(), svcCtx) - resp, err := l.NoticeTenant() - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/cloud/registerclusterhandler.go b/api/internal/handler/cloud/registerclusterhandler.go deleted file mode 100644 index f222e5be..00000000 --- a/api/internal/handler/cloud/registerclusterhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package cloud - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/cloud" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func RegisterClusterHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.RegisterClusterReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := cloud.NewRegisterClusterLogic(r.Context(), svcCtx) - resp, err := l.RegisterCluster(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/cloud/updatetenanthandler.go b/api/internal/handler/cloud/updatetenanthandler.go deleted file mode 100644 index 04b04e32..00000000 --- a/api/internal/handler/cloud/updatetenanthandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package cloud - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/cloud" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func UpdateTenantHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.UpdateTenantReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := cloud.NewUpdateTenantLogic(r.Context(), svcCtx) - resp, err := l.UpdateTenant(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/core/centerresourceshandler.go b/api/internal/handler/core/centerresourceshandler.go deleted file mode 100644 index 6c7ae71e..00000000 --- a/api/internal/handler/core/centerresourceshandler.go +++ /dev/null @@ -1,21 +0,0 @@ -package core - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/core" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" -) - -func CenterResourcesHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - l := core.NewCenterResourcesLogic(r.Context(), svcCtx) - resp, err := l.CenterResources() - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/core/committaskhandler.go b/api/internal/handler/core/committaskhandler.go deleted file mode 100644 index 3bea0b93..00000000 --- a/api/internal/handler/core/committaskhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package core - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/core" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func CommitTaskHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.CommitTaskReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := core.NewCommitTaskLogic(r.Context(), svcCtx) - err := l.CommitTask(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.Ok(w) - } - } -} diff --git a/api/internal/handler/core/commitvmtaskhandler.go b/api/internal/handler/core/commitvmtaskhandler.go deleted file mode 100644 index f2ca9e4b..00000000 --- a/api/internal/handler/core/commitvmtaskhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package core - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/core" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func CommitVmTaskHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.CommitVmTaskReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := core.NewCommitVmTaskLogic(r.Context(), svcCtx) - resp, err := l.CommitVmTask(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/core/deletetaskhandler.go b/api/internal/handler/core/deletetaskhandler.go deleted file mode 100644 index e5a735e0..00000000 --- a/api/internal/handler/core/deletetaskhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package core - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/core" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func DeleteTaskHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.DeleteTaskReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := core.NewDeleteTaskLogic(r.Context(), svcCtx) - err := l.DeleteTask(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.Ok(w) - } - } -} diff --git a/api/internal/handler/core/getcomputilitystatisticshandler.go b/api/internal/handler/core/getcomputilitystatisticshandler.go deleted file mode 100644 index 8a03ba36..00000000 --- a/api/internal/handler/core/getcomputilitystatisticshandler.go +++ /dev/null @@ -1,21 +0,0 @@ -package core - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/core" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" -) - -func GetComputilityStatisticsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - l := core.NewGetComputilityStatisticsLogic(r.Context(), svcCtx) - resp, err := l.GetComputilityStatistics() - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/core/getcomputingpowerhandler.go b/api/internal/handler/core/getcomputingpowerhandler.go deleted file mode 100644 index 9e4c77ed..00000000 --- a/api/internal/handler/core/getcomputingpowerhandler.go +++ /dev/null @@ -1,21 +0,0 @@ -package core - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/core" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" -) - -func GetComputingPowerHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - l := core.NewGetComputingPowerLogic(r.Context(), svcCtx) - resp, err := l.GetComputingPower() - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/core/getgeneralinfohandler.go b/api/internal/handler/core/getgeneralinfohandler.go deleted file mode 100644 index de4dc89f..00000000 --- a/api/internal/handler/core/getgeneralinfohandler.go +++ /dev/null @@ -1,21 +0,0 @@ -package core - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/core" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" -) - -func GetGeneralInfoHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - l := core.NewGetGeneralInfoLogic(r.Context(), svcCtx) - resp, err := l.GetGeneralInfo() - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/core/getregionhandler.go b/api/internal/handler/core/getregionhandler.go deleted file mode 100644 index f85e16c7..00000000 --- a/api/internal/handler/core/getregionhandler.go +++ /dev/null @@ -1,21 +0,0 @@ -package core - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/core" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" -) - -func GetRegionHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - l := core.NewGetRegionLogic(r.Context(), svcCtx) - resp, err := l.GetRegion() - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/core/getresourcepanelconfighandler.go b/api/internal/handler/core/getresourcepanelconfighandler.go deleted file mode 100644 index 45dde0c1..00000000 --- a/api/internal/handler/core/getresourcepanelconfighandler.go +++ /dev/null @@ -1,21 +0,0 @@ -package core - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/core" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" -) - -func GetResourcePanelConfigHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - l := core.NewGetResourcePanelConfigLogic(r.Context(), svcCtx) - resp, err := l.GetResourcePanelConfig() - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/core/jobtotalhandler.go b/api/internal/handler/core/jobtotalhandler.go deleted file mode 100644 index 91caa200..00000000 --- a/api/internal/handler/core/jobtotalhandler.go +++ /dev/null @@ -1,21 +0,0 @@ -package core - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/core" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" -) - -func JobTotalHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - l := core.NewJobTotalLogic(r.Context(), svcCtx) - resp, err := l.JobTotal() - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/core/listcenterhandler.go b/api/internal/handler/core/listcenterhandler.go deleted file mode 100644 index cf988c03..00000000 --- a/api/internal/handler/core/listcenterhandler.go +++ /dev/null @@ -1,21 +0,0 @@ -package core - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/core" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" -) - -func ListCenterHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - l := core.NewListCenterLogic(r.Context(), svcCtx) - resp, err := l.ListCenter() - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/core/listclusterhandler.go b/api/internal/handler/core/listclusterhandler.go deleted file mode 100644 index a2077a06..00000000 --- a/api/internal/handler/core/listclusterhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package core - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/core" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ListClusterHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ListClusterReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := core.NewListClusterLogic(r.Context(), svcCtx) - resp, err := l.ListCluster(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/core/listdomainresourcehandler.go b/api/internal/handler/core/listdomainresourcehandler.go deleted file mode 100644 index 911beacf..00000000 --- a/api/internal/handler/core/listdomainresourcehandler.go +++ /dev/null @@ -1,21 +0,0 @@ -package core - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/core" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" -) - -func ListDomainResourceHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - l := core.NewListDomainResourceLogic(r.Context(), svcCtx) - resp, err := l.ListDomainResource() - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/core/listregionhandler.go b/api/internal/handler/core/listregionhandler.go deleted file mode 100644 index c05760a6..00000000 --- a/api/internal/handler/core/listregionhandler.go +++ /dev/null @@ -1,21 +0,0 @@ -package core - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/core" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" -) - -func ListRegionHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - l := core.NewListRegionLogic(r.Context(), svcCtx) - resp, err := l.ListRegion() - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/core/metricshandler.go b/api/internal/handler/core/metricshandler.go deleted file mode 100644 index 5f715b1d..00000000 --- a/api/internal/handler/core/metricshandler.go +++ /dev/null @@ -1,21 +0,0 @@ -package core - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/core" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" -) - -func MetricsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - l := core.NewMetricsLogic(r.Context(), svcCtx) - err := l.Metrics() - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.Ok(w) - } - } -} diff --git a/api/internal/handler/core/nodeassetshandler.go b/api/internal/handler/core/nodeassetshandler.go deleted file mode 100644 index f8bd04a4..00000000 --- a/api/internal/handler/core/nodeassetshandler.go +++ /dev/null @@ -1,21 +0,0 @@ -package core - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/core" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" -) - -func NodeAssetsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - l := core.NewNodeAssetsLogic(r.Context(), svcCtx) - resp, err := l.NodeAssets() - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/core/participantlisthandler.go b/api/internal/handler/core/participantlisthandler.go deleted file mode 100644 index 1f122e0f..00000000 --- a/api/internal/handler/core/participantlisthandler.go +++ /dev/null @@ -1,21 +0,0 @@ -package core - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/core" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" -) - -func ParticipantListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - l := core.NewParticipantListLogic(r.Context(), svcCtx) - resp, err := l.ParticipantList() - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/core/pulltaskinfohandler.go b/api/internal/handler/core/pulltaskinfohandler.go deleted file mode 100644 index 87e8cccc..00000000 --- a/api/internal/handler/core/pulltaskinfohandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package core - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/core" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func PullTaskInfoHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.PullTaskInfoReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := core.NewPullTaskInfoLogic(r.Context(), svcCtx) - resp, err := l.PullTaskInfo(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/core/pushtaskinfohandler.go b/api/internal/handler/core/pushtaskinfohandler.go deleted file mode 100644 index 68c4637d..00000000 --- a/api/internal/handler/core/pushtaskinfohandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package core - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/core" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func PushTaskInfoHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.PushTaskInfoReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := core.NewPushTaskInfoLogic(r.Context(), svcCtx) - resp, err := l.PushTaskInfo(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/core/putresourcepanelconfighandler.go b/api/internal/handler/core/putresourcepanelconfighandler.go deleted file mode 100644 index a425f19a..00000000 --- a/api/internal/handler/core/putresourcepanelconfighandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package core - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/core" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func PutResourcePanelConfigHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ResourcePanelConfigReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := core.NewPutResourcePanelConfigLogic(r.Context(), svcCtx) - err := l.PutResourcePanelConfig(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.Ok(w) - } - } -} diff --git a/api/internal/handler/core/scheduletaskbyyamlhandler.go b/api/internal/handler/core/scheduletaskbyyamlhandler.go deleted file mode 100644 index 1841a389..00000000 --- a/api/internal/handler/core/scheduletaskbyyamlhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package core - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/core" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ScheduleTaskByYamlHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ScheduleTaskByYamlReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := core.NewScheduleTaskByYamlLogic(r.Context(), svcCtx) - err := l.ScheduleTaskByYaml(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.Ok(w) - } - } -} diff --git a/api/internal/handler/core/syncclusterloadhandler.go b/api/internal/handler/core/syncclusterloadhandler.go deleted file mode 100644 index ff36e15b..00000000 --- a/api/internal/handler/core/syncclusterloadhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package core - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/core" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func SyncClusterLoadHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.SyncClusterLoadReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := core.NewSyncClusterLoadLogic(r.Context(), svcCtx) - err := l.SyncClusterLoad(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.Ok(w) - } - } -} diff --git a/api/internal/handler/core/taskdetailhandler.go b/api/internal/handler/core/taskdetailhandler.go deleted file mode 100644 index e97f2706..00000000 --- a/api/internal/handler/core/taskdetailhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package core - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/core" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func TaskDetailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.TaskDetailReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := core.NewTaskDetailLogic(r.Context(), svcCtx) - resp, err := l.TaskDetail(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/core/tasklisthandler.go b/api/internal/handler/core/tasklisthandler.go deleted file mode 100644 index 7b239009..00000000 --- a/api/internal/handler/core/tasklisthandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package core - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/core" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func TaskListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.TaskListReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := core.NewTaskListLogic(r.Context(), svcCtx) - resp, err := l.TaskList(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/dictionary/adddicthandler.go b/api/internal/handler/dictionary/adddicthandler.go deleted file mode 100644 index 9abc0f7a..00000000 --- a/api/internal/handler/dictionary/adddicthandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package dictionary - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/dictionary" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func AddDictHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.DictEditReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := dictionary.NewAddDictLogic(r.Context(), svcCtx) - resp, err := l.AddDict(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/dictionary/adddictitemhandler.go b/api/internal/handler/dictionary/adddictitemhandler.go deleted file mode 100644 index c1ab2c69..00000000 --- a/api/internal/handler/dictionary/adddictitemhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package dictionary - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/dictionary" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func AddDictItemHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.DictItemEditReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := dictionary.NewAddDictItemLogic(r.Context(), svcCtx) - resp, err := l.AddDictItem(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/dictionary/deletedicthandler.go b/api/internal/handler/dictionary/deletedicthandler.go deleted file mode 100644 index 435f529e..00000000 --- a/api/internal/handler/dictionary/deletedicthandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package dictionary - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/dictionary" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func DeleteDictHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.CId - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := dictionary.NewDeleteDictLogic(r.Context(), svcCtx) - resp, err := l.DeleteDict(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/dictionary/deletedictitemhandler.go b/api/internal/handler/dictionary/deletedictitemhandler.go deleted file mode 100644 index e029202f..00000000 --- a/api/internal/handler/dictionary/deletedictitemhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package dictionary - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/dictionary" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func DeleteDictItemHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.CId - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := dictionary.NewDeleteDictItemLogic(r.Context(), svcCtx) - resp, err := l.DeleteDictItem(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/dictionary/editdicthandler.go b/api/internal/handler/dictionary/editdicthandler.go deleted file mode 100644 index b63e41be..00000000 --- a/api/internal/handler/dictionary/editdicthandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package dictionary - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/dictionary" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func EditDictHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.DictEditReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := dictionary.NewEditDictLogic(r.Context(), svcCtx) - resp, err := l.EditDict(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/dictionary/editdictitemhandler.go b/api/internal/handler/dictionary/editdictitemhandler.go deleted file mode 100644 index f4f2fd6c..00000000 --- a/api/internal/handler/dictionary/editdictitemhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package dictionary - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/dictionary" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func EditDictItemHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.DictItemEditReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := dictionary.NewEditDictItemLogic(r.Context(), svcCtx) - resp, err := l.EditDictItem(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/dictionary/getdicthandler.go b/api/internal/handler/dictionary/getdicthandler.go deleted file mode 100644 index 4a958990..00000000 --- a/api/internal/handler/dictionary/getdicthandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package dictionary - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/dictionary" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func GetDictHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.CId - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := dictionary.NewGetDictLogic(r.Context(), svcCtx) - resp, err := l.GetDict(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/dictionary/getdictitemhandler.go b/api/internal/handler/dictionary/getdictitemhandler.go deleted file mode 100644 index 60d8ce06..00000000 --- a/api/internal/handler/dictionary/getdictitemhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package dictionary - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/dictionary" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func GetDictItemHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.CId - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := dictionary.NewGetDictItemLogic(r.Context(), svcCtx) - resp, err := l.GetDictItem(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/dictionary/listdicthandler.go b/api/internal/handler/dictionary/listdicthandler.go deleted file mode 100644 index 5c34a136..00000000 --- a/api/internal/handler/dictionary/listdicthandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package dictionary - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/dictionary" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ListDictHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.DictReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := dictionary.NewListDictLogic(r.Context(), svcCtx) - resp, err := l.ListDict(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/dictionary/listdictitembycodehandler.go b/api/internal/handler/dictionary/listdictitembycodehandler.go deleted file mode 100644 index 98c6feab..00000000 --- a/api/internal/handler/dictionary/listdictitembycodehandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package dictionary - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/dictionary" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ListDictItemByCodeHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.DictCodeReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := dictionary.NewListDictItemByCodeLogic(r.Context(), svcCtx) - resp, err := l.ListDictItemByCode(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/dictionary/listdictitemhandler.go b/api/internal/handler/dictionary/listdictitemhandler.go deleted file mode 100644 index 5607ee04..00000000 --- a/api/internal/handler/dictionary/listdictitemhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package dictionary - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/dictionary" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ListDictItemHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.DictItemReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := dictionary.NewListDictItemLogic(r.Context(), svcCtx) - resp, err := l.ListDictItem(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/hpc/commithpctaskhandler.go b/api/internal/handler/hpc/commithpctaskhandler.go deleted file mode 100644 index a2043def..00000000 --- a/api/internal/handler/hpc/commithpctaskhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package hpc - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/hpc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func CommitHpcTaskHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.CommitHpcTaskReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := hpc.NewCommitHpcTaskLogic(r.Context(), svcCtx) - resp, err := l.CommitHpcTask(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/hpc/listhistoryjobhandler.go b/api/internal/handler/hpc/listhistoryjobhandler.go deleted file mode 100644 index ec50c854..00000000 --- a/api/internal/handler/hpc/listhistoryjobhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package hpc - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/hpc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ListHistoryJobHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ListHistoryJobReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := hpc.NewListHistoryJobLogic(r.Context(), svcCtx) - resp, err := l.ListHistoryJob(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/hpc/listjobhandler.go b/api/internal/handler/hpc/listjobhandler.go deleted file mode 100644 index c9572a7e..00000000 --- a/api/internal/handler/hpc/listjobhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package hpc - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/hpc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ListJobHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ListJobReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := hpc.NewListJobLogic(r.Context(), svcCtx) - resp, err := l.ListJob(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/hpc/queueassetshandler.go b/api/internal/handler/hpc/queueassetshandler.go deleted file mode 100644 index 97c0c5d4..00000000 --- a/api/internal/handler/hpc/queueassetshandler.go +++ /dev/null @@ -1,21 +0,0 @@ -package hpc - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/hpc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" -) - -func QueueAssetsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - l := hpc.NewQueueAssetsLogic(r.Context(), svcCtx) - resp, err := l.QueueAssets() - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/image/chunkhandler.go b/api/internal/handler/image/chunkhandler.go deleted file mode 100644 index 87c8b143..00000000 --- a/api/internal/handler/image/chunkhandler.go +++ /dev/null @@ -1,21 +0,0 @@ -package image - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/image" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" -) - -func ChunkHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - l := image.NewChunkLogic(r.Context(), svcCtx) - err := l.Chunk() - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.Ok(w) - } - } -} diff --git a/api/internal/handler/image/datasetcheckhandler.go b/api/internal/handler/image/datasetcheckhandler.go deleted file mode 100644 index b127987b..00000000 --- a/api/internal/handler/image/datasetcheckhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package image - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/image" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func DataSetCheckHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.CheckReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := image.NewDataSetCheckLogic(r.Context(), svcCtx) - resp, err := l.DataSetCheck(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/image/imagelisthandler.go b/api/internal/handler/image/imagelisthandler.go deleted file mode 100644 index cbd14726..00000000 --- a/api/internal/handler/image/imagelisthandler.go +++ /dev/null @@ -1,21 +0,0 @@ -package image - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/image" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" -) - -func ImageListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - l := image.NewImageListLogic(r.Context(), svcCtx) - resp, err := l.ImageList() - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/image/uploaddatasethandler.go b/api/internal/handler/image/uploaddatasethandler.go deleted file mode 100644 index ffe715c6..00000000 --- a/api/internal/handler/image/uploaddatasethandler.go +++ /dev/null @@ -1,21 +0,0 @@ -package image - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/image" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" -) - -func UploadDataSetHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - l := image.NewUploadDataSetLogic(r.Context(), svcCtx) - err := l.UploadDataSet() - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.Ok(w) - } - } -} diff --git a/api/internal/handler/image/uploadhandler.go b/api/internal/handler/image/uploadhandler.go deleted file mode 100644 index 66cd4592..00000000 --- a/api/internal/handler/image/uploadhandler.go +++ /dev/null @@ -1,21 +0,0 @@ -package image - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/image" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" -) - -func UploadHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - l := image.NewUploadLogic(r.Context(), svcCtx) - err := l.Upload() - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.Ok(w) - } - } -} diff --git a/api/internal/handler/routes.go b/api/internal/handler/routes.go deleted file mode 100644 index 50f31d6c..00000000 --- a/api/internal/handler/routes.go +++ /dev/null @@ -1,1166 +0,0 @@ -// Code generated by goctl. DO NOT EDIT. -package handler - -import ( - "net/http" - - adapters "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/handler/adapters" - ai "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/handler/ai" - apps "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/handler/apps" - cloud "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/handler/cloud" - core "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/handler/core" - dictionary "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/handler/dictionary" - hpc "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/handler/hpc" - image "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/handler/image" - schedule "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/handler/schedule" - storage "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/handler/storage" - storelink "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/handler/storelink" - vm "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/handler/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - - "github.com/zeromicro/go-zero/rest" -) - -func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { - server.AddRoutes( - []rest.Route{ - { - Method: http.MethodGet, - Path: "/core/participantList", - Handler: core.ParticipantListHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/core/scheduleTaskByYaml", - Handler: core.ScheduleTaskByYamlHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/core/commitTask", - Handler: core.CommitTaskHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/core/commitVmTask", - Handler: core.CommitVmTaskHandler(serverCtx), - }, - { - Method: http.MethodDelete, - Path: "/core/deleteTask/:id", - Handler: core.DeleteTaskHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/core/taskList", - Handler: core.TaskListHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/core/taskDetail/:taskId", - Handler: core.TaskDetailHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/core/jobTotal", - Handler: core.JobTotalHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/core/listCenter", - Handler: core.ListCenterHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/core/listCluster/:centerId", - Handler: core.ListClusterHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/core/getRegion", - Handler: core.GetRegionHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/core/listRegion", - Handler: core.ListRegionHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/core/getComputingPower", - Handler: core.GetComputingPowerHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/core/getGeneralInfo", - Handler: core.GetGeneralInfoHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/core/listDomainResource", - Handler: core.ListDomainResourceHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/core/getResourcePanelConfigHandler", - Handler: core.GetResourcePanelConfigHandler(serverCtx), - }, - { - Method: http.MethodPut, - Path: "/core/resourcePanelConfigHandler", - Handler: core.PutResourcePanelConfigHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/core/getComputilityStatistics", - Handler: core.GetComputilityStatisticsHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/core/assets", - Handler: core.NodeAssetsHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/core/centerResources", - Handler: core.CenterResourcesHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/core/syncClusterLoad", - Handler: core.SyncClusterLoadHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/core/metrics", - Handler: core.MetricsHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/core/pullTaskInfo", - Handler: core.PullTaskInfoHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/core/pushTaskInfo", - Handler: core.PushTaskInfoHandler(serverCtx), - }, - }, - rest.WithPrefix("/pcm/v1"), - ) - - server.AddRoutes( - []rest.Route{ - { - Method: http.MethodPost, - Path: "/hpc/commitHpcTask", - Handler: hpc.CommitHpcTaskHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/hpc/listJob", - Handler: hpc.ListJobHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/hpc/listHistoryJob", - Handler: hpc.ListHistoryJobHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/hpc/queueAssets", - Handler: hpc.QueueAssetsHandler(serverCtx), - }, - }, - rest.WithPrefix("/pcm/v1"), - ) - - server.AddRoutes( - []rest.Route{ - { - Method: http.MethodGet, - Path: "/task/list", - Handler: cloud.CloudListHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/cloud/DeleteYaml", - Handler: cloud.DeleteYamlHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/cloud/controller/Metrics", - Handler: cloud.ControllerMetricsHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/cloud/registerCluster", - Handler: cloud.RegisterClusterHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/cloud/deleteCluster", - Handler: cloud.DeleteClusterHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/cloud/noticeTenant", - Handler: cloud.NoticeTenantHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/cloud/updateTenant", - Handler: cloud.UpdateTenantHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/core/clusterList", - Handler: cloud.GetClusterListHandler(serverCtx), - }, - }, - rest.WithPrefix("/pcm/v1"), - ) - - server.AddRoutes( - []rest.Route{ - { - Method: http.MethodGet, - Path: "/ai/listDataSet/:projectId", - Handler: ai.ListDataSetHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/ai/createDataSet/:projectId", - Handler: ai.CreateDataSetHandler(serverCtx), - }, - { - Method: http.MethodDelete, - Path: "/ai/deleteDataSet/:projectId/:datasetId", - Handler: ai.DeleteDataSetHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/ai/CreateTask/:projectId/:datasetId", - Handler: ai.CreateTaskHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/ai/ListImport/:projectId/:datasetId", - Handler: ai.ListImportHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/ai/GetListTrainingJobs/:projectId", - Handler: ai.GetListTrainingJobsHandler(serverCtx), - }, - { - Method: http.MethodDelete, - Path: "/ai/DeleteTrainingJob/:projectId/:trainingJobId", - Handler: ai.DeleteTrainingJobHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/ai/CreateAlgorithm/:projectId", - Handler: ai.CreateAlgorithmHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/ai/ListAlgorithms/:projectId", - Handler: ai.ListAlgorithmsHandler(serverCtx), - }, - { - Method: http.MethodDelete, - Path: "/ai/DeleteAlgorithm/:projectId/:algorithmId", - Handler: ai.DeleteAlgorithmHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/ai/CreateTrainingJob/:projectId", - Handler: ai.CreateTrainingJobHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/ai/ShowAlgorithmByUuid/:projectId/:algorithmId", - Handler: ai.ShowAlgorithmByUuidHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/ai/CreateExportTask/:projectId/:datasetId", - Handler: ai.CreateExportTaskHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/ai/GetExportTasksOfDataset/:projectId/:datasetId", - Handler: ai.GetExportTasksOfDatasetHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/ai/GetExportTaskStatusOfDataset/:projectId/:resourceId/:taskId", - Handler: ai.GetExportTaskStatusOfDatasetHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/ai/CreateProcessorTask", - Handler: ai.CreateProcessorTaskHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/ai/CreateService/:projectId", - Handler: ai.CreateServiceHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/ai/ListServices/:projectId", - Handler: ai.ListServicesHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/ai/ShowService/:projectId/:serviceId", - Handler: ai.ShowServiceHandler(serverCtx), - }, - { - Method: http.MethodDelete, - Path: "/ai/DeleteService/:projectId/:serviceId", - Handler: ai.DeleteServiceHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/ai/ListClusters", - Handler: ai.ListClustersHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/ai/listNotebook", - Handler: ai.ListNotebookHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/ai/createNotebook", - Handler: ai.CreateNotebookHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/ai/startNotebook", - Handler: ai.StartNotebookHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/ai/stopNotebook", - Handler: ai.StopNotebookHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/ai/getNotebookStorage", - Handler: ai.GetNotebookStorageHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/ai/mountNotebookStorage", - Handler: ai.MountNotebookStorageHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/ai/getVisualizationJob", - Handler: ai.GetVisualizationJobHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/ai/CreateVisualizationJob", - Handler: ai.CreateVisualizationJobHandler(serverCtx), - }, - }, - rest.WithPrefix("/pcm/v1"), - ) - - server.AddRoutes( - []rest.Route{ - { - Method: http.MethodGet, - Path: "/storage/screenStorage", - Handler: storage.ScreenStorageHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/storage/dailyPowerScreen", - Handler: storage.DailyPowerScreenHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/storage/perCenterComputerPowers", - Handler: storage.PerCenterComputerPowersHandler(serverCtx), - }, - }, - rest.WithPrefix("/pcm/v1"), - ) - - server.AddRoutes( - []rest.Route{ - { - Method: http.MethodPost, - Path: "/upload", - Handler: image.UploadHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/chunk", - Handler: image.ChunkHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/image/list", - Handler: image.ImageListHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/dataSet/check/:fileMd5", - Handler: image.DataSetCheckHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/dataSet/upload", - Handler: image.UploadDataSetHandler(serverCtx), - }, - }, - rest.WithPrefix("/pcm/v1"), - ) - - server.AddRoutes( - []rest.Route{ - { - Method: http.MethodGet, - Path: "/vm/getComputeLimits", - Handler: vm.GetComputeLimitsHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/vm/getVolumeLimits", - Handler: vm.GetVolumeLimitsHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/vm/getNetworkNum", - Handler: vm.GetNetworkNumHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/vm/getImageNum", - Handler: vm.GetImageNumHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/vm/listServer", - Handler: vm.ListServerHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/vm/listServersDetailed", - Handler: vm.ListServersDetailedHandler(serverCtx), - }, - { - Method: http.MethodDelete, - Path: "/vm/deleteServer", - Handler: vm.DeleteServerHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/vm/createServer", - Handler: vm.CreateServerHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/vm/getServersDetailedById", - Handler: vm.GetServersDetailedByIdHandler(serverCtx), - }, - { - Method: http.MethodPut, - Path: "/vm/updateServer", - Handler: vm.UpdateServerHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/vm/startServer", - Handler: vm.StartServerHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/vm/stopServer", - Handler: vm.StopServerHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/vm/rebootServer", - Handler: vm.RebootServerHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/vm/pauseServer", - Handler: vm.PauseServerHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/vm/unpauseServer", - Handler: vm.UnpauseServerHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/vm/resizeServer", - Handler: vm.ResizeServerHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/vm/migrateServer", - Handler: vm.MigrateServerHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/vm/shelveServer", - Handler: vm.ShelveServerHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/vm/changeAdministrativePassword", - Handler: vm.ChangeAdministrativePasswordHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/vm/rescueServer", - Handler: vm.RescueServerHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/vm/unRescueServer", - Handler: vm.UnRescueHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/vm/suspendServer", - Handler: vm.SuspendServerHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/vm/addSecurityGroupToServer", - Handler: vm.AddSecurityGroupToServerHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/vm/removeSecurityGroup", - Handler: vm.RemoveSecurityGroupHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/vm/createFlavor", - Handler: vm.CreateFlavorHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/vm/deleteFlavor", - Handler: vm.DeleteFlavorHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/vm/listImages", - Handler: vm.ListImagesHandler(serverCtx), - }, - { - Method: http.MethodDelete, - Path: "/vm/deleteImage", - Handler: vm.DeleteImageHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/vm/createImage", - Handler: vm.CreateImageHandler(serverCtx), - }, - { - Method: http.MethodPut, - Path: "/vm/uploadImage", - Handler: vm.UploadImageHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/vm/listNetworks", - Handler: vm.ListNetworksHandler(serverCtx), - }, - { - Method: http.MethodDelete, - Path: "/vm/deleteNetwork", - Handler: vm.DeleteNetworkHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/vm/createNetwork", - Handler: vm.CreateNetworkHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/vm/createSubnet", - Handler: vm.CreateSubnetHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/vm/showNetworkDetails", - Handler: vm.ShowNetworkDetailsHandler(serverCtx), - }, - { - Method: http.MethodPut, - Path: "/vm/updateNetwork", - Handler: vm.UpdateNetworkHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/vm/bulkCreateNetworks", - Handler: vm.BulkCreateNetworksHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/vm/listSubnets", - Handler: vm.ListSubnetsHandler(serverCtx), - }, - { - Method: http.MethodDelete, - Path: "/vm/deleteSubnet", - Handler: vm.DeleteSubnetHandler(serverCtx), - }, - { - Method: http.MethodPut, - Path: "/vm/updateSubnet", - Handler: vm.UpdateSubnetHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/vm/listNetworkSegmentRanges", - Handler: vm.ListNetworkSegmentRangesRangeHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/vm/createNetworkSegmentRange", - Handler: vm.CreateNetworkSegmentRangeHandler(serverCtx), - }, - { - Method: http.MethodDelete, - Path: "/vm/deleteNetworkSegmentRanges", - Handler: vm.DeleteNetworkSegmentRangesHandler(serverCtx), - }, - { - Method: http.MethodPut, - Path: "/vm/updateNetworkSegmentRanges", - Handler: vm.UpdateNetworkSegmentRangesHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/vm/showNetworkSegmentRangeDetails", - Handler: vm.ShowNetworkSegmentRangeDetailsHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/vm/createPort", - Handler: vm.CreatePortHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/vm/listPortsReq", - Handler: vm.ListPortsHandler(serverCtx), - }, - { - Method: http.MethodDelete, - Path: "/vm/deletePort", - Handler: vm.DeletePortHandler(serverCtx), - }, - { - Method: http.MethodPut, - Path: "/vm/updatePort", - Handler: vm.UpdatePortHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/vm/showPortDetails", - Handler: vm.ShowPortDetailsHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/vm/createRouter", - Handler: vm.CreateRouterHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/vm/listRouters", - Handler: vm.ListRoutersHandler(serverCtx), - }, - { - Method: http.MethodDelete, - Path: "/vm/deleteRouter", - Handler: vm.DeleteRouterHandler(serverCtx), - }, - { - Method: http.MethodPut, - Path: "/vm/updateRouter", - Handler: vm.UpdateRouterHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/vm/showRouterDetails", - Handler: vm.ShowRouterDetailsHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/vm/createFloatingIP", - Handler: vm.CreateFloatingIPHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/vm/listFloatingIPs", - Handler: vm.ListFloatingIPsHandler(serverCtx), - }, - { - Method: http.MethodDelete, - Path: "/vm/deleteFloatingIP", - Handler: vm.DeleteFloatingIPHandler(serverCtx), - }, - { - Method: http.MethodPut, - Path: "/vm/updateFloatingIP", - Handler: vm.UpdateFloatingIPHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/vm/showFloatingIPDetails", - Handler: vm.ShowFloatingIPDetailsHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/vm/createFirewallGroup", - Handler: vm.CreateFirewallGroupHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/vm/listFirewallGroups", - Handler: vm.ListFirewallGroupsHandler(serverCtx), - }, - { - Method: http.MethodDelete, - Path: "/vm/deleteFirewallGroup", - Handler: vm.DeleteFirewallGroupHandler(serverCtx), - }, - { - Method: http.MethodPut, - Path: "/vm/updateFirewallGroup", - Handler: vm.UpdateFirewallGroupHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/vm/showFirewallGroupDetails", - Handler: vm.ShowFirewallGroupDetailsHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/vm/createFirewallPolicy", - Handler: vm.CreateFirewallPolicyHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/vm/listFirewallPolicies", - Handler: vm.ListFirewallPoliciesHandler(serverCtx), - }, - { - Method: http.MethodDelete, - Path: "/vm/deleteFirewallPolicy", - Handler: vm.DeleteFirewallPolicyHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/vm/showFirewallRuleDetails", - Handler: vm.ShowFirewallRuleDetailsHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/vm/showFirewallPolicyDetails", - Handler: vm.ShowFirewallPolicyDetailsHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/vm/createFirewallRule", - Handler: vm.CreateFirewallRuleHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/vm/listFirewallRules", - Handler: vm.ListFirewallRulesHandler(serverCtx), - }, - { - Method: http.MethodDelete, - Path: "/vm/deleteFirewallRule", - Handler: vm.DeleteFirewallRuleHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/vm/createSecurityGroup", - Handler: vm.CreateSecurityGroupHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/vm/listSecurityGroups", - Handler: vm.ListSecurityGroupsHandler(serverCtx), - }, - { - Method: http.MethodDelete, - Path: "/vm/deleteSecurityGroup", - Handler: vm.DeleteSecurityGroupHandler(serverCtx), - }, - { - Method: http.MethodPut, - Path: "/vm/updateSecurityGroup", - Handler: vm.UpdateSecurityGroupHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/vm/showSecurityGroup", - Handler: vm.ShowSecurityGroupHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/vm/createSecurityGroupRule", - Handler: vm.CreateSecurityGroupRuleHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/vm/listSecurityGroupRules", - Handler: vm.ListSecurityGroupRulesHandler(serverCtx), - }, - { - Method: http.MethodDelete, - Path: "/vm/deleteSecurityGroupRule", - Handler: vm.DeleteSecurityGroupRuleHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/vm/showSecurityGroupRule", - Handler: vm.ShowSecurityGroupRuleHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/vm/listVolumesDetail", - Handler: vm.ListVolumesDetailHandler(serverCtx), - }, - { - Method: http.MethodDelete, - Path: "/vm/deleteVolume", - Handler: vm.DeleteVolumeHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/vm/createVolume", - Handler: vm.CreateVolumeHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/vm/listFlavorsDetail", - Handler: vm.ListFlavorsDetailHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/vm/listVolumeTypes", - Handler: vm.ListVolumeTypesHandler(serverCtx), - }, - { - Method: http.MethodPut, - Path: "/vm/updateVolume", - Handler: vm.UpdateVolumeHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/vm/createVolumeTypes", - Handler: vm.CreateVolumeTypesHandler(serverCtx), - }, - { - Method: http.MethodDelete, - Path: "/vm/deleteVolumeType", - Handler: vm.DeleteVolumeTypeHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/vm/listVolumes", - Handler: vm.ListVolumesHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/vm/getVolumeDetailedById", - Handler: vm.GetVolumeDetailedByIdHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/vm/listNodes", - Handler: vm.ListNodesHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/vm/createNode", - Handler: vm.CreateNodeHandler(serverCtx), - }, - { - Method: http.MethodDelete, - Path: "/vm/deleteNode", - Handler: vm.DeleteNodeHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/vm/showNodeDetails", - Handler: vm.ShowNodeDetailsHandler(serverCtx), - }, - }, - rest.WithPrefix("/pcm/v1"), - ) - - server.AddRoutes( - []rest.Route{ - { - Method: http.MethodPost, - Path: "/storelink/uploadImage", - Handler: storelink.UploadLinkImageHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/storelink/getImageList", - Handler: storelink.GetLinkImageListHandler(serverCtx), - }, - { - Method: http.MethodDelete, - Path: "/storelink/deleteImage", - Handler: storelink.DeleteLinkImageHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/storelink/submitTask", - Handler: storelink.SubmitLinkTaskHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/storelink/getTask", - Handler: storelink.GetLinkTaskHandler(serverCtx), - }, - { - Method: http.MethodDelete, - Path: "/storelink/deleteTask", - Handler: storelink.DeleteLinkTaskHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/storelink/getParticipants", - Handler: storelink.GetParticipantsHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/storelink/getResourceSpecs", - Handler: storelink.GetAISpecsHandler(serverCtx), - }, - }, - rest.WithPrefix("/pcm/v1"), - ) - - server.AddRoutes( - []rest.Route{ - { - Method: http.MethodGet, - Path: "/apps/list", - Handler: apps.AppListHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/apps/distribute/:appName", - Handler: apps.AppDetailHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/apps/pods/:appName", - Handler: apps.AppPodsHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/apps/getAppByAppName/:appName", - Handler: apps.GetAppByAppNameHandler(serverCtx), - }, - { - Method: http.MethodDelete, - Path: "/apps/deleteApp", - Handler: apps.DeleteAppByAppNameHandler(serverCtx), - }, - { - Method: http.MethodPut, - Path: "/apps/updateApp", - Handler: apps.UpdateAppByAppNameHandler(serverCtx), - }, - { - Method: http.MethodPut, - Path: "/apps/restartApp", - Handler: apps.RestartAppByAppNameHandler(serverCtx), - }, - { - Method: http.MethodPut, - Path: "/apps/pauseApp", - Handler: apps.PauseAppByAppNameHandler(serverCtx), - }, - { - Method: http.MethodPut, - Path: "/apps/startApp", - Handler: apps.StartAppByAppNameHandler(serverCtx), - }, - }, - rest.WithPrefix("/pcm/v1"), - ) - - server.AddRoutes( - []rest.Route{ - { - Method: http.MethodGet, - Path: "/adapter/list", - Handler: adapters.AdaptersListHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/adapter/create", - Handler: adapters.CreateAdapterHandler(serverCtx), - }, - { - Method: http.MethodPut, - Path: "/adapter/update", - Handler: adapters.UpdateAdapterHandler(serverCtx), - }, - { - Method: http.MethodDelete, - Path: "/adapter/delete", - Handler: adapters.DeleteAdapterHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/adapter/get", - Handler: adapters.GetAdapterHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/adapter/cluster/list", - Handler: adapters.ClusterListHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/adapter/cluster/create", - Handler: adapters.CreateClusterHandler(serverCtx), - }, - { - Method: http.MethodPut, - Path: "/adapter/cluster/update", - Handler: adapters.UpdateClusterHandler(serverCtx), - }, - { - Method: http.MethodDelete, - Path: "/adapter/cluster/delete", - Handler: adapters.DeleteClusterHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/adapter/cluster/get", - Handler: adapters.GetClusterHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/adapter/relation", - Handler: adapters.GetAdapterRelationHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/adapter/clusterSum", - Handler: adapters.GetClusterSumHandler(serverCtx), - }, - }, - rest.WithPrefix("/pcm/v1"), - ) - - server.AddRoutes( - []rest.Route{ - { - Method: http.MethodGet, - Path: "/schedule/ai/getResourceTypes", - Handler: schedule.ScheduleGetAiResourceTypesHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/schedule/ai/getTaskTypes", - Handler: schedule.ScheduleGetAiTaskTypesHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/schedule/ai/getDatasets", - Handler: schedule.ScheduleGetDatasetsHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/schedule/ai/getStrategies", - Handler: schedule.ScheduleGetStrategyHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/schedule/submit", - Handler: schedule.ScheduleSubmitHandler(serverCtx), - }, - }, - rest.WithPrefix("/pcm/v1"), - ) - - server.AddRoutes( - []rest.Route{ - { - Method: http.MethodGet, - Path: "/dict/:id", - Handler: dictionary.GetDictHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/dicts", - Handler: dictionary.ListDictHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/dict", - Handler: dictionary.AddDictHandler(serverCtx), - }, - { - Method: http.MethodPut, - Path: "/dict", - Handler: dictionary.EditDictHandler(serverCtx), - }, - { - Method: http.MethodDelete, - Path: "/dict/:id", - Handler: dictionary.DeleteDictHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/dictItem/:id", - Handler: dictionary.GetDictItemHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/dictItems", - Handler: dictionary.ListDictItemHandler(serverCtx), - }, - { - Method: http.MethodPost, - Path: "/dictItem", - Handler: dictionary.AddDictItemHandler(serverCtx), - }, - { - Method: http.MethodPut, - Path: "/dictItem", - Handler: dictionary.EditDictItemHandler(serverCtx), - }, - { - Method: http.MethodDelete, - Path: "/dictItem/:id", - Handler: dictionary.DeleteDictItemHandler(serverCtx), - }, - { - Method: http.MethodGet, - Path: "/dictItem/code/:dictCode", - Handler: dictionary.ListDictItemByCodeHandler(serverCtx), - }, - }, - rest.WithPrefix("/pcm/v1"), - ) -} diff --git a/api/internal/handler/schedule/schedulegetairesourcetypeshandler.go b/api/internal/handler/schedule/schedulegetairesourcetypeshandler.go deleted file mode 100644 index 430786f2..00000000 --- a/api/internal/handler/schedule/schedulegetairesourcetypeshandler.go +++ /dev/null @@ -1,21 +0,0 @@ -package schedule - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/schedule" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" -) - -func ScheduleGetAiResourceTypesHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - l := schedule.NewScheduleGetAiResourceTypesLogic(r.Context(), svcCtx) - resp, err := l.ScheduleGetAiResourceTypes() - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/schedule/schedulegetaitasktypeshandler.go b/api/internal/handler/schedule/schedulegetaitasktypeshandler.go deleted file mode 100644 index 5be11070..00000000 --- a/api/internal/handler/schedule/schedulegetaitasktypeshandler.go +++ /dev/null @@ -1,21 +0,0 @@ -package schedule - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/schedule" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" -) - -func ScheduleGetAiTaskTypesHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - l := schedule.NewScheduleGetAiTaskTypesLogic(r.Context(), svcCtx) - resp, err := l.ScheduleGetAiTaskTypes() - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/schedule/schedulegetdatasetshandler.go b/api/internal/handler/schedule/schedulegetdatasetshandler.go deleted file mode 100644 index da285546..00000000 --- a/api/internal/handler/schedule/schedulegetdatasetshandler.go +++ /dev/null @@ -1,21 +0,0 @@ -package schedule - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/schedule" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" -) - -func ScheduleGetDatasetsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - l := schedule.NewScheduleGetDatasetsLogic(r.Context(), svcCtx) - resp, err := l.ScheduleGetDatasets() - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/schedule/schedulegetstrategyhandler.go b/api/internal/handler/schedule/schedulegetstrategyhandler.go deleted file mode 100644 index 2ee88fba..00000000 --- a/api/internal/handler/schedule/schedulegetstrategyhandler.go +++ /dev/null @@ -1,21 +0,0 @@ -package schedule - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/schedule" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" -) - -func ScheduleGetStrategyHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - l := schedule.NewScheduleGetStrategyLogic(r.Context(), svcCtx) - resp, err := l.ScheduleGetStrategy() - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/schedule/schedulesubmithandler.go b/api/internal/handler/schedule/schedulesubmithandler.go deleted file mode 100644 index a536f649..00000000 --- a/api/internal/handler/schedule/schedulesubmithandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package schedule - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/schedule" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ScheduleSubmitHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ScheduleReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := schedule.NewScheduleSubmitLogic(r.Context(), svcCtx) - resp, err := l.ScheduleSubmit(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/storage/dailypowerscreenhandler.go b/api/internal/handler/storage/dailypowerscreenhandler.go deleted file mode 100644 index 48844f39..00000000 --- a/api/internal/handler/storage/dailypowerscreenhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package storage - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/storage" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func DailyPowerScreenHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.DailyPowerScreenReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := storage.NewDailyPowerScreenLogic(r.Context(), svcCtx) - resp, err := l.DailyPowerScreen(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/storage/percentercomputerpowershandler.go b/api/internal/handler/storage/percentercomputerpowershandler.go deleted file mode 100644 index 2e1b5f78..00000000 --- a/api/internal/handler/storage/percentercomputerpowershandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package storage - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/storage" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func PerCenterComputerPowersHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.PerCenterComputerPowersReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := storage.NewPerCenterComputerPowersLogic(r.Context(), svcCtx) - resp, err := l.PerCenterComputerPowers(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/storage/screenstoragehandler.go b/api/internal/handler/storage/screenstoragehandler.go deleted file mode 100644 index 8a8a2bec..00000000 --- a/api/internal/handler/storage/screenstoragehandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package storage - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/storage" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ScreenStorageHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.StorageScreenReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := storage.NewScreenStorageLogic(r.Context(), svcCtx) - resp, err := l.ScreenStorage(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/storelink/deletelinkimagehandler.go b/api/internal/handler/storelink/deletelinkimagehandler.go deleted file mode 100644 index fc56fe9d..00000000 --- a/api/internal/handler/storelink/deletelinkimagehandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package storelink - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/storelink" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func DeleteLinkImageHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.DeleteLinkImageReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := storelink.NewDeleteLinkImageLogic(r.Context(), svcCtx) - resp, err := l.DeleteLinkImage(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/storelink/deletelinktaskhandler.go b/api/internal/handler/storelink/deletelinktaskhandler.go deleted file mode 100644 index 536b3ae9..00000000 --- a/api/internal/handler/storelink/deletelinktaskhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package storelink - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/storelink" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func DeleteLinkTaskHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.DeleteLinkTaskReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := storelink.NewDeleteLinkTaskLogic(r.Context(), svcCtx) - resp, err := l.DeleteLinkTask(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/storelink/getaispecshandler.go b/api/internal/handler/storelink/getaispecshandler.go deleted file mode 100644 index 8e97d294..00000000 --- a/api/internal/handler/storelink/getaispecshandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package storelink - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/storelink" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func GetAISpecsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.GetResourceSpecsReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := storelink.NewGetAISpecsLogic(r.Context(), svcCtx) - resp, err := l.GetAISpecs(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/storelink/getlinkimagelisthandler.go b/api/internal/handler/storelink/getlinkimagelisthandler.go deleted file mode 100644 index b83198f6..00000000 --- a/api/internal/handler/storelink/getlinkimagelisthandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package storelink - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/storelink" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func GetLinkImageListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.GetLinkImageListReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := storelink.NewGetLinkImageListLogic(r.Context(), svcCtx) - resp, err := l.GetLinkImageList(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/storelink/getlinktaskhandler.go b/api/internal/handler/storelink/getlinktaskhandler.go deleted file mode 100644 index af477e23..00000000 --- a/api/internal/handler/storelink/getlinktaskhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package storelink - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/storelink" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func GetLinkTaskHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.GetLinkTaskReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := storelink.NewGetLinkTaskLogic(r.Context(), svcCtx) - resp, err := l.GetLinkTask(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/storelink/getparticipantshandler.go b/api/internal/handler/storelink/getparticipantshandler.go deleted file mode 100644 index 07c88f83..00000000 --- a/api/internal/handler/storelink/getparticipantshandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package storelink - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/storelink" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func GetParticipantsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.GetParticipantsReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := storelink.NewGetParticipantsLogic(r.Context(), svcCtx) - resp, err := l.GetParticipants(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/storelink/submitlinktaskhandler.go b/api/internal/handler/storelink/submitlinktaskhandler.go deleted file mode 100644 index 5da13f4b..00000000 --- a/api/internal/handler/storelink/submitlinktaskhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package storelink - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/storelink" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func SubmitLinkTaskHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.SubmitLinkTaskReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := storelink.NewSubmitLinkTaskLogic(r.Context(), svcCtx) - resp, err := l.SubmitLinkTask(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/storelink/uploadlinkimagehandler.go b/api/internal/handler/storelink/uploadlinkimagehandler.go deleted file mode 100644 index 9adec263..00000000 --- a/api/internal/handler/storelink/uploadlinkimagehandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package storelink - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/storelink" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func UploadLinkImageHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.UploadLinkImageReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := storelink.NewUploadLinkImageLogic(r.Context(), svcCtx) - resp, err := l.UploadLinkImage(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/addsecuritygrouptoserverhandler.go b/api/internal/handler/vm/addsecuritygrouptoserverhandler.go deleted file mode 100644 index 86553cbf..00000000 --- a/api/internal/handler/vm/addsecuritygrouptoserverhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func AddSecurityGroupToServerHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.AddSecurityGroupToServerReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewAddSecurityGroupToServerLogic(r.Context(), svcCtx) - resp, err := l.AddSecurityGroupToServer(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/bulkcreatenetworkshandler.go b/api/internal/handler/vm/bulkcreatenetworkshandler.go deleted file mode 100644 index 84cad5c6..00000000 --- a/api/internal/handler/vm/bulkcreatenetworkshandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func BulkCreateNetworksHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.BulkCreateNetworksReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewBulkCreateNetworksLogic(r.Context(), svcCtx) - resp, err := l.BulkCreateNetworks(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/changeadministrativepasswordhandler.go b/api/internal/handler/vm/changeadministrativepasswordhandler.go deleted file mode 100644 index ecf1c6bc..00000000 --- a/api/internal/handler/vm/changeadministrativepasswordhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ChangeAdministrativePasswordHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ChangeAdministrativePasswordReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewChangeAdministrativePasswordLogic(r.Context(), svcCtx) - resp, err := l.ChangeAdministrativePassword(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/createfirewallgrouphandler.go b/api/internal/handler/vm/createfirewallgrouphandler.go deleted file mode 100644 index f6f5b3a1..00000000 --- a/api/internal/handler/vm/createfirewallgrouphandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func CreateFirewallGroupHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.CreateFirewallGroupReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewCreateFirewallGroupLogic(r.Context(), svcCtx) - resp, err := l.CreateFirewallGroup(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/createfirewallpolicyhandler.go b/api/internal/handler/vm/createfirewallpolicyhandler.go deleted file mode 100644 index 77d8d1cf..00000000 --- a/api/internal/handler/vm/createfirewallpolicyhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func CreateFirewallPolicyHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.CreateFirewallPolicyReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewCreateFirewallPolicyLogic(r.Context(), svcCtx) - resp, err := l.CreateFirewallPolicy(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/createfirewallrulehandler.go b/api/internal/handler/vm/createfirewallrulehandler.go deleted file mode 100644 index 3995c08a..00000000 --- a/api/internal/handler/vm/createfirewallrulehandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func CreateFirewallRuleHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.CreateFirewallRuleReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewCreateFirewallRuleLogic(r.Context(), svcCtx) - resp, err := l.CreateFirewallRule(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/createflavorhandler.go b/api/internal/handler/vm/createflavorhandler.go deleted file mode 100644 index f32dc8f2..00000000 --- a/api/internal/handler/vm/createflavorhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func CreateFlavorHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.CreateFlavorReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewCreateFlavorLogic(r.Context(), svcCtx) - resp, err := l.CreateFlavor(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/createfloatingiphandler.go b/api/internal/handler/vm/createfloatingiphandler.go deleted file mode 100644 index 797a4a55..00000000 --- a/api/internal/handler/vm/createfloatingiphandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func CreateFloatingIPHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.CreateFloatingIPReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewCreateFloatingIPLogic(r.Context(), svcCtx) - resp, err := l.CreateFloatingIP(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/createimagehandler.go b/api/internal/handler/vm/createimagehandler.go deleted file mode 100644 index 5f5e4f81..00000000 --- a/api/internal/handler/vm/createimagehandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func CreateImageHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.CreateImageReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewCreateImageLogic(r.Context(), svcCtx) - resp, err := l.CreateImage(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/createnetworkhandler.go b/api/internal/handler/vm/createnetworkhandler.go deleted file mode 100644 index 2da207be..00000000 --- a/api/internal/handler/vm/createnetworkhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func CreateNetworkHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.CreateNetworkReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewCreateNetworkLogic(r.Context(), svcCtx) - resp, err := l.CreateNetwork(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/createnetworksegmentrangehandler.go b/api/internal/handler/vm/createnetworksegmentrangehandler.go deleted file mode 100644 index 47f7e5fa..00000000 --- a/api/internal/handler/vm/createnetworksegmentrangehandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func CreateNetworkSegmentRangeHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.CreateNetworkSegmentRangeReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewCreateNetworkSegmentRangeLogic(r.Context(), svcCtx) - resp, err := l.CreateNetworkSegmentRange(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/createnodehandler.go b/api/internal/handler/vm/createnodehandler.go deleted file mode 100644 index 5df9dd56..00000000 --- a/api/internal/handler/vm/createnodehandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func CreateNodeHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.CreateNodeReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewCreateNodeLogic(r.Context(), svcCtx) - resp, err := l.CreateNode(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/createporthandler.go b/api/internal/handler/vm/createporthandler.go deleted file mode 100644 index 0ea408b7..00000000 --- a/api/internal/handler/vm/createporthandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func CreatePortHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.CreatePortReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewCreatePortLogic(r.Context(), svcCtx) - resp, err := l.CreatePort(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/createrouterhandler.go b/api/internal/handler/vm/createrouterhandler.go deleted file mode 100644 index 45390b39..00000000 --- a/api/internal/handler/vm/createrouterhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func CreateRouterHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.CreateRouterReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewCreateRouterLogic(r.Context(), svcCtx) - resp, err := l.CreateRouter(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/createsecuritygrouphandler.go b/api/internal/handler/vm/createsecuritygrouphandler.go deleted file mode 100644 index 2fcfd935..00000000 --- a/api/internal/handler/vm/createsecuritygrouphandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func CreateSecurityGroupHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.CreateSecurityGroupReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewCreateSecurityGroupLogic(r.Context(), svcCtx) - resp, err := l.CreateSecurityGroup(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/createsecuritygrouprulehandler.go b/api/internal/handler/vm/createsecuritygrouprulehandler.go deleted file mode 100644 index 11ffe7ea..00000000 --- a/api/internal/handler/vm/createsecuritygrouprulehandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func CreateSecurityGroupRuleHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.CreateSecurityGroupRuleReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewCreateSecurityGroupRuleLogic(r.Context(), svcCtx) - resp, err := l.CreateSecurityGroupRule(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/createserverhandler.go b/api/internal/handler/vm/createserverhandler.go deleted file mode 100644 index 1afd92f1..00000000 --- a/api/internal/handler/vm/createserverhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func CreateServerHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.CreateServerReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewCreateServerLogic(r.Context(), svcCtx) - resp, err := l.CreateServer(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/createsubnethandler.go b/api/internal/handler/vm/createsubnethandler.go deleted file mode 100644 index 931121f3..00000000 --- a/api/internal/handler/vm/createsubnethandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func CreateSubnetHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.CreateSubnetReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewCreateSubnetLogic(r.Context(), svcCtx) - resp, err := l.CreateSubnet(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/createvolumehandler.go b/api/internal/handler/vm/createvolumehandler.go deleted file mode 100644 index 4e6c56b3..00000000 --- a/api/internal/handler/vm/createvolumehandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func CreateVolumeHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.CreateVolumeReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewCreateVolumeLogic(r.Context(), svcCtx) - resp, err := l.CreateVolume(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/createvolumetypeshandler.go b/api/internal/handler/vm/createvolumetypeshandler.go deleted file mode 100644 index 955b889f..00000000 --- a/api/internal/handler/vm/createvolumetypeshandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func CreateVolumeTypesHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.CreateVolumeTypeReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewCreateVolumeTypesLogic(r.Context(), svcCtx) - resp, err := l.CreateVolumeTypes(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/deletefirewallgrouphandler.go b/api/internal/handler/vm/deletefirewallgrouphandler.go deleted file mode 100644 index 240f1ceb..00000000 --- a/api/internal/handler/vm/deletefirewallgrouphandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func DeleteFirewallGroupHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.DeleteFirewallGroupReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewDeleteFirewallGroupLogic(r.Context(), svcCtx) - resp, err := l.DeleteFirewallGroup(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/deletefirewallpolicyhandler.go b/api/internal/handler/vm/deletefirewallpolicyhandler.go deleted file mode 100644 index ee0f12fa..00000000 --- a/api/internal/handler/vm/deletefirewallpolicyhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func DeleteFirewallPolicyHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.DeleteFirewallPolicyReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewDeleteFirewallPolicyLogic(r.Context(), svcCtx) - resp, err := l.DeleteFirewallPolicy(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/deletefirewallrulehandler.go b/api/internal/handler/vm/deletefirewallrulehandler.go deleted file mode 100644 index 44c60272..00000000 --- a/api/internal/handler/vm/deletefirewallrulehandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func DeleteFirewallRuleHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.DeleteFirewallRuleReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewDeleteFirewallRuleLogic(r.Context(), svcCtx) - resp, err := l.DeleteFirewallRule(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/deleteflavorhandler.go b/api/internal/handler/vm/deleteflavorhandler.go deleted file mode 100644 index 7bf5fe04..00000000 --- a/api/internal/handler/vm/deleteflavorhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func DeleteFlavorHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.DeleteFlavorReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewDeleteFlavorLogic(r.Context(), svcCtx) - resp, err := l.DeleteFlavor(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/deletefloatingiphandler.go b/api/internal/handler/vm/deletefloatingiphandler.go deleted file mode 100644 index 3f7abdf3..00000000 --- a/api/internal/handler/vm/deletefloatingiphandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func DeleteFloatingIPHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.DeleteFloatingIPReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewDeleteFloatingIPLogic(r.Context(), svcCtx) - resp, err := l.DeleteFloatingIP(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/deleteimagehandler.go b/api/internal/handler/vm/deleteimagehandler.go deleted file mode 100644 index 6ba84ce0..00000000 --- a/api/internal/handler/vm/deleteimagehandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func DeleteImageHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.DeleteImageReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewDeleteImageLogic(r.Context(), svcCtx) - resp, err := l.DeleteImage(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/deletenetworkhandler.go b/api/internal/handler/vm/deletenetworkhandler.go deleted file mode 100644 index 182f3747..00000000 --- a/api/internal/handler/vm/deletenetworkhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func DeleteNetworkHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.DeleteNetworkReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewDeleteNetworkLogic(r.Context(), svcCtx) - resp, err := l.DeleteNetwork(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/deletenetworksegmentrangeshandler.go b/api/internal/handler/vm/deletenetworksegmentrangeshandler.go deleted file mode 100644 index b4cfc237..00000000 --- a/api/internal/handler/vm/deletenetworksegmentrangeshandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func DeleteNetworkSegmentRangesHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.DeleteNetworkSegmentRangesReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewDeleteNetworkSegmentRangesLogic(r.Context(), svcCtx) - resp, err := l.DeleteNetworkSegmentRanges(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/deletenodehandler.go b/api/internal/handler/vm/deletenodehandler.go deleted file mode 100644 index 19f67962..00000000 --- a/api/internal/handler/vm/deletenodehandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func DeleteNodeHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.DeleteNodeReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewDeleteNodeLogic(r.Context(), svcCtx) - resp, err := l.DeleteNode(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/deleteporthandler.go b/api/internal/handler/vm/deleteporthandler.go deleted file mode 100644 index 45d4a17a..00000000 --- a/api/internal/handler/vm/deleteporthandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func DeletePortHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.DeletePortReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewDeletePortLogic(r.Context(), svcCtx) - resp, err := l.DeletePort(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/deleterouterhandler.go b/api/internal/handler/vm/deleterouterhandler.go deleted file mode 100644 index 0184dbed..00000000 --- a/api/internal/handler/vm/deleterouterhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func DeleteRouterHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.DeleteRouterReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewDeleteRouterLogic(r.Context(), svcCtx) - resp, err := l.DeleteRouter(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/deletesecuritygrouphandler.go b/api/internal/handler/vm/deletesecuritygrouphandler.go deleted file mode 100644 index 482ba147..00000000 --- a/api/internal/handler/vm/deletesecuritygrouphandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func DeleteSecurityGroupHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.DeleteSecurityGroupReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewDeleteSecurityGroupLogic(r.Context(), svcCtx) - resp, err := l.DeleteSecurityGroup(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/deletesecuritygrouprulehandler.go b/api/internal/handler/vm/deletesecuritygrouprulehandler.go deleted file mode 100644 index 5dcf49cf..00000000 --- a/api/internal/handler/vm/deletesecuritygrouprulehandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func DeleteSecurityGroupRuleHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.DeleteSecurityGroupRuleReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewDeleteSecurityGroupRuleLogic(r.Context(), svcCtx) - resp, err := l.DeleteSecurityGroupRule(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/deleteserverhandler.go b/api/internal/handler/vm/deleteserverhandler.go deleted file mode 100644 index 412ee0a4..00000000 --- a/api/internal/handler/vm/deleteserverhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func DeleteServerHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.DeleteServerReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewDeleteServerLogic(r.Context(), svcCtx) - resp, err := l.DeleteServer(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/deletesubnethandler.go b/api/internal/handler/vm/deletesubnethandler.go deleted file mode 100644 index cb8e0b40..00000000 --- a/api/internal/handler/vm/deletesubnethandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func DeleteSubnetHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.DeleteSubnetReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewDeleteSubnetLogic(r.Context(), svcCtx) - resp, err := l.DeleteSubnet(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/deletevolumehandler.go b/api/internal/handler/vm/deletevolumehandler.go deleted file mode 100644 index d7e91490..00000000 --- a/api/internal/handler/vm/deletevolumehandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func DeleteVolumeHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.DeleteVolumeReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewDeleteVolumeLogic(r.Context(), svcCtx) - resp, err := l.DeleteVolume(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/deletevolumetypehandler.go b/api/internal/handler/vm/deletevolumetypehandler.go deleted file mode 100644 index 6467de46..00000000 --- a/api/internal/handler/vm/deletevolumetypehandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func DeleteVolumeTypeHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.DeleteVolumeTypeReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewDeleteVolumeTypeLogic(r.Context(), svcCtx) - resp, err := l.DeleteVolumeType(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/getcomputelimitshandler.go b/api/internal/handler/vm/getcomputelimitshandler.go deleted file mode 100644 index e52d0fb9..00000000 --- a/api/internal/handler/vm/getcomputelimitshandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func GetComputeLimitsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.GetComputeLimitsReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewGetComputeLimitsLogic(r.Context(), svcCtx) - resp, err := l.GetComputeLimits(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/getimagenumhandler.go b/api/internal/handler/vm/getimagenumhandler.go deleted file mode 100644 index ecaf4ea1..00000000 --- a/api/internal/handler/vm/getimagenumhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func GetImageNumHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ListImagesReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewGetImageNumLogic(r.Context(), svcCtx) - resp, err := l.GetImageNum(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/getnetworknumhandler.go b/api/internal/handler/vm/getnetworknumhandler.go deleted file mode 100644 index d1115cdf..00000000 --- a/api/internal/handler/vm/getnetworknumhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func GetNetworkNumHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ListNetworksReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewGetNetworkNumLogic(r.Context(), svcCtx) - resp, err := l.GetNetworkNum(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/getserversdetailedbyidhandler.go b/api/internal/handler/vm/getserversdetailedbyidhandler.go deleted file mode 100644 index 884d5412..00000000 --- a/api/internal/handler/vm/getserversdetailedbyidhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func GetServersDetailedByIdHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.GetServersDetailedByIdReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewGetServersDetailedByIdLogic(r.Context(), svcCtx) - resp, err := l.GetServersDetailedById(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/getvolumedetailedbyidhandler.go b/api/internal/handler/vm/getvolumedetailedbyidhandler.go deleted file mode 100644 index fa08be98..00000000 --- a/api/internal/handler/vm/getvolumedetailedbyidhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func GetVolumeDetailedByIdHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.GetVolumeDetailedByIdReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewGetVolumeDetailedByIdLogic(r.Context(), svcCtx) - resp, err := l.GetVolumeDetailedById(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/getvolumelimitshandler.go b/api/internal/handler/vm/getvolumelimitshandler.go deleted file mode 100644 index 07e9af2d..00000000 --- a/api/internal/handler/vm/getvolumelimitshandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func GetVolumeLimitsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.GetVolumeLimitsReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewGetVolumeLimitsLogic(r.Context(), svcCtx) - resp, err := l.GetVolumeLimits(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/listfirewallgroupshandler.go b/api/internal/handler/vm/listfirewallgroupshandler.go deleted file mode 100644 index 01041333..00000000 --- a/api/internal/handler/vm/listfirewallgroupshandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ListFirewallGroupsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ListFirewallGroupsReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewListFirewallGroupsLogic(r.Context(), svcCtx) - resp, err := l.ListFirewallGroups(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/listfirewallpolicieshandler.go b/api/internal/handler/vm/listfirewallpolicieshandler.go deleted file mode 100644 index 877c2806..00000000 --- a/api/internal/handler/vm/listfirewallpolicieshandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ListFirewallPoliciesHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ListFirewallPoliciesReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewListFirewallPoliciesLogic(r.Context(), svcCtx) - resp, err := l.ListFirewallPolicies(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/listfirewallruleshandler.go b/api/internal/handler/vm/listfirewallruleshandler.go deleted file mode 100644 index b630593c..00000000 --- a/api/internal/handler/vm/listfirewallruleshandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ListFirewallRulesHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ListFirewallRulesReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewListFirewallRulesLogic(r.Context(), svcCtx) - resp, err := l.ListFirewallRules(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/listflavorsdetailhandler.go b/api/internal/handler/vm/listflavorsdetailhandler.go deleted file mode 100644 index 09362f69..00000000 --- a/api/internal/handler/vm/listflavorsdetailhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ListFlavorsDetailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ListFlavorsDetailReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewListFlavorsDetailLogic(r.Context(), svcCtx) - resp, err := l.ListFlavorsDetail(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/listfloatingipshandler.go b/api/internal/handler/vm/listfloatingipshandler.go deleted file mode 100644 index f723634c..00000000 --- a/api/internal/handler/vm/listfloatingipshandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ListFloatingIPsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ListFloatingIPsReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewListFloatingIPsLogic(r.Context(), svcCtx) - resp, err := l.ListFloatingIPs(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/listimageshandler.go b/api/internal/handler/vm/listimageshandler.go deleted file mode 100644 index cf5844cb..00000000 --- a/api/internal/handler/vm/listimageshandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ListImagesHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ListImagesReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewListImagesLogic(r.Context(), svcCtx) - resp, err := l.ListImages(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/listnetworksegmentrangesrangehandler.go b/api/internal/handler/vm/listnetworksegmentrangesrangehandler.go deleted file mode 100644 index 27b3478f..00000000 --- a/api/internal/handler/vm/listnetworksegmentrangesrangehandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ListNetworkSegmentRangesRangeHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ListNetworkSegmentRangesReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewListNetworkSegmentRangesRangeLogic(r.Context(), svcCtx) - resp, err := l.ListNetworkSegmentRangesRange(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/listnetworkshandler.go b/api/internal/handler/vm/listnetworkshandler.go deleted file mode 100644 index c7078abf..00000000 --- a/api/internal/handler/vm/listnetworkshandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ListNetworksHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ListNetworksReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewListNetworksLogic(r.Context(), svcCtx) - resp, err := l.ListNetworks(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/listnodeshandler.go b/api/internal/handler/vm/listnodeshandler.go deleted file mode 100644 index fcc192d2..00000000 --- a/api/internal/handler/vm/listnodeshandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ListNodesHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ListNodesReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewListNodesLogic(r.Context(), svcCtx) - resp, err := l.ListNodes(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/listportshandler.go b/api/internal/handler/vm/listportshandler.go deleted file mode 100644 index ac134170..00000000 --- a/api/internal/handler/vm/listportshandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ListPortsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ListPortsReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewListPortsLogic(r.Context(), svcCtx) - resp, err := l.ListPorts(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/listroutershandler.go b/api/internal/handler/vm/listroutershandler.go deleted file mode 100644 index e7b6bc11..00000000 --- a/api/internal/handler/vm/listroutershandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ListRoutersHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ListRoutersReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewListRoutersLogic(r.Context(), svcCtx) - resp, err := l.ListRouters(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/listsecuritygroupruleshandler.go b/api/internal/handler/vm/listsecuritygroupruleshandler.go deleted file mode 100644 index 2b31f7e8..00000000 --- a/api/internal/handler/vm/listsecuritygroupruleshandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ListSecurityGroupRulesHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ListSecurityGroupRulesReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewListSecurityGroupRulesLogic(r.Context(), svcCtx) - resp, err := l.ListSecurityGroupRules(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/listsecuritygroupshandler.go b/api/internal/handler/vm/listsecuritygroupshandler.go deleted file mode 100644 index be559d8d..00000000 --- a/api/internal/handler/vm/listsecuritygroupshandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ListSecurityGroupsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ListSecurityGroupsReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewListSecurityGroupsLogic(r.Context(), svcCtx) - resp, err := l.ListSecurityGroups(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/listserverhandler.go b/api/internal/handler/vm/listserverhandler.go deleted file mode 100644 index 4c859136..00000000 --- a/api/internal/handler/vm/listserverhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ListServerHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ListServersReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewListServerLogic(r.Context(), svcCtx) - resp, err := l.ListServer(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/listserversdetailedhandler.go b/api/internal/handler/vm/listserversdetailedhandler.go deleted file mode 100644 index 1dc3daaf..00000000 --- a/api/internal/handler/vm/listserversdetailedhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ListServersDetailedHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ListServersDetailedReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewListServersDetailedLogic(r.Context(), svcCtx) - resp, err := l.ListServersDetailed(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/listsubnetshandler.go b/api/internal/handler/vm/listsubnetshandler.go deleted file mode 100644 index a148ccc5..00000000 --- a/api/internal/handler/vm/listsubnetshandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ListSubnetsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ListSubnetsReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewListSubnetsLogic(r.Context(), svcCtx) - resp, err := l.ListSubnets(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/listvolumesdetailhandler.go b/api/internal/handler/vm/listvolumesdetailhandler.go deleted file mode 100644 index fd0e6bb2..00000000 --- a/api/internal/handler/vm/listvolumesdetailhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ListVolumesDetailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ListVolumesDetailReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewListVolumesDetailLogic(r.Context(), svcCtx) - resp, err := l.ListVolumesDetail(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/listvolumeshandler.go b/api/internal/handler/vm/listvolumeshandler.go deleted file mode 100644 index 330fc958..00000000 --- a/api/internal/handler/vm/listvolumeshandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ListVolumesHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ListVolumesReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewListVolumesLogic(r.Context(), svcCtx) - resp, err := l.ListVolumes(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/listvolumetypeshandler.go b/api/internal/handler/vm/listvolumetypeshandler.go deleted file mode 100644 index 711a2f75..00000000 --- a/api/internal/handler/vm/listvolumetypeshandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ListVolumeTypesHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ListVolumeTypesReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewListVolumeTypesLogic(r.Context(), svcCtx) - resp, err := l.ListVolumeTypes(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/migrateserverhandler.go b/api/internal/handler/vm/migrateserverhandler.go deleted file mode 100644 index 2a7dbe82..00000000 --- a/api/internal/handler/vm/migrateserverhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func MigrateServerHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.MigrateServerReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewMigrateServerLogic(r.Context(), svcCtx) - resp, err := l.MigrateServer(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/pauseserverhandler.go b/api/internal/handler/vm/pauseserverhandler.go deleted file mode 100644 index 610c4193..00000000 --- a/api/internal/handler/vm/pauseserverhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func PauseServerHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.PauseServerReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewPauseServerLogic(r.Context(), svcCtx) - resp, err := l.PauseServer(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/rebootserverhandler.go b/api/internal/handler/vm/rebootserverhandler.go deleted file mode 100644 index 31da26be..00000000 --- a/api/internal/handler/vm/rebootserverhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func RebootServerHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.RebootServerReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewRebootServerLogic(r.Context(), svcCtx) - resp, err := l.RebootServer(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/removesecuritygrouphandler.go b/api/internal/handler/vm/removesecuritygrouphandler.go deleted file mode 100644 index 40b21349..00000000 --- a/api/internal/handler/vm/removesecuritygrouphandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func RemoveSecurityGroupHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.RemoveSecurityGroupReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewRemoveSecurityGroupLogic(r.Context(), svcCtx) - resp, err := l.RemoveSecurityGroup(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/rescueserverhandler.go b/api/internal/handler/vm/rescueserverhandler.go deleted file mode 100644 index 97c18bd2..00000000 --- a/api/internal/handler/vm/rescueserverhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func RescueServerHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.RescueServerReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewRescueServerLogic(r.Context(), svcCtx) - resp, err := l.RescueServer(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/resizeserverhandler.go b/api/internal/handler/vm/resizeserverhandler.go deleted file mode 100644 index 81d8be1e..00000000 --- a/api/internal/handler/vm/resizeserverhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ResizeServerHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ResizeServerReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewResizeServerLogic(r.Context(), svcCtx) - resp, err := l.ResizeServer(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/shelveserverhandler.go b/api/internal/handler/vm/shelveserverhandler.go deleted file mode 100644 index 927c78c3..00000000 --- a/api/internal/handler/vm/shelveserverhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ShelveServerHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ShelveServerReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewShelveServerLogic(r.Context(), svcCtx) - resp, err := l.ShelveServer(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/showfirewallgroupdetailshandler.go b/api/internal/handler/vm/showfirewallgroupdetailshandler.go deleted file mode 100644 index 6e1e07ae..00000000 --- a/api/internal/handler/vm/showfirewallgroupdetailshandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ShowFirewallGroupDetailsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ShowFirewallGroupDetailsReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewShowFirewallGroupDetailsLogic(r.Context(), svcCtx) - resp, err := l.ShowFirewallGroupDetails(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/showfirewallpolicydetailshandler.go b/api/internal/handler/vm/showfirewallpolicydetailshandler.go deleted file mode 100644 index 1b562893..00000000 --- a/api/internal/handler/vm/showfirewallpolicydetailshandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ShowFirewallPolicyDetailsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ShowFirewallPolicyDetailsReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewShowFirewallPolicyDetailsLogic(r.Context(), svcCtx) - resp, err := l.ShowFirewallPolicyDetails(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/showfirewallruledetailshandler.go b/api/internal/handler/vm/showfirewallruledetailshandler.go deleted file mode 100644 index b026c434..00000000 --- a/api/internal/handler/vm/showfirewallruledetailshandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ShowFirewallRuleDetailsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ShowFirewallRuleDetailsReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewShowFirewallRuleDetailsLogic(r.Context(), svcCtx) - resp, err := l.ShowFirewallRuleDetails(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/showfloatingipdetailshandler.go b/api/internal/handler/vm/showfloatingipdetailshandler.go deleted file mode 100644 index 91e09a44..00000000 --- a/api/internal/handler/vm/showfloatingipdetailshandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ShowFloatingIPDetailsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ShowFloatingIPDetailsReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewShowFloatingIPDetailsLogic(r.Context(), svcCtx) - resp, err := l.ShowFloatingIPDetails(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/shownetworkdetailshandler.go b/api/internal/handler/vm/shownetworkdetailshandler.go deleted file mode 100644 index 113a0e7e..00000000 --- a/api/internal/handler/vm/shownetworkdetailshandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ShowNetworkDetailsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ShowNetworkDetailsReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewShowNetworkDetailsLogic(r.Context(), svcCtx) - resp, err := l.ShowNetworkDetails(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/shownetworksegmentrangedetailshandler.go b/api/internal/handler/vm/shownetworksegmentrangedetailshandler.go deleted file mode 100644 index 309c7533..00000000 --- a/api/internal/handler/vm/shownetworksegmentrangedetailshandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ShowNetworkSegmentRangeDetailsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ShowNetworkSegmentRangeDetailsReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewShowNetworkSegmentRangeDetailsLogic(r.Context(), svcCtx) - resp, err := l.ShowNetworkSegmentRangeDetails(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/shownodedetailshandler.go b/api/internal/handler/vm/shownodedetailshandler.go deleted file mode 100644 index 1a025f73..00000000 --- a/api/internal/handler/vm/shownodedetailshandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ShowNodeDetailsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ShowNodeDetailsReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewShowNodeDetailsLogic(r.Context(), svcCtx) - resp, err := l.ShowNodeDetails(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/showportdetailshandler.go b/api/internal/handler/vm/showportdetailshandler.go deleted file mode 100644 index 2066679e..00000000 --- a/api/internal/handler/vm/showportdetailshandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ShowPortDetailsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ShowPortDetailsReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewShowPortDetailsLogic(r.Context(), svcCtx) - resp, err := l.ShowPortDetails(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/showrouterdetailshandler.go b/api/internal/handler/vm/showrouterdetailshandler.go deleted file mode 100644 index 395e03d2..00000000 --- a/api/internal/handler/vm/showrouterdetailshandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ShowRouterDetailsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ShowRouterDetailsReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewShowRouterDetailsLogic(r.Context(), svcCtx) - resp, err := l.ShowRouterDetails(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/showsecuritygrouphandler.go b/api/internal/handler/vm/showsecuritygrouphandler.go deleted file mode 100644 index 0cf2ecfa..00000000 --- a/api/internal/handler/vm/showsecuritygrouphandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ShowSecurityGroupHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ShowSecurityGroupReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewShowSecurityGroupLogic(r.Context(), svcCtx) - resp, err := l.ShowSecurityGroup(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/showsecuritygrouprulehandler.go b/api/internal/handler/vm/showsecuritygrouprulehandler.go deleted file mode 100644 index 3dcdc0ed..00000000 --- a/api/internal/handler/vm/showsecuritygrouprulehandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func ShowSecurityGroupRuleHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.ShowSecurityGroupRuleReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewShowSecurityGroupRuleLogic(r.Context(), svcCtx) - resp, err := l.ShowSecurityGroupRule(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/startserverhandler.go b/api/internal/handler/vm/startserverhandler.go deleted file mode 100644 index 00fc4257..00000000 --- a/api/internal/handler/vm/startserverhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func StartServerHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.StartServerReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewStartServerLogic(r.Context(), svcCtx) - resp, err := l.StartServer(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/stopserverhandler.go b/api/internal/handler/vm/stopserverhandler.go deleted file mode 100644 index 1941ade0..00000000 --- a/api/internal/handler/vm/stopserverhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func StopServerHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.StopServerReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewStopServerLogic(r.Context(), svcCtx) - resp, err := l.StopServer(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/suspendserverhandler.go b/api/internal/handler/vm/suspendserverhandler.go deleted file mode 100644 index fd9826e8..00000000 --- a/api/internal/handler/vm/suspendserverhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func SuspendServerHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.SuspendServerReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewSuspendServerLogic(r.Context(), svcCtx) - resp, err := l.SuspendServer(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/unpauseserverhandler.go b/api/internal/handler/vm/unpauseserverhandler.go deleted file mode 100644 index 3095d1e8..00000000 --- a/api/internal/handler/vm/unpauseserverhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func UnpauseServerHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.UnpauseServerReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewUnpauseServerLogic(r.Context(), svcCtx) - resp, err := l.UnpauseServer(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/unrescuehandler.go b/api/internal/handler/vm/unrescuehandler.go deleted file mode 100644 index e07adec8..00000000 --- a/api/internal/handler/vm/unrescuehandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func UnRescueHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.UnRescueServerReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewUnRescueLogic(r.Context(), svcCtx) - resp, err := l.UnRescue(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/updatefirewallgrouphandler.go b/api/internal/handler/vm/updatefirewallgrouphandler.go deleted file mode 100644 index 1d072d0b..00000000 --- a/api/internal/handler/vm/updatefirewallgrouphandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func UpdateFirewallGroupHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.UpdateFirewallGroupReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewUpdateFirewallGroupLogic(r.Context(), svcCtx) - resp, err := l.UpdateFirewallGroup(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/updatefloatingiphandler.go b/api/internal/handler/vm/updatefloatingiphandler.go deleted file mode 100644 index 16493a84..00000000 --- a/api/internal/handler/vm/updatefloatingiphandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func UpdateFloatingIPHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.UpdateFloatingIPReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewUpdateFloatingIPLogic(r.Context(), svcCtx) - resp, err := l.UpdateFloatingIP(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/updatenetworkhandler.go b/api/internal/handler/vm/updatenetworkhandler.go deleted file mode 100644 index fc1b3a0c..00000000 --- a/api/internal/handler/vm/updatenetworkhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func UpdateNetworkHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.UpdateNetworkReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewUpdateNetworkLogic(r.Context(), svcCtx) - resp, err := l.UpdateNetwork(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/updatenetworksegmentrangeshandler.go b/api/internal/handler/vm/updatenetworksegmentrangeshandler.go deleted file mode 100644 index c91e38eb..00000000 --- a/api/internal/handler/vm/updatenetworksegmentrangeshandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func UpdateNetworkSegmentRangesHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.UpdateNetworkSegmentRangesReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewUpdateNetworkSegmentRangesLogic(r.Context(), svcCtx) - resp, err := l.UpdateNetworkSegmentRanges(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/updateporthandler.go b/api/internal/handler/vm/updateporthandler.go deleted file mode 100644 index 37e34376..00000000 --- a/api/internal/handler/vm/updateporthandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func UpdatePortHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.UpdatePortReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewUpdatePortLogic(r.Context(), svcCtx) - resp, err := l.UpdatePort(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/updaterouterhandler.go b/api/internal/handler/vm/updaterouterhandler.go deleted file mode 100644 index 262ee32a..00000000 --- a/api/internal/handler/vm/updaterouterhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func UpdateRouterHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.UpdateRouterReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewUpdateRouterLogic(r.Context(), svcCtx) - resp, err := l.UpdateRouter(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/updatesecuritygrouphandler.go b/api/internal/handler/vm/updatesecuritygrouphandler.go deleted file mode 100644 index 2d0d5de2..00000000 --- a/api/internal/handler/vm/updatesecuritygrouphandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func UpdateSecurityGroupHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.UpdateSecurityGroupReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewUpdateSecurityGroupLogic(r.Context(), svcCtx) - resp, err := l.UpdateSecurityGroup(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/updateserverhandler.go b/api/internal/handler/vm/updateserverhandler.go deleted file mode 100644 index acd162a4..00000000 --- a/api/internal/handler/vm/updateserverhandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func UpdateServerHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.UpdateServerReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewUpdateServerLogic(r.Context(), svcCtx) - resp, err := l.UpdateServer(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/updatesubnethandler.go b/api/internal/handler/vm/updatesubnethandler.go deleted file mode 100644 index a8093754..00000000 --- a/api/internal/handler/vm/updatesubnethandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func UpdateSubnetHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.UpdateSubnetReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewUpdateSubnetLogic(r.Context(), svcCtx) - resp, err := l.UpdateSubnet(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/updatevolumehandler.go b/api/internal/handler/vm/updatevolumehandler.go deleted file mode 100644 index 80389014..00000000 --- a/api/internal/handler/vm/updatevolumehandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func UpdateVolumeHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.UpdateVolumeReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewUpdateVolumeLogic(r.Context(), svcCtx) - resp, err := l.UpdateVolume(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/handler/vm/uploadimagehandler.go b/api/internal/handler/vm/uploadimagehandler.go deleted file mode 100644 index 0682d12f..00000000 --- a/api/internal/handler/vm/uploadimagehandler.go +++ /dev/null @@ -1,28 +0,0 @@ -package vm - -import ( - "net/http" - - "github.com/zeromicro/go-zero/rest/httpx" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/logic/vm" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" - "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/types" -) - -func UploadImageHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { - return func(w http.ResponseWriter, r *http.Request) { - var req types.UploadOsImageReq - if err := httpx.Parse(r, &req); err != nil { - httpx.ErrorCtx(r.Context(), w, err) - return - } - - l := vm.NewUploadImageLogic(r.Context(), svcCtx) - resp, err := l.UploadImage(&req) - if err != nil { - httpx.ErrorCtx(r.Context(), w, err) - } else { - httpx.OkJsonCtx(r.Context(), w, resp) - } - } -} diff --git a/api/internal/types/types.go b/api/internal/types/types.go index ccc11455..aeb3d62d 100644 --- a/api/internal/types/types.go +++ b/api/internal/types/types.go @@ -869,10 +869,13 @@ type CommitHpcTaskReq struct { StdErrFile string `json:"stdErrFile,optional"` StdInput string `json:"stdInput,optional"` Environment map[string]string `json:"environment,optional"` + ClusterType string `json:"clusterType,optional"` } type CommitHpcTaskResp struct { - TaskId int64 `json:"taskId"` + TaskId int64 `json:"taskId"` + Code int32 `json:"code"` + Msg string `json:"msg"` } type ListJobReq struct { @@ -2885,7 +2888,7 @@ type Server struct { ImageRef string `json:"imageRef,optional" copier:"ImageRef"` Networks []CreNetwork `json:"networks,optional" copier:"Networks"` BlockDeviceMappingV2 []Block_device_mapping_v2 `json:"block_device_mapping_v2,optional" copier:"BlockDeviceMappingV2"` - MinCount string `json:"min_count,optional" copier:"MinCount"` + MinCount int32 `json:"min_count,optional" copier:"MinCount"` } type CreNetwork struct {