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.

percentercomputerpowerslogic.go 1.1 kB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package storage
  2. import (
  3. "context"
  4. "gitlink.org.cn/JointCloud/pcm-coordinator/internal/svc"
  5. "gitlink.org.cn/JointCloud/pcm-coordinator/internal/types"
  6. "gitlink.org.cn/JointCloud/pcm-coordinator/pkg/utils/httputils"
  7. "k8s.io/apimachinery/pkg/util/json"
  8. "strings"
  9. "github.com/zeromicro/go-zero/core/logx"
  10. )
  11. type PerCenterComputerPowersLogic struct {
  12. logx.Logger
  13. ctx context.Context
  14. svcCtx *svc.ServiceContext
  15. }
  16. func NewPerCenterComputerPowersLogic(ctx context.Context, svcCtx *svc.ServiceContext) *PerCenterComputerPowersLogic {
  17. return &PerCenterComputerPowersLogic{
  18. Logger: logx.WithContext(ctx),
  19. ctx: ctx,
  20. svcCtx: svcCtx,
  21. }
  22. }
  23. func (l *PerCenterComputerPowersLogic) PerCenterComputerPowers() (resp *types.PerCenterComputerPowersResp, err error) {
  24. resp = &types.PerCenterComputerPowersResp{}
  25. statusCode, body, err := httputils.HttpClientWithScreen(httputils.GET, "https://grampus.openi.org.cn/openapi/v1/sharescreen/computepower/percenter", strings.NewReader(``))
  26. if statusCode == 200 {
  27. json.Unmarshal(body, &resp.Chart)
  28. println(resp)
  29. } else if statusCode != 200 {
  30. return nil, err
  31. }
  32. return resp, nil
  33. }

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.