diff --git a/adaptor/PCM-AI/PCM-MODELARTS/rpc/internal/logic/getlisttrainingjobslogic.go b/adaptor/PCM-AI/PCM-MODELARTS/rpc/internal/logic/getlisttrainingjobslogic.go index 25ab0680..a0ff744f 100644 --- a/adaptor/PCM-AI/PCM-MODELARTS/rpc/internal/logic/getlisttrainingjobslogic.go +++ b/adaptor/PCM-AI/PCM-MODELARTS/rpc/internal/logic/getlisttrainingjobslogic.go @@ -44,7 +44,7 @@ func (l *GetListTrainingJobsLogic) GetListTrainingJobs(in *modelarts.ListTrainin } //根据智算类型判断走华为智算还是南京智算 modelArtsType := in.ModelArtsType - if modelArtsType == "huawei" { + if modelArtsType == l.svcCtx.Config.HaweiModelArtsType { modelArtsUrl := l.svcCtx.Config.ModelArtsUrl url := modelArtsUrl + "v2/" + in.ProjectId + "/training-job-searches?limit=" + limit + "&offset=" + offset reqByte, err := json.Marshal(in) @@ -66,7 +66,7 @@ func (l *GetListTrainingJobsLogic) GetListTrainingJobs(in *modelarts.ListTrainin resp.Code = 400 resp.Msg = "Failure" } - } else if modelArtsType == "nanjing" { + } else if modelArtsType == l.svcCtx.Config.NanjingModelArtsType { AK := l.svcCtx.Config.AK SK := l.svcCtx.Config.SK NanjingModelArtsUrl := l.svcCtx.Config.NanjingModelArtsUrl diff --git a/adaptor/PCM-AI/PCM-MODELARTS/rpc/internal/logic/listalgorithmslogic.go b/adaptor/PCM-AI/PCM-MODELARTS/rpc/internal/logic/listalgorithmslogic.go index a9d5cf3d..200d55c2 100644 --- a/adaptor/PCM-AI/PCM-MODELARTS/rpc/internal/logic/listalgorithmslogic.go +++ b/adaptor/PCM-AI/PCM-MODELARTS/rpc/internal/logic/listalgorithmslogic.go @@ -44,7 +44,7 @@ func (l *ListAlgorithmsLogic) ListAlgorithms(in *modelarts.ListAlgorithmsReq) (* //根据智算类型判断走华为智算还是南京智算 modelArtsType := in.ModelArtsType - if modelArtsType == "huawei" { + if modelArtsType == l.svcCtx.Config.HaweiModelArtsType { modelArtsUrl := l.svcCtx.Config.ModelArtsUrl url := modelArtsUrl + in.ProjectId + "v2/" + "/algorithms?offset=" + offset + "&" + "limit=" + limit token := common.GetToken() @@ -62,7 +62,7 @@ func (l *ListAlgorithmsLogic) ListAlgorithms(in *modelarts.ListAlgorithmsReq) (* resp.Msg = "Failure" } - } else if modelArtsType == "nanjing" { + } else if modelArtsType == l.svcCtx.Config.NanjingModelArtsType { AK := l.svcCtx.Config.AK SK := l.svcCtx.Config.SK NanjingModelArtsUrl := l.svcCtx.Config.NanjingModelArtsUrl