Browse Source

Merge pull request '提交超算任务接口修改clusterId参数类型' (#338) from zhangweiii/pcm-coordinator:master into master

pull/339/head
zhangweiii 1 year ago
parent
commit
2f10d7d71a
5 changed files with 8 additions and 8 deletions
  1. +1
    -1
      desc/core/pcm-core.api
  2. +1
    -1
      desc/hpc/pcm-hpc.api
  3. +1
    -1
      internal/logic/cloud/getclusterlistlogic.go
  4. +3
    -3
      internal/logic/hpc/commithpctasklogic.go
  5. +2
    -2
      internal/types/types.go

+ 1
- 1
desc/core/pcm-core.api View File

@@ -133,7 +133,7 @@ type (

type (
getClusterListReq {
Id int64 `form:"id"`
AdapterId int64 `form:"adapterId"`
}
getClusterListResp {
Clusters []ClusterInfo `json:"clusters"`


+ 1
- 1
desc/hpc/pcm-hpc.api View File

@@ -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"`


+ 1
- 1
internal/logic/cloud/getclusterlistlogic.go View File

@@ -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
}

+ 3
- 3
internal/logic/hpc/commithpctasklogic.go View File

@@ -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,


+ 2
- 2
internal/types/types.go View File

@@ -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"`


Loading…
Cancel
Save