updatemsgsummarylogic.go 1022 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package logic
  2. import (
  3. service "app.yhyue.com/moapp/MessageCenter/rpc/internal/common"
  4. "app.yhyue.com/moapp/MessageCenter/rpc/messageclient"
  5. "context"
  6. "app.yhyue.com/moapp/MessageCenter/rpc/internal/svc"
  7. "app.yhyue.com/moapp/MessageCenter/rpc/type/message"
  8. "github.com/zeromicro/go-zero/core/logx"
  9. )
  10. type UpdateMsgSummaryLogic struct {
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. logx.Logger
  14. }
  15. func NewUpdateMsgSummaryLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateMsgSummaryLogic {
  16. return &UpdateMsgSummaryLogic{
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. Logger: logx.WithContext(ctx),
  20. }
  21. }
  22. // 发送消息更新一次消息汇总表
  23. func (l *UpdateMsgSummaryLogic) UpdateMsgSummary(in *messageclient.UpdateMsgSummaryReq) (*messageclient.Response, error) {
  24. var (
  25. code = 1
  26. msg = "成功"
  27. )
  28. err := service.SetMsgSummary(in.MsgLogId, in.GroupId, in.MsgType)
  29. if err != nil {
  30. code = 0
  31. msg = err.Error()
  32. }
  33. return &message.Response{
  34. Code: int64(code),
  35. Message: msg,
  36. }, nil
  37. }