| @@ -133,7 +133,7 @@ type ( | |||||
| type ( | type ( | ||||
| getClusterListReq { | getClusterListReq { | ||||
| Id int64 `form:"id"` | |||||
| AdapterId int64 `form:"adapterId"` | |||||
| } | } | ||||
| getClusterListResp { | getClusterListResp { | ||||
| Clusters []ClusterInfo `json:"clusters"` | Clusters []ClusterInfo `json:"clusters"` | ||||
| @@ -10,7 +10,7 @@ info( | |||||
| type ( | type ( | ||||
| commitHpcTaskReq { | commitHpcTaskReq { | ||||
| ClusterId int64 `json:"clusterId,optional"` | |||||
| ClusterId string `json:"clusterId,optional"` | |||||
| Name string `json:"name"` | Name string `json:"name"` | ||||
| Account string `json:"account,optional"` | Account string `json:"account,optional"` | ||||
| Description string `json:"description,optional"` | Description string `json:"description,optional"` | ||||
| @@ -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) { | func (l *GetClusterListLogic) GetClusterList(req *types.GetClusterListReq) (resp *types.GetClusterListResp, err error) { | ||||
| resp = &types.GetClusterListResp{} | resp = &types.GetClusterListResp{} | ||||
| //clusters := []models.ScParticipantPhyInfo{} | //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 | return resp, nil | ||||
| } | } | ||||
| @@ -58,12 +58,12 @@ func (l *CommitHpcTaskLogic) CommitHpcTask(req *types.CommitHpcTaskReq) (resp *t | |||||
| if len(adapterName) == 0 || adapterName == "" { | if len(adapterName) == 0 || adapterName == "" { | ||||
| return nil, errors.New("no corresponding adapter found") | return nil, errors.New("no corresponding adapter found") | ||||
| } | } | ||||
| clusterId, err := strconv.ParseInt(req.ClusterId, 10, 64) | |||||
| hpcInfo := models.TaskHpc{ | hpcInfo := models.TaskHpc{ | ||||
| TaskId: taskModel.Id, | TaskId: taskModel.Id, | ||||
| AdapterId: clusterInfo.AdapterId, | AdapterId: clusterInfo.AdapterId, | ||||
| AdapterName: adapterName, | AdapterName: adapterName, | ||||
| ClusterId: req.ClusterId, | |||||
| ClusterId: clusterId, | |||||
| ClusterName: clusterInfo.Name, | ClusterName: clusterInfo.Name, | ||||
| Name: taskModel.Name, | Name: taskModel.Name, | ||||
| CmdScript: req.CmdScript, | CmdScript: req.CmdScript, | ||||
| @@ -97,7 +97,7 @@ func (l *CommitHpcTaskLogic) CommitHpcTask(req *types.CommitHpcTaskReq) (resp *t | |||||
| noticeInfo := clientCore.NoticeInfo{ | noticeInfo := clientCore.NoticeInfo{ | ||||
| AdapterId: clusterInfo.AdapterId, | AdapterId: clusterInfo.AdapterId, | ||||
| AdapterName: adapterName, | AdapterName: adapterName, | ||||
| ClusterId: req.ClusterId, | |||||
| ClusterId: clusterId, | |||||
| ClusterName: clusterInfo.Name, | ClusterName: clusterInfo.Name, | ||||
| NoticeType: "create", | NoticeType: "create", | ||||
| TaskName: req.Name, | TaskName: req.Name, | ||||
| @@ -119,7 +119,7 @@ type ClusterLoadRecord struct { | |||||
| } | } | ||||
| type GetClusterListReq struct { | type GetClusterListReq struct { | ||||
| Id int64 `form:"id"` | |||||
| AdapterId int64 `form:"adapterId"` | |||||
| } | } | ||||
| type GetClusterListResp struct { | type GetClusterListResp struct { | ||||
| @@ -1276,7 +1276,7 @@ type CommonResp struct { | |||||
| } | } | ||||
| type CommitHpcTaskReq struct { | type CommitHpcTaskReq struct { | ||||
| ClusterId int64 `json:"clusterId,optional"` | |||||
| ClusterId string `json:"clusterId,optional"` | |||||
| Name string `json:"name"` | Name string `json:"name"` | ||||
| Account string `json:"account,optional"` | Account string `json:"account,optional"` | ||||
| Description string `json:"description,optional"` | Description string `json:"description,optional"` | ||||