fix:PCM-CORE代码修改

This commit is contained in:
qiwang 2023-06-13 14:52:14 +08:00
parent 78409c8553
commit 5eda47bdef
6 changed files with 1546 additions and 1532 deletions

View File

@ -54,11 +54,11 @@ func (l *DeleteDataSetLogic) DeleteDataSet(in *modelarts.DeleteDataSetReq) (*mod
if err != nil {
return nil, err
}
if statusCode == 202 {
if statusCode == 204 {
json.Unmarshal(body, &resp)
resp.Code = 200
resp.Msg = "Success"
} else if statusCode != 202 {
} else if statusCode != 204 {
json.Unmarshal(body, &resp)
resp.Code = 400
resp.Msg = "Failure"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -2,11 +2,13 @@ package ai
import (
"PCM/adaptor/PCM-AI/PCM-MODELARTS/rpc/modelarts"
"PCM/common/result"
"PCM/common/tool"
"PCM/common/xerr"
"context"
"github.com/jinzhu/copier"
"github.com/pkg/errors"
"k8s.io/apimachinery/pkg/util/json"
"PCM/adaptor/PCM-CORE/api/internal/svc"
"PCM/adaptor/PCM-CORE/api/internal/types"
@ -34,10 +36,13 @@ func (l *DeleteDataSetLogic) DeleteDataSet(req *types.DeleteDataSetReq) (resp *t
err = copier.CopyWithOption(modelartsReq, req, copier.Option{Converters: tool.Converters})
deleteDataSetResp, err := l.svcCtx.ModelArtsRpc.DeleteDataSet(l.ctx, modelartsReq)
if err != nil {
return nil, errors.Wrapf(xerr.NewErrMsg("Failed to delete db DataSet list"), "Failed to delete db DataSet list err : %v ,req:%+v", err, req)
return nil, errors.Wrapf(xerr.NewErrMsg("Failed to get db DataSet list"), "Failed to get db DataSet list err : %v ,req:%+v", err, req)
}
resp = &types.DeleteDataSetResp{}
marshal, err := json.Marshal(&deleteDataSetResp)
if err != nil {
return nil, result.NewDefaultError(err.Error())
}
json.Unmarshal(marshal, &resp)
err = copier.CopyWithOption(&resp, &deleteDataSetResp, copier.Option{Converters: tool.Converters})
return
return resp, nil
}

View File

@ -42,6 +42,7 @@ func (l *GetListTrainingJobsLogic) GetListTrainingJobs(req *types.ListTrainingJo
}
json.Unmarshal(marshal, &resp)
err = copier.CopyWithOption(&resp, &listDataSetResp, copier.Option{Converters: tool.Converters})
return resp, nil
/* modelartsType := req.ModelartsType
switch modelartsType {
case "octops":
@ -85,5 +86,5 @@ func (l *GetListTrainingJobsLogic) GetListTrainingJobs(req *types.ListTrainingJo
json.Unmarshal(marshal, &resp)
err = copier.CopyWithOption(&resp, &listDataSetResp, copier.Option{Converters: tool.Converters})
}*/
return resp, nil
}

File diff suppressed because it is too large Load Diff