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.

49 lines
1.4 KiB

3 years ago
3 years ago
3 years ago
4 years ago
3 years ago
  1. package core
  2. import (
  3. "fmt"
  4. "time"
  5. "github.com/flipped-aurora/gin-vue-admin/server/global"
  6. "github.com/flipped-aurora/gin-vue-admin/server/initialize"
  7. "github.com/flipped-aurora/gin-vue-admin/server/service/system"
  8. "go.uber.org/zap"
  9. )
  10. type server interface {
  11. ListenAndServe() error
  12. }
  13. func RunWindowsServer() {
  14. if global.GVA_CONFIG.System.UseMultipoint {
  15. // 初始化redis服务
  16. initialize.Redis()
  17. }
  18. // 从db加载jwt数据
  19. if global.GVA_DB != nil {
  20. system.LoadAll()
  21. }
  22. Router := initialize.Routers()
  23. Router.Static("/form-generator", "./resource/page")
  24. address := fmt.Sprintf(":%d", global.GVA_CONFIG.System.Addr)
  25. s := initServer(address, Router)
  26. // 保证文本顺序输出
  27. // In order to ensure that the text order output can be deleted
  28. time.Sleep(10 * time.Microsecond)
  29. global.GVA_LOG.Info("server run success on ", zap.String("address", address))
  30. fmt.Printf(`
  31. 欢迎使用 github.com/flipped-aurora/yibu/server
  32. 当前版本:V2.5.0 beta
  33. 加群方式:微信号shouzi_1994 QQ群622360840
  34. GVA讨论社区:https://support.qq.com/products/371961
  35. 默认自动化文档地址:http://127.0.0.1%s/swagger/index.html
  36. 默认前端文件运行地址:http://127.0.0.1:8080
  37. 如果项目让您获得了收益希望您能请团队喝杯可乐:https://www.github.com/flipped-aurora/yibu/server.com/docs/coffee
  38. `, address)
  39. global.GVA_LOG.Error(s.ListenAndServe().Error())
  40. }