package utils import ( "fmt" "github.com/astaxie/beego" "rdluck_tools/cache" ) var ( RunMode string //运行模式 MYSQL_URL string //数据库连接 MYSQL_URL_RDDP string //数据库连接 MYSQL_URL_TACTICS string REDIS_CACHE string //缓存地址 Rc *cache.Cache //redis缓存 Re error //redis错误 ) //微信配置信息 var ( WxId string //微信原始ID WxAppId string WxAppSecret string WxMsgTemplateIdApply string //申请待处理 WxMsgTemplateIdApplyCancel string //预约取消提醒 WxMsgTemplateIdPermissionApply string //预约取消提醒 ) //微信公众号配置信息 var ( WxPublicId string //微信原始ID WxPublicAppId string WxPublicAppSecret string WxPlatform = 4 //注册平台,1:日度点评公众号,2:管理后台,3:pc端网站,4:查研观向小程序 ) var ( IndexName string OnlineTime string ) func init() { RunMode = beego.AppConfig.String("run_mode") config, err := beego.AppConfig.GetSection(RunMode) if err != nil { panic("配置文件读取错误 " + err.Error()) } beego.Info(RunMode + " 模式") MYSQL_URL = config["mysql_url"] MYSQL_URL_RDDP = config["mysql_url_rddp"] MYSQL_URL_TACTICS = config["mysql_url_tactics"] 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) } OnlineTime = "2021-05-01" if RunMode == "release" { WxAppId = "wxcc32b61f96720d2f" WxAppSecret = "06894933fafb24dafead7eaae09c08e0" WxId = "gh_a9d3744e1072" WxMsgTemplateIdApply = "PaoDanHGlt1kFw5q-4_ipJSwO3FyZpxSSNg4rwB7YCk" WxMsgTemplateIdApplyCancel = "iEi4YRHwcPbc2PSEF1pptc39H4NsAJPrUIPEk2ynwiA" WxMsgTemplateIdPermissionApply = "PaoDanHGlt1kFw5q-4_ipJSwO3FyZpxSSNg4rwB7YCk" WxPublicAppId = "wx4a844c734d8c8e56" WxPublicAppSecret = "26c586e7ccb3c575433f0f37797b3eeb" WxPublicId = "gh_b67e0049fb8c" //IndexName="cygx_article_v1" IndexName = "cygx_article_v2" } else { WxAppId = "wxcc32b61f96720d2f" WxAppSecret = "06894933fafb24dafead7eaae09c08e0" WxId = "gh_a9d3744e1072" //模板消息ID WxMsgTemplateIdApply = "qfNuops-sKrfIkbA7U97A7gSrX03mUpoEpJksRUdloo" WxMsgTemplateIdApplyCancel = "UU_d7ks0XZBnWg2xFzxL9Heilm4kisX39K7dr4SDdO8" WxMsgTemplateIdPermissionApply = "qfNuops-sKrfIkbA7U97A7gSrX03mUpoEpJksRUdloo" WxPublicAppId = "wx9b5d7291e581233a" WxPublicAppSecret = "f4d52e34021eee262dce9682b31f8861" WxPublicId = "gh_5dc508325c6f" IndexName = "test_article" } } //http://webapi.brilliantstart.cn/api/ //http://webapi.brilliantstart.cn/swagger/ //http://139.196.122.219:8603/swagger/