main.go 645 B

123456789101112131415161718192021222324252627282930313233
  1. package main
  2. import (
  3. "Ic_ouath/app"
  4. "Ic_ouath/global"
  5. "Ic_ouath/nats"
  6. "Ic_ouath/simple_zap"
  7. "context"
  8. )
  9. func init() {
  10. err := global.SetupDBLink()
  11. if err != nil {
  12. simple_zap.WithCtx(context.Background()).Sugar().Warn(err, "数据库连接失败")
  13. }
  14. global.SetupRedisLink()
  15. nats.SetupNats()
  16. }
  17. // @title 统一登录平台
  18. // @version 1.0
  19. // @description 统一登录平台
  20. // @Host 127.0.0.1:8080
  21. // @BasePath /api
  22. //
  23. //go:generate swag init --parseDependency --parseDepth=6
  24. func main() {
  25. err := app.InitRouter()
  26. if err != nil {
  27. simple_zap.WithCtx(context.Background()).Sugar().Warn(err, "项目初始化失败")
  28. return
  29. }
  30. }