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.

queueassetslogic.go 1.1 kB

12345678910111213141516171819202122232425262728293031323334
  1. package hpc
  2. import (
  3. "context"
  4. "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
  5. "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
  6. "github.com/zeromicro/go-zero/core/logx"
  7. )
  8. type QueueAssetsLogic struct {
  9. logx.Logger
  10. ctx context.Context
  11. svcCtx *svc.ServiceContext
  12. }
  13. func NewQueueAssetsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *QueueAssetsLogic {
  14. return &QueueAssetsLogic{
  15. Logger: logx.WithContext(ctx),
  16. ctx: ctx,
  17. svcCtx: svcCtx,
  18. }
  19. }
  20. func (l *QueueAssetsLogic) QueueAssets() (resp *types.QueueAssetsResp, err error) {
  21. // 查询数据库队列资源信息
  22. var queueAssetsResp types.QueueAssetsResp
  23. tx := l.svcCtx.DbEngin.Raw("SELECT qpi.*,ti.tenant_name FROM sc_queue_phy_info qpi left join sc_participant_phy_info ppi on ppi.id = qpi.participant_id left JOIN sc_tenant_info ti on ti.id = ppi.tenant_id WHERE qpi.created_time IN ( SELECT MAX( created_time ) FROM sc_queue_phy_info WHERE deleted_flag = 0 GROUP BY participant_id, queue_name ) ").Scan(&queueAssetsResp.QueueAssets)
  24. if tx.Error != nil {
  25. logx.Error(err)
  26. return nil, tx.Error
  27. }
  28. return &queueAssetsResp, nil
  29. }

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.