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.

getparticipantslogic.go 1.2 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package storelink
  2. import (
  3. "context"
  4. "github.com/zeromicro/go-zero/core/logx"
  5. "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/storeLink"
  6. "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
  7. "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
  8. )
  9. type GetParticipantsLogic struct {
  10. logx.Logger
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. }
  14. func NewGetParticipantsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetParticipantsLogic {
  15. return &GetParticipantsLogic{
  16. Logger: logx.WithContext(ctx),
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. }
  20. }
  21. func (l *GetParticipantsLogic) GetParticipants(req *types.GetParticipantsReq) (resp *types.GetParticipantsResp, err error) {
  22. participants := storeLink.GetParticipants(l.svcCtx.DbEngin)
  23. resp = &types.GetParticipantsResp{}
  24. if participants == nil {
  25. resp.Success = false
  26. resp.Participants = nil
  27. return resp, nil
  28. }
  29. for _, participant := range participants {
  30. var p types.ParticipantSl
  31. p.ParticipantId = participant.Id
  32. p.ParticipantType = storeLink.AITYPE[participant.Type]
  33. p.ParticipantName = participant.Name
  34. resp.Participants = append(resp.Participants, &p)
  35. }
  36. resp.Success = true
  37. return resp, nil
  38. }

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.