config.go 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. var (
  28. IndexName string
  29. )
  30. func init() {
  31. RunMode = beego.AppConfig.String("run_mode")
  32. config, err := beego.AppConfig.GetSection(RunMode)
  33. if err != nil {
  34. panic("配置文件读取错误 " + err.Error())
  35. }
  36. beego.Info(RunMode + " 模式")
  37. MYSQL_URL = config["mysql_url"]
  38. MYSQL_URL_RDDP = config["mysql_url_rddp"]
  39. MYSQL_URL_TACTICS = config["mysql_url_tactics"]
  40. if RunMode == "release" {
  41. WxAppId = "wxcc32b61f96720d2f"
  42. WxAppSecret = "06894933fafb24dafead7eaae09c08e0"
  43. WxId = "gh_a9d3744e1072"
  44. WxMsgTemplateIdApply = "PaoDanHGlt1kFw5q-4_ipJSwO3FyZpxSSNg4rwB7YCk"
  45. WxMsgTemplateIdApplyCancel = "iEi4YRHwcPbc2PSEF1pptc39H4NsAJPrUIPEk2ynwiA"
  46. WxMsgTemplateIdPermissionApply = "PaoDanHGlt1kFw5q-4_ipJSwO3FyZpxSSNg4rwB7YCk"
  47. WxPublicAppId = "wx4a844c734d8c8e56"
  48. WxPublicAppSecret = "26c586e7ccb3c575433f0f37797b3eeb"
  49. WxPublicId = "gh_b67e0049fb8c"
  50. IndexName="cygx_article"
  51. } else {
  52. WxAppId = "wxcc32b61f96720d2f"
  53. WxAppSecret = "06894933fafb24dafead7eaae09c08e0"
  54. WxId = "gh_a9d3744e1072"
  55. //模板消息ID
  56. WxMsgTemplateIdApply = "qfNuops-sKrfIkbA7U97A7gSrX03mUpoEpJksRUdloo"
  57. WxMsgTemplateIdApplyCancel = "UU_d7ks0XZBnWg2xFzxL9Heilm4kisX39K7dr4SDdO8"
  58. WxMsgTemplateIdPermissionApply = "qfNuops-sKrfIkbA7U97A7gSrX03mUpoEpJksRUdloo"
  59. WxPublicAppId = "wx9b5d7291e581233a"
  60. WxPublicAppSecret = "f4d52e34021eee262dce9682b31f8861"
  61. WxPublicId = "gh_5dc508325c6f"
  62. IndexName="test_article"
  63. }
  64. }
  65. //http://webapi.brilliantstart.cn/api/
  66. //http://webapi.brilliantstart.cn/swagger/
  67. //http://139.196.122.219:8603/swagger/