config.go 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. //微信配置信息
  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. )
  26. func init() {
  27. RunMode = beego.AppConfig.String("run_mode")
  28. config, err := beego.AppConfig.GetSection(RunMode)
  29. if err != nil {
  30. panic("配置文件读取错误 " + err.Error())
  31. }
  32. beego.Info(RunMode + " 模式")
  33. MYSQL_URL = config["mysql_url"]
  34. MYSQL_URL_RDDP = config["mysql_url_rddp"]
  35. MYSQL_URL_EDB = config["mysql_url_edb"]
  36. if RunMode == "release" {
  37. WxAppId = "wxcc32b61f96720d2f"
  38. WxAppSecret = "06894933fafb24dafead7eaae09c08e0"
  39. WxId = "gh_a9d3744e1072"
  40. WxPublicAppId = "wx4a844c734d8c8e56"
  41. WxPublicAppSecret = "26c586e7ccb3c575433f0f37797b3eeb"
  42. WxPublicId = "gh_b67e0049fb8c"
  43. } else {
  44. WxAppId = "wxcc32b61f96720d2f"
  45. WxAppSecret = "06894933fafb24dafead7eaae09c08e0"
  46. WxId = "gh_a9d3744e1072"
  47. WxMsgTemplateIdApply = "qfNuops-sKrfIkbA7U97A7gSrX03mUpoEpJksRUdloo"
  48. WxMsgTemplateIdApplyCancel = "UU_d7ks0XZBnWg2xFzxL9Heilm4kisX39K7dr4SDdO8"
  49. WxMsgTemplateIdPermissionApply = "qfNuops-sKrfIkbA7U97A7gSrX03mUpoEpJksRUdloo"
  50. WxPublicAppId = "wx9b5d7291e581233a"
  51. WxPublicAppSecret = "f4d52e34021eee262dce9682b31f8861"
  52. WxPublicId = "gh_5dc508325c6f"
  53. }
  54. }
  55. //http://webapi.brilliantstart.cn/api/
  56. //http://webapi.brilliantstart.cn/swagger/
  57. //http://139.196.122.219:8603/swagger/