|
- package storelink
-
- import (
- "context"
- "github.com/zeromicro/go-zero/core/logx"
- "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/storeLink"
- "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc"
- "gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/types"
- )
-
- type GetParticipantsLogic struct {
- logx.Logger
- ctx context.Context
- svcCtx *svc.ServiceContext
- }
-
- func NewGetParticipantsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetParticipantsLogic {
- return &GetParticipantsLogic{
- Logger: logx.WithContext(ctx),
- ctx: ctx,
- svcCtx: svcCtx,
- }
- }
-
- func (l *GetParticipantsLogic) GetParticipants(req *types.GetParticipantsReq) (resp *types.GetParticipantsResp, err error) {
- participants := storeLink.GetParticipants(l.svcCtx.DbEngin)
- resp = &types.GetParticipantsResp{}
-
- if participants == nil {
- resp.Success = false
- resp.Participants = nil
- return resp, nil
- }
-
- for _, participant := range participants {
- var p types.ParticipantSl
- p.ParticipantId = participant.Id
- p.ParticipantType = storeLink.AITYPE[participant.Type]
- p.ParticipantName = participant.Name
- resp.Participants = append(resp.Participants, &p)
- }
-
- resp.Success = true
- return resp, nil
-
- }
|