diff --git a/desc/core/pcm-core.api b/desc/core/pcm-core.api index e9fc40f16..8b3064f2f 100644 --- a/desc/core/pcm-core.api +++ b/desc/core/pcm-core.api @@ -133,7 +133,7 @@ type ( type ( getClusterListReq { - Id int64 `form:"id"` + AdapterId int64 `form:"adapterId"` } getClusterListResp { Clusters []ClusterInfo `json:"clusters"` diff --git a/desc/hpc/pcm-hpc.api b/desc/hpc/pcm-hpc.api index a1d67390d..3022215ef 100644 --- a/desc/hpc/pcm-hpc.api +++ b/desc/hpc/pcm-hpc.api @@ -10,7 +10,7 @@ info( type ( commitHpcTaskReq { - ClusterId int64 `json:"clusterId,optional"` + ClusterId string `json:"clusterId,optional"` Name string `json:"name"` Account string `json:"account,optional"` Description string `json:"description,optional"` diff --git a/internal/logic/cloud/getclusterlistlogic.go b/internal/logic/cloud/getclusterlistlogic.go index 2743f0f71..e1a5c2da1 100644 --- a/internal/logic/cloud/getclusterlistlogic.go +++ b/internal/logic/cloud/getclusterlistlogic.go @@ -25,6 +25,6 @@ func NewGetClusterListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Ge func (l *GetClusterListLogic) GetClusterList(req *types.GetClusterListReq) (resp *types.GetClusterListResp, err error) { resp = &types.GetClusterListResp{} //clusters := []models.ScParticipantPhyInfo{} - l.svcCtx.DbEngin.Find(resp.Clusters).Where("id", req.Id) + l.svcCtx.DbEngin.Raw("select * from t_cluster where adapter_id = ?", req.AdapterId).Scan(&resp.Clusters) return resp, nil } diff --git a/internal/logic/hpc/commithpctasklogic.go b/internal/logic/hpc/commithpctasklogic.go index 9b5e24045..37fde84c3 100644 --- a/internal/logic/hpc/commithpctasklogic.go +++ b/internal/logic/hpc/commithpctasklogic.go @@ -58,12 +58,12 @@ func (l *CommitHpcTaskLogic) CommitHpcTask(req *types.CommitHpcTaskReq) (resp *t if len(adapterName) == 0 || adapterName == "" { return nil, errors.New("no corresponding adapter found") } - + clusterId, err := strconv.ParseInt(req.ClusterId, 10, 64) hpcInfo := models.TaskHpc{ TaskId: taskModel.Id, AdapterId: clusterInfo.AdapterId, AdapterName: adapterName, - ClusterId: req.ClusterId, + ClusterId: clusterId, ClusterName: clusterInfo.Name, Name: taskModel.Name, CmdScript: req.CmdScript, @@ -97,7 +97,7 @@ func (l *CommitHpcTaskLogic) CommitHpcTask(req *types.CommitHpcTaskReq) (resp *t noticeInfo := clientCore.NoticeInfo{ AdapterId: clusterInfo.AdapterId, AdapterName: adapterName, - ClusterId: req.ClusterId, + ClusterId: clusterId, ClusterName: clusterInfo.Name, NoticeType: "create", TaskName: req.Name, diff --git a/internal/types/types.go b/internal/types/types.go index 608482b17..0d21eff35 100644 --- a/internal/types/types.go +++ b/internal/types/types.go @@ -119,7 +119,7 @@ type ClusterLoadRecord struct { } type GetClusterListReq struct { - Id int64 `form:"id"` + AdapterId int64 `form:"adapterId"` } type GetClusterListResp struct { @@ -1276,7 +1276,7 @@ type CommonResp struct { } type CommitHpcTaskReq struct { - ClusterId int64 `json:"clusterId,optional"` + ClusterId string `json:"clusterId,optional"` Name string `json:"name"` Account string `json:"account,optional"` Description string `json:"description,optional"`