config.go 5.6 KB

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