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.

storeLink.go 1.2 kB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package storeLink
  2. import (
  3. "context"
  4. "github.com/pkg/errors"
  5. "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
  6. "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
  7. "gitlink.org.cn/jcce-pcm/pcm-participant-octopus/octopus"
  8. )
  9. type Linkage interface {
  10. UploadImage() (interface{}, error)
  11. DeleteImage() (interface{}, error)
  12. QueryImageList() (interface{}, error)
  13. SubmitTask() (interface{}, error)
  14. QueryTask() (interface{}, error)
  15. DeleteTask() (interface{}, error)
  16. }
  17. type StoreLink struct {
  18. ILinkage Linkage
  19. }
  20. func NewStoreLink(ctx context.Context, svcCtx *svc.ServiceContext, partId int64) *StoreLink {
  21. linkStruct := NewOctopusLink(ctx, svcCtx, "hanwuji")
  22. return &StoreLink{ILinkage: linkStruct}
  23. }
  24. func ConvertType[T any](in *T) (interface{}, error) {
  25. switch (interface{})(in).(type) {
  26. case *octopus.GetUserImageListResp:
  27. var imgListResp types.GetLinkImageListResp
  28. resp := (interface{})(in).(*octopus.GetUserImageListResp)
  29. imgListResp.ImageIds = append(imgListResp.ImageIds, resp.Payload.Images[0].Image.CreatedAt)
  30. imgListResp.ImageIds = append(imgListResp.ImageIds, resp.Payload.Images[0].Image.CreatedAt)
  31. return imgListResp, nil
  32. default:
  33. return nil, errors.New("type convert fail")
  34. }
  35. }

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.