config.go 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. package utils
  2. import (
  3. "fmt"
  4. beego "github.com/beego/beego/v2/adapter"
  5. "rdluck_tools/cache"
  6. )
  7. var (
  8. RunMode string //运行模式
  9. MYSQL_URL string //数据库连接
  10. MYSQL_URL_RDDP string //数据库连接
  11. MYSQL_URL_TACTICS string
  12. REDIS_CACHE string //缓存地址
  13. Rc *cache.Cache //redis缓存
  14. Re error //redis错误
  15. )
  16. //微信配置信息
  17. var (
  18. WxId string //微信原始ID
  19. WxAppId string //查研观向小程序
  20. WxAppSecret string //查研观向小程序
  21. WxAppIdXzs string //查研观向小助手公众号
  22. WxAppSecretXzs string //查研观向小助手公众号
  23. WxMsgTemplateIdApply string //申请待处理
  24. WxMsgTemplateIdApplyCancel string //预约取消提醒
  25. WxMsgTemplateIdPermissionApply string //预约取消提醒
  26. WxMsgTemplateIdActivityApply string //活动预约消息提醒
  27. WxMsgTemplateIdActivityChange string //活动预约变更提醒
  28. WxMsgTemplateIdAskMsg string //手机号用户【XXX】发送模板消息模板ID
  29. WxMsgTemplateIdAskMsgMobile string //手机号用户【XXX】发送模板消息
  30. WxMsgTemplateIdAskMsgMobileAll string //手机号用户【XXX】发送模板消息
  31. )
  32. //微信公众号配置信息
  33. var (
  34. WxPublicId string //微信原始ID
  35. WxPublicAppId string
  36. WxPublicAppSecret string
  37. WxPlatform = 4 //注册平台,1:日度点评公众号,2:管理后台,3:pc端网站,4:查研观向小程序
  38. )
  39. var (
  40. IndexName string
  41. OnlineTime string
  42. SummaryArticleId int
  43. EmailTechnology string //科技行业专家邮箱
  44. EmailMedicine string //医药行业专家邮箱
  45. EmailConsumption string //消费行业专家邮箱
  46. EmailZhizao string //智造行业专家邮箱
  47. EmailStrategy string //策略行业专家邮箱
  48. EmaiWhiteUserList string //白名单邮箱
  49. )
  50. func init() {
  51. RunMode = beego.AppConfig.String("run_mode")
  52. config, err := beego.AppConfig.GetSection(RunMode)
  53. if err != nil {
  54. panic("配置文件读取错误 " + err.Error())
  55. }
  56. beego.Info(RunMode + " 模式")
  57. MYSQL_URL = config["mysql_url"]
  58. MYSQL_URL_RDDP = config["mysql_url_rddp"]
  59. MYSQL_URL_TACTICS = config["mysql_url_tactics"]
  60. REDIS_CACHE = config["beego_cache"]
  61. if len(REDIS_CACHE) <= 0 {
  62. panic("redis链接参数没有配置")
  63. }
  64. Rc, Re = cache.NewCache(REDIS_CACHE) //初始化缓存
  65. if Re != nil {
  66. fmt.Println(Re)
  67. panic(Re)
  68. }
  69. WxAppIdXzs = "wxb7cb8a15abad5b8e" //查研观向小助手
  70. WxAppSecretXzs = "4dd35cd1598b27bd1dc9a3b299b289fa" //查研观向小助手
  71. OnlineTime = "2021-06-01 00:00:01" //上线时间
  72. SummaryArticleId = 1000000 //手动添加的纪要库开始ID
  73. WxMsgTemplateIdAskMsgMobileAll = "15557270714,18767183922,18621268829"
  74. if RunMode == "release" {
  75. WxAppId = "wxcc32b61f96720d2f"
  76. WxAppSecret = "06894933fafb24dafead7eaae09c08e0"
  77. WxId = "gh_a9d3744e1072"
  78. //模板消息ID
  79. WxMsgTemplateIdApply = "PaoDanHGlt1kFw5q-4_ipJSwO3FyZpxSSNg4rwB7YCk"
  80. WxMsgTemplateIdApplyCancel = "iEi4YRHwcPbc2PSEF1pptc39H4NsAJPrUIPEk2ynwiA"
  81. WxMsgTemplateIdPermissionApply = "PaoDanHGlt1kFw5q-4_ipJSwO3FyZpxSSNg4rwB7YCk"
  82. WxMsgTemplateIdActivityApply = "MwZ5wxfd0O1Yt0Pkf6OkfWP4USQzZbiEo5SkZ26735s"
  83. WxPublicAppId = "wx4a844c734d8c8e56"
  84. WxPublicAppSecret = "26c586e7ccb3c575433f0f37797b3eeb"
  85. WxPublicId = "gh_b67e0049fb8c"
  86. IndexName = "cygx_article_v0906"
  87. //接收附件邮箱
  88. EmailTechnology = "mlluo@hzinsights.com;jxu@hzinsights.com;agne@hzinsights.com;tshen@hzinsights.com;cxzhang@hzinsights.com;jhwang@hzinsights.com" //科技行业专家邮箱
  89. EmailMedicine = "xlzheng@hzinsights.com;tshen@hzinsights.com;cxzhang@hzinsights.com;jhwang@hzinsights.com" //医药行业专家邮箱
  90. EmailConsumption = "yrhuang@hzinsights.com;tshen@hzinsights.com;cxzhang@hzinsights.com;jhwang@hzinsights.com" //消费行业专家邮箱
  91. EmailZhizao = "xfma@hzinsights.com;agne@hzinsights.com;tshen@hzinsights.com;cxzhang@hzinsights.com;jhwang@hzinsights.com" //智造行业专家邮箱
  92. EmailStrategy = "xfma@hzinsights.com;tshen@hzinsights.com;cxzhang@hzinsights.com;jhwang@hzinsights.com" //策略行业专家邮箱
  93. EmaiWhiteUserList = "tshen@hzinsights.com;cxzhang@hzinsights.com;yyli@hzinsights.com" //白名单邮箱
  94. WxMsgTemplateIdAskMsg = "PaoDanHGlt1kFw5q-4_ipJSwO3FyZpxSSNg4rwB7YCk"
  95. WxMsgTemplateIdAskMsgMobile = ""
  96. } else {
  97. WxAppId = "wxcc32b61f96720d2f"
  98. WxAppSecret = "06894933fafb24dafead7eaae09c08e0"
  99. WxId = "gh_a9d3744e1072"
  100. //模板消息ID
  101. WxMsgTemplateIdApply = "qfNuops-sKrfIkbA7U97A7gSrX03mUpoEpJksRUdloo"
  102. WxMsgTemplateIdApplyCancel = "UU_d7ks0XZBnWg2xFzxL9Heilm4kisX39K7dr4SDdO8"
  103. WxMsgTemplateIdPermissionApply = "qfNuops-sKrfIkbA7U97A7gSrX03mUpoEpJksRUdloo"
  104. WxMsgTemplateIdActivityApply = "Y59n_AHg-RLCKaz293geW76KDHpGL1qOnE7eF_lxelY"
  105. WxMsgTemplateIdActivityChange = "qfNuops-CB7bOl7f3viMG4s1uhRo7WM0Jbx3WvodKuIZ8A_z8fM"
  106. WxPublicAppId = "wx9b5d7291e581233a"
  107. WxPublicAppSecret = "f4d52e34021eee262dce9682b31f8861"
  108. WxPublicId = "gh_5dc508325c6f"
  109. IndexName = "cygx_article_v1"
  110. //接收附件邮箱
  111. EmailTechnology = "jhwang@hzinsights.com;cxzhang@hzinsights.com" //科技行业专家邮箱
  112. EmailMedicine = "jhwang@hzinsights.com;cxzhang@hzinsights.com" //医药行业专家邮箱
  113. EmailConsumption = "jhwang@hzinsights.com;cxzhang@hzinsights.com" //消费行业专家邮箱
  114. EmailZhizao = "jhwang@hzinsights.com;cxzhang@hzinsights.com" //智造行业专家邮箱
  115. EmailStrategy = "jhwang@hzinsights.com;cxzhang@hzinsights.com" //策略行业专家邮箱
  116. EmaiWhiteUserList = "cxzhang@hzinsights.com"
  117. WxMsgTemplateIdAskMsg = "qfNuops-sKrfIkbA7U97A7gSrX03mUpoEpJksRUdloo"
  118. WxMsgTemplateIdAskMsgMobile = "15557270714,17634786714,18767183922"
  119. }
  120. }
  121. //http://webapi.brilliantstart.cn/api/
  122. //http://webapi.brilliantstart.cn/swagger/
  123. //http://139.196.122.219:8603/swagger/