notfound.go 706 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. package callback
  2. import (
  3. "net/http"
  4. "bet24.com/log"
  5. "github.com/gin-gonic/gin"
  6. )
  7. // 404错误
  8. func NotFoundRoute(c *gin.Context) {
  9. _ = c.Request.ParseForm()
  10. log.Debug("%v %v not found route ip[%v]",
  11. c.Request.URL.Path, c.Request.Form, c.Request.RemoteAddr)
  12. c.JSON(http.StatusNotFound, struct {
  13. RetCode int
  14. ErrorMsg string
  15. }{
  16. RetCode: -1,
  17. ErrorMsg: "Not Found Page (404)",
  18. })
  19. }
  20. func NotFoundMethod(c *gin.Context) {
  21. _ = c.Request.ParseForm()
  22. log.Debug("%v %v not found route ip[%v]",
  23. c.Request.URL.Path, c.Request.Form, c.Request.RemoteAddr)
  24. c.JSON(http.StatusNotFound, struct {
  25. RetCode int
  26. ErrorMsg string
  27. }{
  28. RetCode: -1,
  29. ErrorMsg: "Not Found Page (404)",
  30. })
  31. }