main.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * @Descripttion:
  3. * @version:
  4. * @Author: Neo,Huang
  5. * @Date: 2020-12-16 11:22:56
  6. * @LastEditors: Neo,Huang
  7. * @LastEditTime: 2022-04-27 20:20:13
  8. */
  9. package main
  10. import (
  11. "net/http"
  12. "github.com/astaxie/beego"
  13. "github.com/drone/routes"
  14. "box-3rdServer/nppa"
  15. "box-3rdServer/sensitive"
  16. "box-3rdServer/utils"
  17. )
  18. func main() {
  19. utils.InitProject()
  20. utils.InitRedis()
  21. mux := routes.New()
  22. // 敏感词
  23. sensitive.Init()
  24. mux.Get("/sensitive/checkword", sensitive.HttpCheckWord)
  25. mux.Post("/sensitive/checkword", sensitive.HttpCheckWord)
  26. mux.Get("/sensitive/changeword", sensitive.HttpChangeWord)
  27. mux.Post("/sensitive/changeword", sensitive.HttpChangeWord)
  28. // 实名认证
  29. if nppa.IsModule() {
  30. nppa.Init()
  31. mux.Get("/nppa/check_id", nppa.HttpCheckPlayerID)
  32. mux.Post("/nppa/check_id", nppa.HttpCheckPlayerID)
  33. mux.Get("/nppa/query_id", nppa.HttpQueryPlayerID)
  34. mux.Post("/nppa/query_id", nppa.HttpQueryPlayerID)
  35. mux.Get("/nppa/loginout", nppa.HttpLoginout)
  36. mux.Post("/nppa/loginout", nppa.HttpLoginout)
  37. mux.Get("/nppa/test_check_id", nppa.HttpTestCheckPlayerID)
  38. mux.Get("/nppa/test_query_id", nppa.HttpTestQueryPlayerID)
  39. mux.Get("/nppa/test_loginout", nppa.HttpTestLoginout)
  40. }
  41. http.Handle("/", mux)
  42. http.ListenAndServe(":"+beego.AppConfig.String("httpport"), nil)
  43. }