package logic import ( quitl "app.yhyue.com/moapp/jybase/common" "app.yhyue.com/moapp/jybase/encrypt" "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/messagecenter" "context" "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/api/messagecenter/internal/svc" "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/api/messagecenter/internal/types" "github.com/zeromicro/go-zero/core/logx" ) type GroupNoticeAddLogic struct { logx.Logger ctx context.Context svcCtx *svc.ServiceContext } func NewGroupNoticeAddLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GroupNoticeAddLogic { return &GroupNoticeAddLogic{ Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx, } } func (l *GroupNoticeAddLogic) GroupNoticeAdd(req *types.GroupNoticeAddReq) (resp *types.CommonRes, err error) { // todo: add your logic here and delete this line chatGroupId := quitl.Int64All(encrypt.SE.Decode4Hex(req.ChatGroupId)) result, err := l.svcCtx.Message.GroupNoticeAdd(l.ctx, &messagecenter.GroupNoticeAddReq{ AppId: req.Appid, Content: req.Content, ChatGroupId: chatGroupId, }) if err != nil { return nil, err } return &types.CommonRes{ Error_msg: result.ErrorMsg, Error_code: int(result.ErrorCode), Data: map[string]interface{}{ "status": result.Status, }, }, nil }