config.go 5.3 KB

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