groupnoticegetlogic.go 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. package logic
  2. import (
  3. "app.yhyue.com/moapp/jybase/common"
  4. "app.yhyue.com/moapp/jybase/encrypt"
  5. "context"
  6. "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/internal/svc"
  7. "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/messagecenter"
  8. "github.com/zeromicro/go-zero/core/logx"
  9. )
  10. type GroupNoticeGetLogic struct {
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. logx.Logger
  14. }
  15. func NewGroupNoticeGetLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GroupNoticeGetLogic {
  16. return &GroupNoticeGetLogic{
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. Logger: logx.WithContext(ctx),
  20. }
  21. }
  22. // 群任务详情
  23. func (l *GroupNoticeGetLogic) GroupNoticeGet(in *messagecenter.ChatGroupPersonReq) (*messagecenter.GroupNoticeGetResp, error) {
  24. // todo: add your logic here and delete this line
  25. data := ChatGroup.GroupNoticeGet(in.ChatGroupId, in.AppId)
  26. groupNotice := messagecenter.GroupNotice{}
  27. if data != nil {
  28. groupNoticeId := encrypt.SE.Encode2Hex(common.InterfaceToStr(data["id"]))
  29. groupNotice.GroupNoticeId = groupNoticeId
  30. groupNotice.Content = common.ObjToString(data["content"])
  31. }
  32. return &messagecenter.GroupNoticeGetResp{
  33. ErrorCode: 0,
  34. Data: &groupNotice,
  35. }, nil
  36. }