log.go 818 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package service
  2. import (
  3. "strings"
  4. "time"
  5. smsmdl "go-common/app/service/main/sms/model"
  6. "go-common/library/log"
  7. "go-common/library/queue/databus/report"
  8. )
  9. const (
  10. _reportType = 111
  11. )
  12. func (s *Service) sendUserActionLog(l *smsmdl.ModelUserActionLog) {
  13. if l.Mobile == "" {
  14. log.Warn("sendUserActionLog mobile is empty, log(%+v)", l)
  15. return
  16. }
  17. for _, mobile := range strings.Split(l.Mobile, ",") {
  18. r := &report.UserInfo{
  19. Business: _reportType,
  20. Ctime: time.Unix(l.Ts, 0),
  21. Index: []interface{}{mobile},
  22. Content: map[string]interface{}{
  23. "msgid": l.MsgID,
  24. "content": l.Content,
  25. "status": l.Status,
  26. "desc": l.Desc,
  27. "provider": l.Provider,
  28. "type": l.Type,
  29. "action": l.Action,
  30. },
  31. }
  32. log.Info("sendUserActionLog(%+v)", r)
  33. report.User(r)
  34. }
  35. }