| @@ -1,24 +1,28 @@ | |||
| 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" | |||
| "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" | |||
| "net/http" | |||
| ) | |||
| 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 { | |||
| result.ParamErrorResult(r, w, err) | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| return | |||
| } | |||
| l := adapters.NewAdaptersListLogic(r.Context(), svcCtx) | |||
| resp, err := l.AdaptersList(&req) | |||
| result.HttpResult(r, w, resp, err) | |||
| if err != nil { | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| } else { | |||
| httpx.OkJsonCtx(r.Context(), w, resp) | |||
| } | |||
| } | |||
| } | |||
| @@ -1,24 +1,28 @@ | |||
| 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" | |||
| "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" | |||
| "net/http" | |||
| ) | |||
| 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 { | |||
| result.ParamErrorResult(r, w, err) | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| return | |||
| } | |||
| l := adapters.NewClusterListLogic(r.Context(), svcCtx) | |||
| resp, err := l.ClusterList(&req) | |||
| result.HttpResult(r, w, resp, err) | |||
| if err != nil { | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| } else { | |||
| httpx.OkJsonCtx(r.Context(), w, resp) | |||
| } | |||
| } | |||
| } | |||
| @@ -1,24 +1,28 @@ | |||
| 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" | |||
| "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" | |||
| "net/http" | |||
| ) | |||
| 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 { | |||
| result.ParamErrorResult(r, w, err) | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| return | |||
| } | |||
| l := adapters.NewCreateAdapterLogic(r.Context(), svcCtx) | |||
| resp, err := l.CreateAdapter(&req) | |||
| result.HttpResult(r, w, resp, err) | |||
| if err != nil { | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| } else { | |||
| httpx.OkJsonCtx(r.Context(), w, resp) | |||
| } | |||
| } | |||
| } | |||
| @@ -1,24 +1,28 @@ | |||
| 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" | |||
| "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" | |||
| "net/http" | |||
| ) | |||
| func CreateClusterHandler(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 { | |||
| result.ParamErrorResult(r, w, err) | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| return | |||
| } | |||
| l := adapters.NewCreateClusterLogic(r.Context(), svcCtx) | |||
| resp, err := l.CreateCluster(&req) | |||
| result.HttpResult(r, w, resp, err) | |||
| if err != nil { | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| } else { | |||
| httpx.OkJsonCtx(r.Context(), w, resp) | |||
| } | |||
| } | |||
| } | |||
| @@ -1,24 +1,28 @@ | |||
| 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" | |||
| "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" | |||
| "net/http" | |||
| ) | |||
| 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 { | |||
| result.ParamErrorResult(r, w, err) | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| return | |||
| } | |||
| l := adapters.NewDeleteAdapterLogic(r.Context(), svcCtx) | |||
| resp, err := l.DeleteAdapter(&req) | |||
| result.HttpResult(r, w, resp, err) | |||
| if err != nil { | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| } else { | |||
| httpx.OkJsonCtx(r.Context(), w, resp) | |||
| } | |||
| } | |||
| } | |||
| @@ -1,24 +1,28 @@ | |||
| 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" | |||
| "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" | |||
| "net/http" | |||
| ) | |||
| func DeleteClusterHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { | |||
| return func(w http.ResponseWriter, r *http.Request) { | |||
| var req types.ClusterDelReq | |||
| if err := httpx.Parse(r, &req); err != nil { | |||
| result.ParamErrorResult(r, w, err) | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| return | |||
| } | |||
| l := adapters.NewDeleteClusterLogic(r.Context(), svcCtx) | |||
| resp, err := l.DeleteCluster(&req) | |||
| result.HttpResult(r, w, resp, err) | |||
| if err != nil { | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| } else { | |||
| httpx.OkJsonCtx(r.Context(), w, resp) | |||
| } | |||
| } | |||
| } | |||
| @@ -1,24 +1,28 @@ | |||
| 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" | |||
| "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" | |||
| "net/http" | |||
| ) | |||
| 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 { | |||
| result.ParamErrorResult(r, w, err) | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| return | |||
| } | |||
| l := adapters.NewGetAdapterLogic(r.Context(), svcCtx) | |||
| resp, err := l.GetAdapter(&req) | |||
| result.HttpResult(r, w, resp, err) | |||
| if err != nil { | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| } else { | |||
| httpx.OkJsonCtx(r.Context(), w, resp) | |||
| } | |||
| } | |||
| } | |||
| @@ -1,24 +1,28 @@ | |||
| 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" | |||
| "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" | |||
| "net/http" | |||
| ) | |||
| func GetAdapterRelationHandler(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 { | |||
| result.ParamErrorResult(r, w, err) | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| return | |||
| } | |||
| l := adapters.NewGetAdapterRelationLogic(r.Context(), svcCtx) | |||
| resp, err := l.GetAdapterRelation(&req) | |||
| result.HttpResult(r, w, resp, err) | |||
| if err != nil { | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| } else { | |||
| httpx.OkJsonCtx(r.Context(), w, resp) | |||
| } | |||
| } | |||
| } | |||
| @@ -1,24 +1,28 @@ | |||
| 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" | |||
| "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" | |||
| "net/http" | |||
| ) | |||
| func GetClusterHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { | |||
| return func(w http.ResponseWriter, r *http.Request) { | |||
| var req types.ClusterDelReq | |||
| if err := httpx.Parse(r, &req); err != nil { | |||
| result.ParamErrorResult(r, w, err) | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| return | |||
| } | |||
| l := adapters.NewGetClusterLogic(r.Context(), svcCtx) | |||
| resp, err := l.GetCluster(&req) | |||
| result.HttpResult(r, w, resp, err) | |||
| if err != nil { | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| } else { | |||
| httpx.OkJsonCtx(r.Context(), w, resp) | |||
| } | |||
| } | |||
| } | |||
| @@ -1,24 +1,28 @@ | |||
| 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" | |||
| "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" | |||
| "net/http" | |||
| ) | |||
| 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 { | |||
| result.ParamErrorResult(r, w, err) | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| return | |||
| } | |||
| l := adapters.NewGetClusterSumLogic(r.Context(), svcCtx) | |||
| resp, err := l.GetClusterSum(&req) | |||
| result.HttpResult(r, w, resp, err) | |||
| if err != nil { | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| } else { | |||
| httpx.OkJsonCtx(r.Context(), w, resp) | |||
| } | |||
| } | |||
| } | |||
| @@ -1,24 +1,28 @@ | |||
| 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" | |||
| "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" | |||
| "net/http" | |||
| ) | |||
| 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 { | |||
| result.ParamErrorResult(r, w, err) | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| return | |||
| } | |||
| l := adapters.NewUpdateAdapterLogic(r.Context(), svcCtx) | |||
| resp, err := l.UpdateAdapter(&req) | |||
| result.HttpResult(r, w, resp, err) | |||
| if err != nil { | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| } else { | |||
| httpx.OkJsonCtx(r.Context(), w, resp) | |||
| } | |||
| } | |||
| } | |||
| @@ -1,24 +1,28 @@ | |||
| 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" | |||
| "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" | |||
| "net/http" | |||
| ) | |||
| func UpdateClusterHandler(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 { | |||
| result.ParamErrorResult(r, w, err) | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| return | |||
| } | |||
| l := adapters.NewUpdateClusterLogic(r.Context(), svcCtx) | |||
| resp, err := l.UpdateCluster(&req) | |||
| result.HttpResult(r, w, resp, err) | |||
| if err != nil { | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| } else { | |||
| httpx.OkJsonCtx(r.Context(), w, resp) | |||
| } | |||
| } | |||
| } | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package ai | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package ai | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package ai | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package ai | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package ai | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package ai | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package ai | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package ai | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package ai | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package ai | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package ai | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package ai | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package ai | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package ai | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package ai | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package ai | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package ai | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package ai | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package ai | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package ai | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package ai | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package ai | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package ai | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package ai | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package ai | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package ai | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package ai | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package ai | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package ai | |||
| import ( | |||
| @@ -1,24 +1,28 @@ | |||
| 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" | |||
| "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" | |||
| "net/http" | |||
| ) | |||
| 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 { | |||
| result.ParamErrorResult(r, w, err) | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| return | |||
| } | |||
| l := apps.NewAppDetailLogic(r.Context(), svcCtx) | |||
| resp, err := l.AppDetail(&req) | |||
| result.HttpResult(r, w, resp, err) | |||
| if err != nil { | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| } else { | |||
| httpx.OkJsonCtx(r.Context(), w, resp) | |||
| } | |||
| } | |||
| } | |||
| @@ -1,24 +1,28 @@ | |||
| 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" | |||
| "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" | |||
| "net/http" | |||
| ) | |||
| 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 { | |||
| result.ParamErrorResult(r, w, err) | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| return | |||
| } | |||
| l := apps.NewAppListLogic(r.Context(), svcCtx) | |||
| resp, err := l.AppList(&req) | |||
| result.HttpResult(r, w, resp, err) | |||
| if err != nil { | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| } else { | |||
| httpx.OkJsonCtx(r.Context(), w, resp) | |||
| } | |||
| } | |||
| } | |||
| @@ -1,24 +1,28 @@ | |||
| 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" | |||
| "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" | |||
| "net/http" | |||
| ) | |||
| 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 { | |||
| result.ParamErrorResult(r, w, err) | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| return | |||
| } | |||
| l := apps.NewAppPodsLogic(r.Context(), svcCtx) | |||
| resp, err := l.AppPods(&req) | |||
| result.HttpResult(r, w, resp, err) | |||
| if err != nil { | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| } else { | |||
| httpx.OkJsonCtx(r.Context(), w, resp) | |||
| } | |||
| } | |||
| } | |||
| @@ -1,24 +1,28 @@ | |||
| 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" | |||
| "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" | |||
| "net/http" | |||
| ) | |||
| 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 { | |||
| result.ParamErrorResult(r, w, err) | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| return | |||
| } | |||
| l := apps.NewDeleteAppByAppNameLogic(r.Context(), svcCtx) | |||
| resp, err := l.DeleteAppByAppName(&req) | |||
| result.HttpResult(r, w, resp, err) | |||
| if err != nil { | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| } else { | |||
| httpx.OkJsonCtx(r.Context(), w, resp) | |||
| } | |||
| } | |||
| } | |||
| @@ -1,24 +1,28 @@ | |||
| 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" | |||
| "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" | |||
| "net/http" | |||
| ) | |||
| 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 { | |||
| result.ParamErrorResult(r, w, err) | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| return | |||
| } | |||
| l := apps.NewGetAppByAppNameLogic(r.Context(), svcCtx) | |||
| resp, err := l.GetAppByAppName(&req) | |||
| result.HttpResult(r, w, resp, err) | |||
| if err != nil { | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| } else { | |||
| httpx.OkJsonCtx(r.Context(), w, resp) | |||
| } | |||
| } | |||
| } | |||
| @@ -1,24 +1,28 @@ | |||
| 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" | |||
| "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" | |||
| "net/http" | |||
| ) | |||
| 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 { | |||
| result.ParamErrorResult(r, w, err) | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| return | |||
| } | |||
| l := apps.NewPauseAppByAppNameLogic(r.Context(), svcCtx) | |||
| resp, err := l.PauseAppByAppName(&req) | |||
| result.HttpResult(r, w, resp, err) | |||
| if err != nil { | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| } else { | |||
| httpx.OkJsonCtx(r.Context(), w, resp) | |||
| } | |||
| } | |||
| } | |||
| @@ -1,24 +1,28 @@ | |||
| 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" | |||
| "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" | |||
| "net/http" | |||
| ) | |||
| 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 { | |||
| result.ParamErrorResult(r, w, err) | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| return | |||
| } | |||
| l := apps.NewRestartAppByAppNameLogic(r.Context(), svcCtx) | |||
| resp, err := l.RestartAppByAppName(&req) | |||
| result.HttpResult(r, w, resp, err) | |||
| if err != nil { | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| } else { | |||
| httpx.OkJsonCtx(r.Context(), w, resp) | |||
| } | |||
| } | |||
| } | |||
| @@ -1,24 +1,28 @@ | |||
| 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" | |||
| "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" | |||
| "net/http" | |||
| ) | |||
| 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 { | |||
| result.ParamErrorResult(r, w, err) | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| return | |||
| } | |||
| l := apps.NewStartAppByAppNameLogic(r.Context(), svcCtx) | |||
| resp, err := l.StartAppByAppName(&req) | |||
| result.HttpResult(r, w, resp, err) | |||
| if err != nil { | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| } else { | |||
| httpx.OkJsonCtx(r.Context(), w, resp) | |||
| } | |||
| } | |||
| } | |||
| @@ -1,24 +1,28 @@ | |||
| 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" | |||
| "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" | |||
| "net/http" | |||
| ) | |||
| 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 { | |||
| result.ParamErrorResult(r, w, err) | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| return | |||
| } | |||
| l := apps.NewUpdateAppByAppNameLogic(r.Context(), svcCtx) | |||
| resp, err := l.UpdateAppByAppName(&req) | |||
| result.HttpResult(r, w, resp, err) | |||
| if err != nil { | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| } else { | |||
| httpx.OkJsonCtx(r.Context(), w, resp) | |||
| } | |||
| } | |||
| } | |||
| @@ -1,30 +1,21 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| 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/pkg/repository/result" | |||
| "net/http" | |||
| ) | |||
| 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() | |||
| result.HttpResult(r, w, resp, err) | |||
| if err != nil { | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| } else { | |||
| httpx.OkJsonCtx(r.Context(), w, resp) | |||
| } | |||
| } | |||
| } | |||
| @@ -1,7 +1,6 @@ | |||
| package cloud | |||
| import ( | |||
| "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" | |||
| "net/http" | |||
| "github.com/zeromicro/go-zero/rest/httpx" | |||
| @@ -20,6 +19,10 @@ func ControllerMetricsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { | |||
| l := cloud.NewControllerMetricsLogic(r.Context(), svcCtx) | |||
| resp, err := l.ControllerMetrics(&req) | |||
| result.HttpResult(r, w, resp, err) | |||
| if err != nil { | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| } else { | |||
| httpx.OkJsonCtx(r.Context(), w, resp) | |||
| } | |||
| } | |||
| } | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package cloud | |||
| import ( | |||
| @@ -1,24 +0,0 @@ | |||
| package cloud | |||
| import ( | |||
| "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" | |||
| "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" | |||
| "net/http" | |||
| ) | |||
| func ListCloudClusterHandler(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 { | |||
| result.ParamErrorResult(r, w, err) | |||
| return | |||
| } | |||
| l := cloud.NewListCloudClusterLogic(r.Context(), svcCtx) | |||
| resp, err := l.ListCloudCluster(&req) | |||
| result.HttpResult(r, w, resp, err) | |||
| } | |||
| } | |||
| @@ -1,16 +1,21 @@ | |||
| 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/pkg/repository/result" | |||
| "net/http" | |||
| ) | |||
| 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() | |||
| result.HttpResult(r, w, resp, err) | |||
| if err != nil { | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| } else { | |||
| httpx.OkJsonCtx(r.Context(), w, resp) | |||
| } | |||
| } | |||
| } | |||
| @@ -1,24 +1,28 @@ | |||
| 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" | |||
| "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" | |||
| "net/http" | |||
| ) | |||
| 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 { | |||
| result.ParamErrorResult(r, w, err) | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| return | |||
| } | |||
| l := cloud.NewRegisterClusterLogic(r.Context(), svcCtx) | |||
| resp, err := l.RegisterCluster(&req) | |||
| result.HttpResult(r, w, resp, err) | |||
| if err != nil { | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| } else { | |||
| httpx.OkJsonCtx(r.Context(), w, resp) | |||
| } | |||
| } | |||
| } | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package hpc | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package hpc | |||
| import ( | |||
| @@ -1,23 +1,9 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package hpc | |||
| import ( | |||
| "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" | |||
| "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" | |||
| ) | |||
| @@ -26,6 +12,10 @@ 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() | |||
| result.HttpResult(r, w, resp, err) | |||
| if err != nil { | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| } else { | |||
| httpx.OkJsonCtx(r.Context(), w, resp) | |||
| } | |||
| } | |||
| } | |||
| @@ -1,208 +1,21 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package image | |||
| import ( | |||
| "bufio" | |||
| "context" | |||
| "encoding/base64" | |||
| "fmt" | |||
| "github.com/aws/aws-sdk-go/aws" | |||
| "github.com/aws/aws-sdk-go/service/s3/s3manager" | |||
| types2 "github.com/docker/docker/api/types" | |||
| "github.com/zeromicro/go-zero/core/logx" | |||
| "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/models" | |||
| "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" | |||
| "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/fileutils" | |||
| "io/ioutil" | |||
| "k8s.io/apimachinery/pkg/util/json" | |||
| "net/http" | |||
| "os" | |||
| "path/filepath" | |||
| "strconv" | |||
| "strings" | |||
| "sync" | |||
| "time" | |||
| "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" | |||
| ) | |||
| var dir, _ = os.Getwd() | |||
| var uploadPath = filepath.Join(dir, "uploads") | |||
| func ChunkHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { | |||
| return func(w http.ResponseWriter, r *http.Request) { | |||
| size, _ := strconv.ParseInt(r.PostFormValue("size"), 10, 64) | |||
| hash := r.PostFormValue("hash") | |||
| name := r.PostFormValue("name") | |||
| dataType := r.PostFormValue("dataType") | |||
| kind := r.PostFormValue("kind") | |||
| // 对比合并请求的文件大小和已上传文件夹大小 | |||
| toSize, err := fileutils.GetDirSize(filepath.Join(uploadTempPath, hash)) | |||
| l := image.NewChunkLogic(r.Context(), svcCtx) | |||
| err := l.Chunk() | |||
| if err != nil { | |||
| logx.Error(err) | |||
| result.HttpResult(r, w, nil, err) | |||
| return | |||
| } | |||
| if size != toSize { | |||
| fmt.Fprintf(w, "文件上传错误") | |||
| } | |||
| chunksPath := filepath.Join(uploadTempPath, hash) | |||
| files, _ := ioutil.ReadDir(chunksPath) | |||
| // 将文件根据索引序号排序 | |||
| filesSort := make(map[string]string) | |||
| for _, f := range files { | |||
| nameArr := strings.Split(f.Name(), "-") | |||
| filesSort[nameArr[1]] = f.Name() | |||
| } | |||
| saveFile := filepath.Join(uploadPath, name) | |||
| if exists, _ := fileutils.PathExists(saveFile); exists { | |||
| os.Remove(saveFile) | |||
| } | |||
| fs, _ := os.OpenFile(saveFile, os.O_CREATE|os.O_RDWR|os.O_APPEND, os.ModeAppend|os.ModePerm) | |||
| var wg sync.WaitGroup | |||
| filesCount := len(files) | |||
| if filesCount != len(filesSort) { | |||
| fmt.Fprintf(w, "文件上传错误2") | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| } else { | |||
| httpx.Ok(w) | |||
| } | |||
| wg.Add(filesCount) | |||
| for i := 0; i < filesCount; i++ { | |||
| // 这里一定要注意按顺序读取不然文件就会损坏 | |||
| fileName := filepath.Join(chunksPath, filesSort[strconv.Itoa(i)]) | |||
| data, err := ioutil.ReadFile(fileName) | |||
| fmt.Println(err) | |||
| fs.Write(data) | |||
| wg.Done() | |||
| } | |||
| wg.Wait() | |||
| os.RemoveAll(chunksPath) | |||
| // 保存到数据库表里 | |||
| svcCtx.DbEngin.Create(&models.File{ | |||
| Name: name, | |||
| Hash: hash, | |||
| DataType: dataType, | |||
| Status: "local", | |||
| Kind: kind, | |||
| Bucket: "pcm"}) | |||
| // 根据数据类型按需上传(镜像推送到nexus 数据集和算法推送到云际存储) | |||
| switch kind { | |||
| case "image": | |||
| err = pushImage(svcCtx, hash, name) | |||
| case "dataSet", "algorithm": | |||
| err = uploadStorage(svcCtx, hash, name) | |||
| } | |||
| // 删除本地文件 避免占用本地存储资源 | |||
| defer os.Remove(filepath.Join(uploadPath, name)) | |||
| defer fs.Close() | |||
| result.HttpResult(r, w, nil, err) | |||
| } | |||
| } | |||
| // 同步数据集到modelArts | |||
| func syncDataSet() { | |||
| } | |||
| // 上传文件到云集存储 | |||
| func uploadStorage(svcCtx *svc.ServiceContext, hash string, name string) error { | |||
| fileInfo, err := os.Open(filepath.Join(uploadPath, name)) | |||
| if err != nil { | |||
| logx.Error(err) | |||
| return err | |||
| } | |||
| _, err = svcCtx.Uploader.Upload(&s3manager.UploadInput{ | |||
| Bucket: aws.String("pcm"), | |||
| Key: aws.String(name), | |||
| Body: fileInfo, | |||
| }) | |||
| if err != nil { | |||
| logx.Error(err) | |||
| return err | |||
| } | |||
| // 更新数据状态 | |||
| svcCtx.DbEngin.Model(&models.File{}).Where("hash = ?", hash).Update("status", "cloud") | |||
| return nil | |||
| } | |||
| // 推送镜像到nexus仓库 | |||
| func pushImage(svcCtx *svc.ServiceContext, hash string, name string) error { | |||
| // 加载镜像文件到docker | |||
| fileInfo, err := os.Open(filepath.Join(uploadPath, name)) | |||
| if err != nil { | |||
| logx.Error(err) | |||
| return err | |||
| } | |||
| defer fileInfo.Close() | |||
| reader := bufio.NewReader(fileInfo) | |||
| body, err := svcCtx.DockerClient.ImageLoad(context.Background(), reader, false) | |||
| if err != nil { | |||
| logx.Error(err) | |||
| return err | |||
| } | |||
| bytes, err := ioutil.ReadAll(body.Body) | |||
| println(string(bytes)) | |||
| if err != nil { | |||
| logx.Error(err) | |||
| return err | |||
| } | |||
| //time.Sleep(12 * 100 * time.Millisecond) | |||
| privateImageName := "registry.cn-hangzhou.aliyuncs.com/jointcloud/pcm:" + name | |||
| // 给镜像打上私有仓库的tag | |||
| err = svcCtx.DockerClient.ImageTag(context.Background(), name, privateImageName) | |||
| if err != nil { | |||
| logx.Error(err) | |||
| return err | |||
| } | |||
| // 删除原镜像 | |||
| _, err = svcCtx.DockerClient.ImageRemove(context.Background(), name, types2.ImageRemoveOptions{}) | |||
| if err != nil { | |||
| logx.Error(err) | |||
| return err | |||
| } | |||
| // 推送镜像到registry | |||
| authConfig := types2.AuthConfig{ | |||
| Username: svcCtx.Config.RegistryConf.Username, | |||
| Password: svcCtx.Config.RegistryConf.Password, | |||
| } | |||
| authConfigBytes, err := json.Marshal(authConfig) | |||
| if err != nil { | |||
| logx.Error(err) | |||
| return err | |||
| } | |||
| logx.Infof(fmt.Sprintln("传输开始", time.Now())) | |||
| authStr := base64.URLEncoding.EncodeToString(authConfigBytes) | |||
| pushBody, err := svcCtx.DockerClient.ImagePush(context.Background(), privateImageName, types2.ImagePushOptions{RegistryAuth: authStr}) | |||
| pushBytes, _ := ioutil.ReadAll(pushBody) | |||
| println(string(pushBytes)) | |||
| if err != nil { | |||
| logx.Error(err) | |||
| return err | |||
| } | |||
| logx.Infof(fmt.Sprintln("传输完成", time.Now())) | |||
| // 删除本地镜像 避免存储资源浪费 | |||
| _, err = svcCtx.DockerClient.ImageRemove(context.Background(), privateImageName, types2.ImageRemoveOptions{}) | |||
| if err != nil { | |||
| logx.Error(err) | |||
| return err | |||
| } | |||
| // 更新数据状态 | |||
| svcCtx.DbEngin.Model(&models.File{}).Where("hash = ?", hash).Update("status", "cloud") | |||
| return nil | |||
| } | |||
| @@ -1,21 +1,6 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package image | |||
| import ( | |||
| result2 "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" | |||
| "net/http" | |||
| "github.com/zeromicro/go-zero/rest/httpx" | |||
| @@ -34,6 +19,10 @@ func DataSetCheckHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { | |||
| l := image.NewDataSetCheckLogic(r.Context(), svcCtx) | |||
| resp, err := l.DataSetCheck(&req) | |||
| result2.HttpResult(r, w, resp, err) | |||
| if err != nil { | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| } else { | |||
| httpx.OkJsonCtx(r.Context(), w, resp) | |||
| } | |||
| } | |||
| } | |||
| @@ -1,23 +1,9 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package image | |||
| import ( | |||
| "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" | |||
| "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" | |||
| ) | |||
| @@ -26,6 +12,10 @@ 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() | |||
| result.HttpResult(r, w, resp, err) | |||
| if err != nil { | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| } else { | |||
| httpx.OkJsonCtx(r.Context(), w, resp) | |||
| } | |||
| } | |||
| } | |||
| @@ -1,72 +1,21 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package image | |||
| import ( | |||
| "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" | |||
| "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) { | |||
| ////file, fileHeader, err := r.FormFile("file") | |||
| ////if err != nil { | |||
| //// return | |||
| ////} | |||
| //AK := "your_access_key" | |||
| //SK := "your_secret_key" | |||
| //cred := aws.Credentials{AccessKeyID: AK, SecretAccessKey: SK} | |||
| // | |||
| //uploader := manager.NewUploader(client) | |||
| //endpointURL := "http://10.105.24.4:7480" | |||
| // | |||
| //customResolver := aws.EndpointResolverWithOptionsFunc(func(service, region string, options ...interface{}) (aws.Endpoint, error) { | |||
| // return aws.Endpoint{ | |||
| // URL: endpointURL, | |||
| // }, nil | |||
| //}) | |||
| // | |||
| //client := s3.NewFromConfig(aws.Config{Credentials: credentials.NewAccessKeyCredential()}) | |||
| //cfg, err := config.LoadDefaultConfig(context.TODO(), config.WithEndpointResolverWithOptions(customResolver)) | |||
| //if err != nil { | |||
| // panic(err) | |||
| //} | |||
| // | |||
| //s3Client := s3.NewFromConfig(cfg, func(options *s3.Options) { | |||
| // options.UsePathStyle = true | |||
| //}) | |||
| // 上传文件 | |||
| //uploader := manager.NewUploader(s3Client) | |||
| //bucket := "pcm" | |||
| //key := fileHeader.Filename | |||
| //result, err := uploader.Upload(context.TODO(), &s3.PutObjectInput{ | |||
| // Bucket: &bucket, | |||
| // Key: &key, | |||
| // Body: file, | |||
| //}) | |||
| //println(result) | |||
| //output, err := s3Client.ListObjectsV2(context.TODO(), &s3.ListObjectsV2Input{ | |||
| // Bucket: aws.String("my-bucket"), | |||
| //}) | |||
| //if err != nil { | |||
| // log.Fatal(err) | |||
| //} | |||
| // | |||
| //log.Println("first page results:") | |||
| //for _, object := range output.Contents { | |||
| // log.Printf("key=%s size=%d", aws.ToString(object.Key), object.Size) | |||
| //} | |||
| l := image.NewUploadDataSetLogic(r.Context(), svcCtx) | |||
| err := l.UploadDataSet() | |||
| if err != nil { | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| } else { | |||
| httpx.Ok(w) | |||
| } | |||
| } | |||
| } | |||
| @@ -1,118 +1,21 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package image | |||
| import ( | |||
| "bufio" | |||
| "fmt" | |||
| "github.com/zeromicro/go-zero/core/logx" | |||
| "gitlink.org.cn/JointCloud/pcm-coordinator/api/internal/svc" | |||
| "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" | |||
| "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/fileutils" | |||
| "io" | |||
| "net/http" | |||
| "os" | |||
| "path/filepath" | |||
| "strconv" | |||
| "syscall" | |||
| ) | |||
| type LoadBody struct { | |||
| Stream string `json:"stream"` | |||
| } | |||
| var uploadTempPath = filepath.Join(uploadPath, "temp") | |||
| "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) { | |||
| file, fileHeader, err := r.FormFile("file") | |||
| l := image.NewUploadLogic(r.Context(), svcCtx) | |||
| err := l.Upload() | |||
| if err != nil { | |||
| logx.Error(err) | |||
| result.HttpResult(r, w, nil, err) | |||
| return | |||
| } | |||
| index := r.PostFormValue("index") | |||
| hash := r.PostFormValue("hash") | |||
| defer file.Close() | |||
| // 合并路径 | |||
| chunksPath := filepath.Join(uploadTempPath, hash) | |||
| // 文件路径 | |||
| filePath := filepath.Join(chunksPath, hash+"-"+index) | |||
| // 检查临时文件夹是否存在 不存在则创建文件夹 | |||
| isPathExists, err := fileutils.PathExists(chunksPath) | |||
| if !isPathExists { | |||
| err = os.MkdirAll(chunksPath, os.ModePerm) | |||
| if err != nil { | |||
| logx.Error(err) | |||
| result.HttpResult(r, w, nil, err) | |||
| return | |||
| } | |||
| } | |||
| // 检查文件是否存在 | |||
| exists, err := fileutils.PathExists(filePath) | |||
| if err != nil { | |||
| logx.Error(err) | |||
| result.HttpResult(r, w, nil, err) | |||
| return | |||
| } | |||
| // 文件存在 进行断点续传 | |||
| if exists { | |||
| fileInfo, _ := os.Stat(filePath) | |||
| if fileInfo.Size() == fileHeader.Size { | |||
| result.HttpResult(r, w, nil, err) | |||
| return | |||
| } | |||
| start := strconv.Itoa(int(fileInfo.Size())) | |||
| oldFile, _ := os.OpenFile(filePath, os.O_CREATE|os.O_WRONLY, os.ModePerm) | |||
| defer oldFile.Close() | |||
| count, _ := strconv.ParseInt(start, 10, 64) | |||
| fmt.Println("已上传:", count) | |||
| // 设置读,写的偏移量 | |||
| file.Seek(count, 0) | |||
| oldFile.Seek(count, 0) | |||
| data := make([]byte, 1024, 1024) | |||
| for { | |||
| total, err := file.Read(data) | |||
| if err == io.EOF { | |||
| fmt.Println("文件复制完毕") | |||
| break | |||
| } | |||
| oldFile.Write(data[:total]) | |||
| } | |||
| // 文件不存在 直接上传 | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| } else { | |||
| destFile, _ := os.OpenFile(filepath.Join(chunksPath, hash+"-"+index), syscall.O_CREAT|syscall.O_WRONLY, 0777) | |||
| reader := bufio.NewReader(file) | |||
| writer := bufio.NewWriter(destFile) | |||
| buf := make([]byte, 1024*1024) // 1M buf | |||
| for { | |||
| n, err := reader.Read(buf) | |||
| if err == io.EOF { | |||
| writer.Flush() | |||
| break | |||
| } else if err != nil { | |||
| return | |||
| } else { | |||
| writer.Write(buf[:n]) | |||
| } | |||
| } | |||
| defer file.Close() | |||
| defer destFile.Close() | |||
| httpx.Ok(w) | |||
| } | |||
| result.HttpResult(r, w, nil, err) | |||
| } | |||
| } | |||
| @@ -1,16 +1,21 @@ | |||
| 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/pkg/repository/result" | |||
| "net/http" | |||
| ) | |||
| 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() | |||
| result.HttpResult(r, w, resp, err) | |||
| if err != nil { | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| } else { | |||
| httpx.OkJsonCtx(r.Context(), w, resp) | |||
| } | |||
| } | |||
| } | |||
| @@ -1,16 +1,21 @@ | |||
| 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/pkg/repository/result" | |||
| "net/http" | |||
| ) | |||
| 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() | |||
| result.HttpResult(r, w, resp, err) | |||
| if err != nil { | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| } else { | |||
| httpx.OkJsonCtx(r.Context(), w, resp) | |||
| } | |||
| } | |||
| } | |||
| @@ -1,16 +1,21 @@ | |||
| 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/pkg/repository/result" | |||
| "net/http" | |||
| ) | |||
| 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() | |||
| result.HttpResult(r, w, resp, err) | |||
| if err != nil { | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| } else { | |||
| httpx.OkJsonCtx(r.Context(), w, resp) | |||
| } | |||
| } | |||
| } | |||
| @@ -1,16 +1,21 @@ | |||
| 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/pkg/repository/result" | |||
| "net/http" | |||
| ) | |||
| 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() | |||
| result.HttpResult(r, w, resp, err) | |||
| if err != nil { | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| } else { | |||
| httpx.OkJsonCtx(r.Context(), w, resp) | |||
| } | |||
| } | |||
| } | |||
| @@ -1,24 +1,28 @@ | |||
| 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" | |||
| "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/repository/result" | |||
| "net/http" | |||
| ) | |||
| 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 { | |||
| result.ParamErrorResult(r, w, err) | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| return | |||
| } | |||
| l := schedule.NewScheduleSubmitLogic(r.Context(), svcCtx) | |||
| resp, err := l.ScheduleSubmit(&req) | |||
| result.HttpResult(r, w, resp, err) | |||
| if err != nil { | |||
| httpx.ErrorCtx(r.Context(), w, err) | |||
| } else { | |||
| httpx.OkJsonCtx(r.Context(), w, resp) | |||
| } | |||
| } | |||
| } | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package storage | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package storage | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package storage | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package storelink | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package storelink | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package storelink | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package storelink | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package storelink | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package storelink | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package storelink | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package storelink | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package vm | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package vm | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package vm | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package vm | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package vm | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package vm | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package vm | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package vm | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package vm | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package vm | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package vm | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package vm | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package vm | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package vm | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package vm | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package vm | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package vm | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package vm | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package vm | |||
| import ( | |||
| @@ -1,17 +1,3 @@ | |||
| /* | |||
| Copyright (c) [2023] [pcm] | |||
| [pcm-coordinator] is licensed under Mulan PSL v2. | |||
| You can use this software according to the terms and conditions of the Mulan PSL v2. | |||
| You may obtain a copy of Mulan PSL v2 at: | |||
| http://license.coscl.org.cn/MulanPSL2 | |||
| THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | |||
| EITHER EXPaRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | |||
| MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | |||
| See the Mulan PSL v2 for more details. | |||
| */ | |||
| package vm | |||
| import ( | |||