From cca80161d89f0e396424b1a8742ee552f181eba4 Mon Sep 17 00:00:00 2001 From: qiwang <1364512070@qq.com> Date: Wed, 17 May 2023 15:19:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=9F=A5=E8=AF=A2=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E8=AE=AD=E7=BB=83=E4=BD=9C=E4=B8=9A=E5=92=8C=E7=AE=97=E6=B3=95?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: 2464333833f2bfa69ccb16f96ea45ac11794d9e5 --- .../rpc/internal/logic/getlisttrainingjobslogic.go | 4 ++-- .../PCM-MODELARTS/rpc/internal/logic/listalgorithmslogic.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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