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.

overviewlogic.go 1.0 kB

12345678910111213141516171819202122232425262728293031323334353637
  1. package hpc
  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 OverViewLogic struct {
  9. logx.Logger
  10. ctx context.Context
  11. svcCtx *svc.ServiceContext
  12. }
  13. func NewOverViewLogic(ctx context.Context, svcCtx *svc.ServiceContext) *OverViewLogic {
  14. return &OverViewLogic{
  15. Logger: logx.WithContext(ctx),
  16. ctx: ctx,
  17. svcCtx: svcCtx,
  18. }
  19. }
  20. func (l *OverViewLogic) OverView(req *types.HpcOverViewReq) (resp *types.HpcOverViewResp, err error) {
  21. var overView types.HPCOverView
  22. tx := l.svcCtx.DbEngin.Raw("SELECT count( DISTINCT a.id ) as adapter_count,count( DISTINCT label ) as stack_count,count( c.id ) as cluster_count,(select count(*) from task_hpc) as task_count FROM t_cluster c JOIN t_adapter a ON c.adapter_id = a.id AND a.type = 2 ").Scan(&overView)
  23. println(tx)
  24. resp = &types.HpcOverViewResp{
  25. Code: 200,
  26. Msg: "success",
  27. Data: overView,
  28. }
  29. return resp, nil
  30. }

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.