updatereadbyidlogic.go 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package logic
  2. import (
  3. util "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/entity"
  4. "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/internal/svc"
  5. "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/rpc/messagecenter/messagecenter"
  6. "bp.jydev.jianyu360.cn/SocialPlatform/messageCenter/service"
  7. "context"
  8. "github.com/zeromicro/go-zero/core/logx"
  9. )
  10. type UpdateReadByIdLogic struct {
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. logx.Logger
  14. }
  15. func NewUpdateReadByIdLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateReadByIdLogic {
  16. return &UpdateReadByIdLogic{
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. Logger: logx.WithContext(ctx),
  20. }
  21. }
  22. // 根据消息修改已读状态
  23. func (l *UpdateReadByIdLogic) UpdateReadById(in *messagecenter.ReadStateReq) (*messagecenter.CurrencyResp, error) {
  24. // todo: add your logic here and delete this line
  25. m := service.MessaggeService{}
  26. m.UpdateReadById(in)
  27. error_message := ""
  28. error_code := util.SUCCESS_CODE
  29. return &messagecenter.CurrencyResp{
  30. ErrorCode: error_code,
  31. ErrorMsg: error_message,
  32. }, nil
  33. }