http.go 489 B

123456789101112131415161718192021222324252627282930
  1. package http
  2. import (
  3. "go-common/app/job/main/ugcpay/conf"
  4. "go-common/app/job/main/ugcpay/service"
  5. "go-common/library/log"
  6. bm "go-common/library/net/http/blademaster"
  7. )
  8. var (
  9. srv *service.Service
  10. )
  11. // Init init
  12. func Init(s *service.Service) {
  13. srv = s
  14. engine := bm.DefaultServer(conf.Conf.BM)
  15. route(engine)
  16. if err := engine.Start(); err != nil {
  17. log.Error("bm Start error(%+v)", err)
  18. panic(err)
  19. }
  20. }
  21. func route(e *bm.Engine) {
  22. e.Ping(ping)
  23. }
  24. func ping(c *bm.Context) {
  25. }