dataflow.go 723 B

1234567891011121314151617181920212223242526272829303132
  1. package http
  2. import (
  3. "strconv"
  4. "time"
  5. "go-common/library/ecode"
  6. bm "go-common/library/net/http/blademaster"
  7. )
  8. // reportInfoc infoc
  9. func reportInfoc(c *bm.Context) {
  10. var (
  11. params = c.Request.Form
  12. err error
  13. )
  14. eventID := params.Get("event_id")
  15. eventType := params.Get("event_type")
  16. // header
  17. buvid := params.Get("buvid")
  18. fts := params.Get("fts")
  19. if _, err = strconv.ParseInt(fts, 10, 64); err != nil {
  20. c.JSON(nil, ecode.RequestErr)
  21. return
  22. }
  23. messageInfo := params.Get("message_info")
  24. if eventID == "" || eventType == "" || buvid == "" || messageInfo == "" {
  25. c.JSON(nil, ecode.RequestErr)
  26. return
  27. }
  28. c.JSON(nil, dataflowSvr.Report(c, eventID, eventType, buvid, fts, messageInfo, time.Now()))
  29. }