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.

getcenterlistlogic.go 946 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package ai
  2. import (
  3. "context"
  4. "gitlink.org.cn/JointCloud/pcm-coordinator/internal/svc"
  5. "gitlink.org.cn/JointCloud/pcm-coordinator/internal/types"
  6. "github.com/zeromicro/go-zero/core/logx"
  7. )
  8. type GetCenterListLogic struct {
  9. logx.Logger
  10. ctx context.Context
  11. svcCtx *svc.ServiceContext
  12. }
  13. func NewGetCenterListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetCenterListLogic {
  14. return &GetCenterListLogic{
  15. Logger: logx.WithContext(ctx),
  16. ctx: ctx,
  17. svcCtx: svcCtx,
  18. }
  19. }
  20. func (l *GetCenterListLogic) GetCenterList() (resp *types.CenterListResp, err error) {
  21. resp = &types.CenterListResp{}
  22. adapterList, err := l.svcCtx.Scheduler.AiStorages.GetAdaptersByType("1")
  23. if err != nil {
  24. return nil, err
  25. }
  26. for _, adapter := range adapterList {
  27. a := &types.AiCenter{
  28. Name: adapter.Name,
  29. StackName: adapter.Nickname,
  30. Version: adapter.Version,
  31. }
  32. resp.List = append(resp.List, a)
  33. }
  34. return resp, nil
  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.