123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191 |
- package utils
- import (
- "fmt"
- "github.com/beego/beego/v2/server/web"
- "github.com/rdlucklib/rdluck_tools/cache"
- )
- var (
- RunMode string
- MYSQL_URL string
- MYSQL_URL_RDDP string
- MYSQL_URL_TACTICS string
- MYSQL_URL_COMEIN_DATA string
- REDIS_CACHE string
- Rc *cache.Cache
- Re error
- )
- var (
- WxId string
- WxAppId string
- WxAppSecret string
- WxPublicIdXzs string
- WxPublicSecretXzs string
- WxMsgTemplateIdApply string
- WxMsgTemplateIdApplyXzs string
- WxMsgTemplateIdApplyCancel string
- WxMsgTemplateIdApplyCancelXzs string
- WxMsgTemplateIdPermissionApply string
- WxMsgTemplateIdActivityApply string
- WxMsgTemplateIdActivityApplyXzs string
- WxMsgTemplateIdActivityChange string
- WxMsgTemplateIdAskMsg string
- WxMsgTemplateIdAskMsgXzs string
- WxMsgTemplateIdAskMsgMobile string
- WxMsgTemplateIdAskMsgMobileAll string
- )
- var (
- WxPublicId string
- WxPublicAppId string
- WxPublicAppSecret string
- WxPlatform = 4
- )
- var (
- IndexName string
- OnlineTime string
- SummaryArticleId int
- YanxSummaryPermissionId int
- YanxViewpointPermissionId int
- EmailTechnology string
- EmailMedicine string
- EmailConsumption string
- EmailZhizao string
- EmailStrategy string
- EmailExpert string
- EmaiWhiteUserList string
- IsTask bool
- ActSendMsgMobile string
- StrategyPlatform string
- )
- func init() {
- tmpRunMode, err := web.AppConfig.String("run_mode")
- if err != nil {
- panic("配置文件读取run_mode错误 " + err.Error())
- }
- fmt.Println("line 80:", tmpRunMode, err)
- RunMode = tmpRunMode
- if RunMode == "" {
- RunMode = "release"
- configPath := `/home/code/config/hongze_cygx/conf/app.conf`
- err := web.LoadAppConfig("ini", configPath)
- if err != nil {
- fmt.Println("web.LoadAppConfig Err:" + err.Error())
- }
- }
- config, err := web.AppConfig.GetSection(RunMode)
- if err != nil {
- panic("配置文件读取错误 " + err.Error())
- }
-
- MYSQL_URL = config["mysql_url"]
- MYSQL_URL_RDDP = config["mysql_url_rddp"]
- MYSQL_URL_TACTICS = config["mysql_url_tactics"]
- MYSQL_URL_COMEIN_DATA = config["mysql_url_comein_data"]
- REDIS_CACHE = config["beego_cache"]
- if len(REDIS_CACHE) <= 0 {
- panic("redis链接参数没有配置")
- }
- Rc, Re = cache.NewCache(REDIS_CACHE)
- if Re != nil {
- fmt.Println(Re)
- panic(Re)
- }
- IsTask, err = web.AppConfig.Bool("IsTask")
- if err != nil {
- panic("定时任务配置文件读取错误 " + err.Error())
- }
- OnlineTime = "2021-06-01 00:00:01"
- SummaryArticleId = 1000000
- YanxSummaryPermissionId = 1001
- YanxViewpointPermissionId = 1002
- WxMsgTemplateIdAskMsgMobileAll = "15557270714,18767183922,18621268829"
- StrategyPlatform = "https://vmp.hzinsights.com/v2/articles/"
- if RunMode == "release" {
- WxAppId = "wxcc32b61f96720d2f"
- WxAppSecret = "06894933fafb24dafead7eaae09c08e0"
- WxId = "gh_a9d3744e1072"
-
- WxMsgTemplateIdApply = "PaoDanHGlt1kFw5q-4_ipJSwO3FyZpxSSNg4rwB7YCk"
- WxMsgTemplateIdApplyCancel = "iEi4YRHwcPbc2PSEF1pptc39H4NsAJPrUIPEk2ynwiA"
- WxMsgTemplateIdPermissionApply = "PaoDanHGlt1kFw5q-4_ipJSwO3FyZpxSSNg4rwB7YCk"
- WxMsgTemplateIdActivityApply = "MwZ5wxfd0O1Yt0Pkf6OkfWP4USQzZbiEo5SkZ26735s"
- WxPublicAppId = "wx4a844c734d8c8e56"
- WxPublicAppSecret = "26c586e7ccb3c575433f0f37797b3eeb"
- WxPublicId = "gh_b67e0049fb8c"
- IndexName = "cygx_article_v0225"
-
- EmailTechnology = "mlluo@hzinsights.com;jxu@hzinsights.com;tshen@hzinsights.com;cxzhang@hzinsights.com;jhwang@hzinsights.com"
- EmailMedicine = "xlzheng@hzinsights.com;tshen@hzinsights.com;cxzhang@hzinsights.com;jhwang@hzinsights.com"
- EmailConsumption = "yrhuang@hzinsights.com;tshen@hzinsights.com;cxzhang@hzinsights.com;jhwang@hzinsights.com;jxu@hzinsights.com"
- EmailZhizao = "xfma@hzinsights.com;agne@hzinsights.com;tshen@hzinsights.com;cxzhang@hzinsights.com;jhwang@hzinsights.com"
- EmailStrategy = "experts@hzinsights.com;tshen@hzinsights.com;cxzhang@hzinsights.com;jhwang@hzinsights.com"
- EmailExpert = "experts@hzinsights.com;tshen@hzinsights.com;cxzhang@hzinsights.com;jhwang@hzinsights.com"
- EmaiWhiteUserList = "tshen@hzinsights.com;cxzhang@hzinsights.com;yyli@hzinsights.com"
- WxMsgTemplateIdAskMsg = "PaoDanHGlt1kFw5q-4_ipJSwO3FyZpxSSNg4rwB7YCk"
- WxMsgTemplateIdAskMsgMobile = ""
- ActSendMsgMobile = "15618524605"
- } else {
- WxAppId = "wxcc32b61f96720d2f"
- WxAppSecret = "06894933fafb24dafead7eaae09c08e0"
- WxId = "gh_a9d3744e1072"
-
- WxMsgTemplateIdApply = "qfNuops-sKrfIkbA7U97A7gSrX03mUpoEpJksRUdloo"
- WxMsgTemplateIdApplyCancel = "UU_d7ks0XZBnWg2xFzxL9Heilm4kisX39K7dr4SDdO8"
- WxMsgTemplateIdPermissionApply = "qfNuops-sKrfIkbA7U97A7gSrX03mUpoEpJksRUdloo"
- WxMsgTemplateIdActivityApply = "Y59n_AHg-RLCKaz293geW76KDHpGL1qOnE7eF_lxelY"
- WxMsgTemplateIdActivityChange = "qfNuops-CB7bOl7f3viMG4s1uhRo7WM0Jbx3WvodKuIZ8A_z8fM"
- WxPublicAppId = "wx9b5d7291e581233a"
- WxPublicAppSecret = "f4d52e34021eee262dce9682b31f8861"
- WxPublicId = "gh_5dc508325c6f"
- IndexName = "cygx_article_v1"
-
- EmailTechnology = "jhwang@hzinsights.com;cxzhang@hzinsights.com"
- EmailMedicine = "jhwang@hzinsights.com;cxzhang@hzinsights.com"
- EmailConsumption = "jhwang@hzinsights.com;cxzhang@hzinsights.com"
- EmailZhizao = "jhwang@hzinsights.com;cxzhang@hzinsights.com"
- EmailStrategy = "jhwang@hzinsights.com;cxzhang@hzinsights.com"
- EmailExpert = "jhwang@hzinsights.com;cxzhang@hzinsights.com"
- EmaiWhiteUserList = "cxzhang@hzinsights.com"
- WxMsgTemplateIdAskMsg = "qfNuops-sKrfIkbA7U97A7gSrX03mUpoEpJksRUdloo"
- WxMsgTemplateIdAskMsgMobile = "15557270714,17634786714,18767183922,17516315016"
- ActSendMsgMobile = "17634786714"
- }
-
- if RunMode != "release" {
-
- WxPublicIdXzs = "wx9b5d7291e581233a"
- WxPublicSecretXzs = "f4d52e34021eee262dce9682b31f8861"
- WxMsgTemplateIdActivityApplyXzs = "Y59n_AHg-RLCKaz293geW76KDHpGL1qOnE7eF_lxelY"
- WxMsgTemplateIdAskMsgXzs = "qfNuops-sKrfIkbA7U97A7gSrX03mUpoEpJksRUdloo"
- WxMsgTemplateIdApplyXzs = "qfNuops-sKrfIkbA7U97A7gSrX03mUpoEpJksRUdloo"
- WxMsgTemplateIdApplyCancelXzs = "UU_d7ks0XZBnWg2xFzxL9Heilm4kisX39K7dr4SDdO8"
- } else {
-
- WxPublicIdXzs = "wxb7cb8a15abad5b8e"
- WxPublicSecretXzs = "f425ba2863084249722af1e2a5cfffd3"
- WxMsgTemplateIdActivityApplyXzs = "nsfOASdg2O5KNk8hnBvu8MFsoP9X0o8ED6yPLPvEkao"
- WxMsgTemplateIdAskMsgXzs = "IpS-yuNNQc8osCoy20jPHNkvBUyKRL1NGn7c0G9xmQA"
- WxMsgTemplateIdApplyXzs = "IpS-yuNNQc8osCoy20jPHNkvBUyKRL1NGn7c0G9xmQA"
- WxMsgTemplateIdApplyCancelXzs = "gCSCAWNNhjkzE2V1cjbIV_Ex68R_8LM_u25qDlSKWyM"
- }
- }
|