bitmapsavemsglogic.go 950 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. "github.com/zeromicro/go-zero/core/logx"
  8. )
  9. type BitmapSaveMsgLogic struct {
  10. ctx context.Context
  11. svcCtx *svc.ServiceContext
  12. logx.Logger
  13. }
  14. func NewBitmapSaveMsgLogic(ctx context.Context, svcCtx *svc.ServiceContext) *BitmapSaveMsgLogic {
  15. return &BitmapSaveMsgLogic{
  16. ctx: ctx,
  17. svcCtx: svcCtx,
  18. Logger: logx.WithContext(ctx),
  19. }
  20. }
  21. // BitmapSaveMsg bitmap发送消息
  22. func (l *BitmapSaveMsgLogic) BitmapSaveMsg(in *messageclient.MultipleSaveMsgReq) (*messageclient.MultipleSaveMsgResp, error) {
  23. var (
  24. code = 1
  25. msg = "发送成功"
  26. )
  27. err := service.UpdateUserMsgSummary(in)
  28. if err != nil {
  29. code = 0
  30. msg = err.Error()
  31. }
  32. return &messageclient.MultipleSaveMsgResp{
  33. Code: int64(code),
  34. Message: msg,
  35. }, nil
  36. }