groupnoticegetlogic.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package logic
  2. import (
  3. quitl "app.yhyue.com/moapp/jybase/common"
  4. "app.yhyue.com/moapp/jybase/encrypt"
  5. "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/messagecenter"
  6. "context"
  7. "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/api/messagecenter/internal/svc"
  8. "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/api/messagecenter/internal/types"
  9. "github.com/zeromicro/go-zero/core/logx"
  10. )
  11. type GroupNoticeGetLogic struct {
  12. logx.Logger
  13. ctx context.Context
  14. svcCtx *svc.ServiceContext
  15. }
  16. func NewGroupNoticeGetLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GroupNoticeGetLogic {
  17. return &GroupNoticeGetLogic{
  18. Logger: logx.WithContext(ctx),
  19. ctx: ctx,
  20. svcCtx: svcCtx,
  21. }
  22. }
  23. func (l *GroupNoticeGetLogic) GroupNoticeGet(req *types.ChatGroupPersonReq) (resp *types.CommonRes, err error) {
  24. // todo: add your logic here and delete this line
  25. chatGroupId := quitl.Int64All(encrypt.SE.Decode4Hex(req.ChatGroupId))
  26. result, err := l.svcCtx.Message.GroupNoticeGet(l.ctx, &messagecenter.ChatGroupPersonReq{
  27. AppId: req.Appid,
  28. ChatGroupId: chatGroupId,
  29. })
  30. if err != nil {
  31. return nil, err
  32. }
  33. return &types.CommonRes{
  34. Error_msg: result.ErrorMsg,
  35. Error_code: int(result.ErrorCode),
  36. Data: result.Data,
  37. }, nil
  38. return
  39. }