main.go 468 B

1234567891011121314151617181920212223242526
  1. package main
  2. import (
  3. "github.com/gin-gonic/gin"
  4. "iot_manager_service/app/dao"
  5. "iot_manager_service/app/utils"
  6. "iot_manager_service/config"
  7. _ "iot_manager_service/config"
  8. "iot_manager_service/router"
  9. )
  10. func main() {
  11. // 开始调试模式
  12. gin.SetMode("debug")
  13. // 实例化配置
  14. dao.InitDB()
  15. err := utils.InitRedis()
  16. if err != nil {
  17. panic(err)
  18. }
  19. engine := gin.Default()
  20. router.InitRouter(engine)
  21. _ = engine.Run(config.Instance().Server.Address)
  22. }