config.go 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package utils
  2. import (
  3. "fmt"
  4. "github.com/astaxie/beego"
  5. "github.com/astaxie/beego/logs"
  6. )
  7. var (
  8. RunMode string //运行模式
  9. MYSQL_URL string //数据库连接
  10. )
  11. //微信配置信息
  12. var (
  13. WxId string //微信原始ID
  14. WxAppId string
  15. WxAppSecret string
  16. TemplateIdByProduct string //产品运行报告通知-模板ID
  17. TemplateRedirectUrl string //模板消息跳转地址
  18. WxPlatform int //用户来源,需要入库,用来保存该用户来自哪个平台,默认是:1
  19. )
  20. func init() {
  21. RunMode = beego.AppConfig.String("run_mode")
  22. fmt.Println(RunMode, "模式")
  23. config, err := beego.AppConfig.GetSection(RunMode)
  24. if err != nil {
  25. panic("配置文件读取错误 " + err.Error())
  26. }
  27. logs.Info(RunMode + " 模式")
  28. MYSQL_URL = config["mysql_url"]
  29. if RunMode == "release" {
  30. WxAppId = "wx4a844c734d8c8e56"
  31. WxAppSecret = "26c586e7ccb3c575433f0f37797b3eeb"
  32. WxId = "gh_b67e0049fb8c"
  33. TemplateIdByProduct = "Cp2wF8gvBtxyWV4DeYuI172oqwyYXVRSm3AyJO42d84"
  34. TemplateRedirectUrl = "https://ficc.hzinsights.com/reportdtl?id="
  35. WxPlatform = 1
  36. } else {
  37. WxAppId = "wx9b5d7291e581233a"
  38. WxAppSecret = "f4d52e34021eee262dce9682b31f8861"
  39. WxId = "gh_5dc508325c6f"
  40. TemplateIdByProduct = "-YjuPOB7Fqd-S3ilabYa6wvjDY9aXmeEfPN6DCiy-EY"
  41. TemplateRedirectUrl = "http://rddpweb.brilliantstart.cn/reportdtl?id="
  42. WxPlatform = 1
  43. }
  44. }
  45. //http://webapi.brilliantstart.cn/api/
  46. //http://webapi.brilliantstart.cn/swagger/
  47. //http://139.196.122.219:8603/swagger/