fix:PCM-CORE代码修改
This commit is contained in:
parent
78409c8553
commit
5eda47bdef
|
@ -54,11 +54,11 @@ func (l *DeleteDataSetLogic) DeleteDataSet(in *modelarts.DeleteDataSetReq) (*mod
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if statusCode == 202 {
|
if statusCode == 204 {
|
||||||
json.Unmarshal(body, &resp)
|
json.Unmarshal(body, &resp)
|
||||||
resp.Code = 200
|
resp.Code = 200
|
||||||
resp.Msg = "Success"
|
resp.Msg = "Success"
|
||||||
} else if statusCode != 202 {
|
} else if statusCode != 204 {
|
||||||
json.Unmarshal(body, &resp)
|
json.Unmarshal(body, &resp)
|
||||||
resp.Code = 400
|
resp.Code = 400
|
||||||
resp.Msg = "Failure"
|
resp.Msg = "Failure"
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -2,11 +2,13 @@ package ai
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"PCM/adaptor/PCM-AI/PCM-MODELARTS/rpc/modelarts"
|
"PCM/adaptor/PCM-AI/PCM-MODELARTS/rpc/modelarts"
|
||||||
|
"PCM/common/result"
|
||||||
"PCM/common/tool"
|
"PCM/common/tool"
|
||||||
"PCM/common/xerr"
|
"PCM/common/xerr"
|
||||||
"context"
|
"context"
|
||||||
"github.com/jinzhu/copier"
|
"github.com/jinzhu/copier"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
|
"k8s.io/apimachinery/pkg/util/json"
|
||||||
|
|
||||||
"PCM/adaptor/PCM-CORE/api/internal/svc"
|
"PCM/adaptor/PCM-CORE/api/internal/svc"
|
||||||
"PCM/adaptor/PCM-CORE/api/internal/types"
|
"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})
|
err = copier.CopyWithOption(modelartsReq, req, copier.Option{Converters: tool.Converters})
|
||||||
deleteDataSetResp, err := l.svcCtx.ModelArtsRpc.DeleteDataSet(l.ctx, modelartsReq)
|
deleteDataSetResp, err := l.svcCtx.ModelArtsRpc.DeleteDataSet(l.ctx, modelartsReq)
|
||||||
if err != nil {
|
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})
|
err = copier.CopyWithOption(&resp, &deleteDataSetResp, copier.Option{Converters: tool.Converters})
|
||||||
return
|
return resp, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,7 @@ func (l *GetListTrainingJobsLogic) GetListTrainingJobs(req *types.ListTrainingJo
|
||||||
}
|
}
|
||||||
json.Unmarshal(marshal, &resp)
|
json.Unmarshal(marshal, &resp)
|
||||||
err = copier.CopyWithOption(&resp, &listDataSetResp, copier.Option{Converters: tool.Converters})
|
err = copier.CopyWithOption(&resp, &listDataSetResp, copier.Option{Converters: tool.Converters})
|
||||||
|
return resp, nil
|
||||||
/* modelartsType := req.ModelartsType
|
/* modelartsType := req.ModelartsType
|
||||||
switch modelartsType {
|
switch modelartsType {
|
||||||
case "octops":
|
case "octops":
|
||||||
|
@ -85,5 +86,5 @@ func (l *GetListTrainingJobsLogic) GetListTrainingJobs(req *types.ListTrainingJo
|
||||||
json.Unmarshal(marshal, &resp)
|
json.Unmarshal(marshal, &resp)
|
||||||
err = copier.CopyWithOption(&resp, &listDataSetResp, copier.Option{Converters: tool.Converters})
|
err = copier.CopyWithOption(&resp, &listDataSetResp, copier.Option{Converters: tool.Converters})
|
||||||
}*/
|
}*/
|
||||||
return resp, nil
|
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue