msgopenloglogic.go 920 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package logic
  2. import (
  3. service "app.yhyue.com/moapp/MessageCenter/rpc/internal/common"
  4. "context"
  5. "app.yhyue.com/moapp/MessageCenter/rpc/internal/svc"
  6. "app.yhyue.com/moapp/MessageCenter/rpc/type/message"
  7. "github.com/zeromicro/go-zero/core/logx"
  8. )
  9. type MsgOpenLogLogic struct {
  10. ctx context.Context
  11. svcCtx *svc.ServiceContext
  12. logx.Logger
  13. }
  14. func NewMsgOpenLogLogic(ctx context.Context, svcCtx *svc.ServiceContext) *MsgOpenLogLogic {
  15. return &MsgOpenLogLogic{
  16. ctx: ctx,
  17. svcCtx: svcCtx,
  18. Logger: logx.WithContext(ctx),
  19. }
  20. }
  21. // 点击消息-存查看记录
  22. func (l *MsgOpenLogLogic) MsgOpenLog(in *message.MsgOpenLogReq) (*message.Response, error) {
  23. m := service.MessageService{}
  24. err := m.MsgOpenLog(in.Platform, in.MsgLogId, in.UserId)
  25. code := 0
  26. msg := "保存成功"
  27. if err != nil {
  28. code = 1
  29. msg = err.Error()
  30. }
  31. return &message.Response{
  32. Code: int64(code),
  33. Message: msg,
  34. }, nil
  35. }