config.go 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. package utils
  2. import (
  3. "github.com/astaxie/beego"
  4. )
  5. var (
  6. RunMode string //运行模式
  7. MYSQL_URL string //数据库连接
  8. MYSQL_URL_RDDP string //数据库连接
  9. MYSQL_URL_EDB string
  10. )
  11. var (
  12. STATIC_DIR string
  13. )
  14. //微信配置信息
  15. var (
  16. WxId string //微信原始ID
  17. WxAppId string
  18. WxAppSecret string
  19. TemplateIdByProduct string //产品运行报告通知-模板ID
  20. TemplateRedirectUrl string //模板消息跳转地址
  21. )
  22. //pc端微信配置信息
  23. var (
  24. PcWxId string //微信原始ID
  25. PcWxAppId string
  26. PcWxAppSecret string
  27. PcTemplateIdByProduct string //产品运行报告通知-模板ID
  28. PcTemplateRedirectUrl string //模板消息跳转地址
  29. )
  30. func init() {
  31. RunMode = beego.AppConfig.String("run_mode")
  32. config, err := beego.AppConfig.GetSection(RunMode)
  33. if err != nil {
  34. panic("配置文件读取错误 " + err.Error())
  35. }
  36. beego.Info(RunMode + " 模式")
  37. MYSQL_URL = config["mysql_url"]
  38. MYSQL_URL_RDDP = config["mysql_url_rddp"]
  39. MYSQL_URL_EDB = config["mysql_url_edb"]
  40. if RunMode == "release" {
  41. WxAppId = "wx4a844c734d8c8e56"
  42. WxAppSecret = "26c586e7ccb3c575433f0f37797b3eeb"
  43. WxId = "gh_b67e0049fb8c"
  44. TemplateIdByProduct = "Cp2wF8gvBtxyWV4DeYuI172oqwyYXVRSm3AyJO42d84"
  45. TemplateRedirectUrl = "https://ficc.hzinsights.com/reportdtl?id="
  46. PcWxAppId = "wx615472d6874eeb7f"
  47. PcWxAppSecret="97fe374fb0cc90ef58c4b49d431366f1"
  48. STATIC_DIR = "/home/static/imgs/"
  49. } else {
  50. WxAppId = "wx9b5d7291e581233a"
  51. WxAppSecret = "f4d52e34021eee262dce9682b31f8861"
  52. WxId = "gh_5dc508325c6f"
  53. TemplateIdByProduct = "-YjuPOB7Fqd-S3ilabYa6wvjDY9aXmeEfPN6DCiy-EY"
  54. TemplateRedirectUrl = "http://rddpweb.brilliantstart.cn/reportdtl?id="
  55. PcWxAppId = "wx7c8084f6e5b1d85a"
  56. PcWxAppSecret="9e4210cd5a363aa1f316b7c4b8898418"
  57. STATIC_DIR = "/home/static/imgs/"
  58. }
  59. }
  60. //http://webapi.brilliantstart.cn/api/
  61. //http://webapi.brilliantstart.cn/swagger/
  62. //http://139.196.122.219:8603/swagger/