config.go 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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_TACTICS string
  10. )
  11. //微信配置信息
  12. var (
  13. WxId string //微信原始ID
  14. WxAppId string
  15. WxAppSecret string
  16. WxMsgTemplateIdApply string //申请待处理
  17. WxMsgTemplateIdApplyCancel string //预约取消提醒
  18. WxMsgTemplateIdPermissionApply string //预约取消提醒
  19. )
  20. //微信公众号配置信息
  21. var (
  22. WxPublicId string //微信原始ID
  23. WxPublicAppId string
  24. WxPublicAppSecret string
  25. WxPlatform = 4 //注册平台,1:日度点评公众号,2:管理后台,3:pc端网站,4:查研观向小程序
  26. )
  27. func init() {
  28. RunMode = beego.AppConfig.String("run_mode")
  29. config, err := beego.AppConfig.GetSection(RunMode)
  30. if err != nil {
  31. panic("配置文件读取错误 " + err.Error())
  32. }
  33. beego.Info(RunMode + " 模式")
  34. MYSQL_URL = config["mysql_url"]
  35. MYSQL_URL_RDDP = config["mysql_url_rddp"]
  36. MYSQL_URL_TACTICS = config["mysql_url_tactics"]
  37. if RunMode == "release" {
  38. WxAppId = "wxcc32b61f96720d2f"
  39. WxAppSecret = "06894933fafb24dafead7eaae09c08e0"
  40. WxId = "gh_a9d3744e1072"
  41. WxPublicAppId = "wx4a844c734d8c8e56"
  42. WxPublicAppSecret = "26c586e7ccb3c575433f0f37797b3eeb"
  43. WxPublicId = "gh_b67e0049fb8c"
  44. } else {
  45. WxAppId = "wxcc32b61f96720d2f"
  46. WxAppSecret = "06894933fafb24dafead7eaae09c08e0"
  47. WxId = "gh_a9d3744e1072"
  48. WxMsgTemplateIdApply = "qfNuops-sKrfIkbA7U97A7gSrX03mUpoEpJksRUdloo"
  49. WxMsgTemplateIdApplyCancel = "UU_d7ks0XZBnWg2xFzxL9Heilm4kisX39K7dr4SDdO8"
  50. WxMsgTemplateIdPermissionApply = "qfNuops-sKrfIkbA7U97A7gSrX03mUpoEpJksRUdloo"
  51. WxPublicAppId = "wx9b5d7291e581233a"
  52. WxPublicAppSecret = "f4d52e34021eee262dce9682b31f8861"
  53. WxPublicId = "gh_5dc508325c6f"
  54. }
  55. }
  56. //http://webapi.brilliantstart.cn/api/
  57. //http://webapi.brilliantstart.cn/swagger/
  58. //http://139.196.122.219:8603/swagger/