sendusermsglogic.go 797 B

12345678910111213141516171819202122232425262728293031323334
  1. package logic
  2. import (
  3. "context"
  4. "app.yhyue.com/moapp/MessageCenter/rpc/internal/svc"
  5. "app.yhyue.com/moapp/MessageCenter/rpc/message"
  6. "app.yhyue.com/moapp/MessageCenter/service"
  7. "github.com/tal-tech/go-zero/core/logx"
  8. )
  9. type SendUserMsgLogic struct {
  10. ctx context.Context
  11. svcCtx *svc.ServiceContext
  12. logx.Logger
  13. }
  14. func NewSendUserMsgLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SendUserMsgLogic {
  15. return &SendUserMsgLogic{
  16. ctx: ctx,
  17. svcCtx: svcCtx,
  18. Logger: logx.WithContext(ctx),
  19. }
  20. }
  21. // 指定用户发消息
  22. func (l *SendUserMsgLogic) SendUserMsg(in *message.SendMsgRequest) (*message.Response, error) {
  23. // todo: add your logic here and delete this line
  24. code, msg := service.SendMsg(*in)
  25. return &message.Response{
  26. Code: code,
  27. Message: msg,
  28. }, nil
  29. }