config.go 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. MYSQL_URL_DATA string
  11. )
  12. var (
  13. CompanyId int
  14. AdminId int
  15. RealName string
  16. )
  17. var (
  18. WxAppId string
  19. WxAppSecret string
  20. TemplateId string
  21. RemindTemplateId string
  22. )
  23. //oss配置
  24. var (
  25. Bucketname string = "hongze"
  26. Endpoint string
  27. Imghost string = "https://hongze.oss-accelerate.aliyuncs.com/"
  28. Upload_dir string = "static/images/"
  29. Upload_Audio_Dir string = "static/audio/"
  30. AccessKeyId string = "LTAIFMZYQhS2BTvW"
  31. AccessKeySecret string = "12kk1ptCHoGWedhBnKRVW5hRJzq9Fq"
  32. )
  33. var (
  34. Hz_Data_Url string
  35. )
  36. func init() {
  37. RunMode = beego.AppConfig.String("run_mode")
  38. config, err := beego.AppConfig.GetSection(RunMode)
  39. if err != nil {
  40. panic("配置文件读取错误 " + err.Error())
  41. }
  42. beego.Info(RunMode + " 模式")
  43. MYSQL_URL = config["mysql_url"]
  44. MYSQL_URL_RDDP = config["mysql_url_rddp"]
  45. MYSQL_URL_EDB = config["mysql_url_edb"]
  46. MYSQL_URL_DATA = config["mysql_url_data"]
  47. if RunMode == "release" {
  48. CompanyId = 16
  49. RealName="超级管理员"
  50. WxAppId = "wx4a844c734d8c8e56"
  51. WxAppSecret = "26c586e7ccb3c575433f0f37797b3eeb"
  52. TemplateId = "P0klzaZjEI2UYth-z-WnmtOQgyxcF8klPoA_MlsA8Eo"
  53. RemindTemplateId="PaHpQjVffrvmeW8wiOUcqlEhnD1LXyU9FnPVF-Jg9wM"
  54. Hz_Data_Url="http://47.100.166.55:7002/"
  55. } else {
  56. CompanyId = 16
  57. RealName="超级管理员"
  58. AdminId=11
  59. WxAppId = "wx9b5d7291e581233a"
  60. WxAppSecret = "f4d52e34021eee262dce9682b31f8861"
  61. TemplateId = "P0klzaZjEI2UYth-z-WnmtOQgyxcF8klPoA_MlsA8Eo"
  62. RemindTemplateId="9JYV6sHMJlu2EHRBIj_8ift6wkrrTb9_UO-M_-YXKBw"
  63. Hz_Data_Url="http://8.136.199.33:8040/"
  64. }
  65. }
  66. //http://entryapi.brilliantstart.cn
  67. //http://entryapi.brilliantstart.cn/swagger/