工具
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
981 B

4 years ago
  1. package main
  2. import (
  3. "fmt"
  4. "git.ouxuan.net/hasaki-service/hasaki-sdk/hskconfig"
  5. "git.ouxuan.net/hasaki-service/hasaki-sdk/hskgin"
  6. "git.ouxuan.net/hasaki-service/hasaki-service-stadium-core/hasaki_stadium_core"
  7. "git.ouxuan.net/hasaki-service/hasaki-service-stadium-core/hasaki_stadium_core_event"
  8. "git.ouxuan.net/hasaki-service/hasaki-service-{{.app_name}}/hasaki_{{.app_name}}"
  9. "git.ouxuan.net/hasaki-service/hasaki-service-{{.app_name}}/hasaki_{{.app_name}}_options"
  10. "github.com/gin-gonic/gin"
  11. )
  12. func main() {
  13. hskconfig.SetGolbalConfigFileName(`./config.json`)
  14. config := hskconfig.GetGlobalConfigInstance()
  15. router := hskgin.NewGinHelper(gin.Default())
  16. hasaki_{{.app_name}}_options.GetMysqlConfig = hasaki_stadium_core.GetMysqlConfig
  17. hasaki_stadium_core_event.Initialize(true)
  18. hasaki_{{.app_name}}.AdminInitialize(router)
  19. hasaki_{{.app_name}}.Initialize(router)
  20. err := router.Run(fmt.Sprintf("%s:%d", config.Addr, config.Port))
  21. if err != nil {
  22. panic(err)
  23. }
  24. }