You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

createdatasetlogic.go 1.4 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package ai
  2. import (
  3. "context"
  4. "github.com/jinzhu/copier"
  5. "github.com/pkg/errors"
  6. "gitlink.org.cn/jcce-pcm/pcm-coordinator/pkg/utils"
  7. "gitlink.org.cn/jcce-pcm/pcm-participant-modelarts/modelarts"
  8. "gitlink.org.cn/jcce-pcm/utils/xerr"
  9. "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
  10. "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
  11. "github.com/zeromicro/go-zero/core/logx"
  12. )
  13. type CreateDataSetLogic struct {
  14. logx.Logger
  15. ctx context.Context
  16. svcCtx *svc.ServiceContext
  17. }
  18. func NewCreateDataSetLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateDataSetLogic {
  19. return &CreateDataSetLogic{
  20. Logger: logx.WithContext(ctx),
  21. ctx: ctx,
  22. svcCtx: svcCtx,
  23. }
  24. }
  25. func (l *CreateDataSetLogic) CreateDataSet(req *types.CreateDataSetReq) (resp *types.CreateDataSetResp, err error) {
  26. // todo: add your logic here and delete this line
  27. modelartsReq := &modelarts.CreateDataSetReq{}
  28. err = copier.CopyWithOption(modelartsReq, req, copier.Option{Converters: utils.Converters})
  29. CreateDataSetResp, err := l.svcCtx.ModelArtsRpc.CreateDataSet(l.ctx, modelartsReq)
  30. if err != nil {
  31. return nil, errors.Wrapf(xerr.NewErrMsg("Failed to get db DataSet list"), "Failed to get db DataSet list err : %v ,req:%+v", err, req)
  32. }
  33. resp = &types.CreateDataSetResp{}
  34. err = copier.CopyWithOption(&resp, &CreateDataSetResp, copier.Option{Converters: utils.Converters})
  35. return resp, nil
  36. }

PCM is positioned as Software stack over Cloud, aiming to build the standards and ecology of heterogeneous cloud collaboration for JCC in a non intrusive and autonomous peer-to-peer manner.