updatemsgsummarylogic.go 998 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package logic
  2. import (
  3. "app.yhyue.com/moapp/MessageCenter/rpc/messageclient"
  4. "context"
  5. "app.yhyue.com/moapp/MessageCenter/api/internal/svc"
  6. "app.yhyue.com/moapp/MessageCenter/api/internal/types"
  7. "github.com/zeromicro/go-zero/core/logx"
  8. )
  9. type UpdateMsgSummaryLogic struct {
  10. logx.Logger
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. }
  14. func NewUpdateMsgSummaryLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateMsgSummaryLogic {
  15. return &UpdateMsgSummaryLogic{
  16. Logger: logx.WithContext(ctx),
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. }
  20. }
  21. func (l *UpdateMsgSummaryLogic) UpdateMsgSummary(req *types.UpdateMsgSummaryReq) (resp *types.Response, err error) {
  22. resp = new(types.Response)
  23. lsi := l.svcCtx.MessageCenter
  24. res, err := lsi.UpdateMsgSummary(l.ctx, &messageclient.UpdateMsgSummaryReq{
  25. MsgLogId: req.MsgLogId,
  26. GroupId: req.GroupId,
  27. MsgType: req.MsgType,
  28. })
  29. if err != nil {
  30. resp.Code = 1
  31. }
  32. resp.Code = res.Code
  33. resp.Message = res.Message
  34. return resp, nil
  35. }