config.go 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. MYSQL_URL_RDDP string //数据库连接
  11. )
  12. //微信配置信息
  13. var (
  14. WxId string //微信原始ID
  15. WxAppId string
  16. WxAppSecret string
  17. TemplateIdByProduct string //产品运行报告通知-模板ID
  18. TemplateRedirectUrl string //模板消息跳转地址
  19. WxPlatform int //用户来源,需要入库,用来保存该用户来自哪个平台,默认是:1
  20. TemplateIdByCompanyApply string //客户申请单审批通知-模板ID
  21. //微信小程序appid
  22. WxId2 string //微信原始ID
  23. WxAppId2 string
  24. WxAppSecret2 string
  25. WxPlatform2 int //用户来源,需要入库,用来保存该用户来自哪个平台,默认是:1
  26. )
  27. var (
  28. STATIC_DIR string
  29. )
  30. var (
  31. Bucketname string = "hongze"
  32. Endpoint string
  33. Imghost string = "https://hongze.oss-accelerate.aliyuncs.com/"
  34. Upload_dir string = "static/images/"
  35. Upload_Audio_Dir string = "static/audio/"
  36. AccessKeyId string = "LTAIFMZYQhS2BTvW"
  37. AccessKeySecret string = "12kk1ptCHoGWedhBnKRVW5hRJzq9Fq"
  38. )
  39. func init() {
  40. RunMode = beego.AppConfig.String("run_mode")
  41. fmt.Println(RunMode, "模式")
  42. config, err := beego.AppConfig.GetSection(RunMode)
  43. if err != nil {
  44. panic("配置文件读取错误 " + err.Error())
  45. }
  46. logs.Info(RunMode + " 模式")
  47. MYSQL_URL = config["mysql_url"]
  48. MYSQL_URL_RDDP = config["mysql_url_rddp"]
  49. //小程序appid配置
  50. WxAppId2 = `wx67b68e39913e511e`
  51. WxId2 = `wx67b68e39913e511e`
  52. WxAppSecret2 = `660b0375f701a19220bb8a662b41c77c`
  53. WxPlatform2 = 5
  54. if RunMode == "release" {
  55. WxAppId = "wx4a844c734d8c8e56"
  56. WxAppSecret = "26c586e7ccb3c575433f0f37797b3eeb"
  57. WxId = "gh_b67e0049fb8c"
  58. TemplateIdByProduct = "Cp2wF8gvBtxyWV4DeYuI172oqwyYXVRSm3AyJO42d84"
  59. TemplateRedirectUrl = "https://ficc.hzinsights.com/reportdtl?id="
  60. WxPlatform = 1
  61. TemplateIdByCompanyApply = "ZKcOfNIWBpwHJxpptufHIK1mp2nIwkT3cxub-35cFqI"
  62. //oss
  63. STATIC_DIR = "/home/static/imgs/"
  64. Endpoint = "oss-cn-shanghai-internal.aliyuncs.com"
  65. } else {
  66. WxAppId = "wx9b5d7291e581233a"
  67. WxAppSecret = "f4d52e34021eee262dce9682b31f8861"
  68. WxId = "gh_5dc508325c6f"
  69. TemplateIdByProduct = "-YjuPOB7Fqd-S3ilabYa6wvjDY9aXmeEfPN6DCiy-EY"
  70. TemplateRedirectUrl = "http://rddpweb.brilliantstart.cn/reportdtl?id="
  71. WxPlatform = 1
  72. TemplateIdByCompanyApply = "eTalI1LbiT_B0mTaBeDTlfSMITenK8dQIgEB5yqjjvA"
  73. //oss配置
  74. STATIC_DIR = "static/imgs/"
  75. Endpoint = "oss-cn-shanghai.aliyuncs.com"
  76. }
  77. }
  78. //http://webapi.brilliantstart.cn/api/
  79. //http://webapi.brilliantstart.cn/swagger/
  80. //http://139.196.122.219:8603/swagger/