config.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. package utils
  2. import (
  3. "github.com/astaxie/beego"
  4. )
  5. var (
  6. RunMode string //运行模式
  7. MYSQL_URL string //数据库连接
  8. MYSQL_URL_RDDP string //数据库连接
  9. MYSQL_URL_EDB string
  10. )
  11. var (
  12. CompanyId int
  13. )
  14. var (
  15. WxAppId string
  16. WxAppSecret string
  17. TemplateId string
  18. )
  19. func init() {
  20. RunMode = beego.AppConfig.String("run_mode")
  21. config, err := beego.AppConfig.GetSection(RunMode)
  22. if err != nil {
  23. panic("配置文件读取错误 " + err.Error())
  24. }
  25. beego.Info(RunMode + " 模式")
  26. MYSQL_URL = config["mysql_url"]
  27. MYSQL_URL_RDDP = config["mysql_url_rddp"]
  28. MYSQL_URL_EDB = config["mysql_url_edb"]
  29. if RunMode == "release" {
  30. CompanyId = 16
  31. WxAppId = "wx4a844c734d8c8e56"
  32. WxAppSecret = "26c586e7ccb3c575433f0f37797b3eeb"
  33. TemplateId = "P0klzaZjEI2UYth-z-WnmtOQgyxcF8klPoA_MlsA8Eo"
  34. } else {
  35. CompanyId = 16
  36. WxAppId = "wx9b5d7291e581233a"
  37. WxAppSecret = "f4d52e34021eee262dce9682b31f8861"
  38. TemplateId = "P0klzaZjEI2UYth-z-WnmtOQgyxcF8klPoA_MlsA8Eo"
  39. }
  40. }
  41. //http://entryapi.brilliantstart.cn
  42. //http://entryapi.brilliantstart.cn/swagger/