config.go 1.6 KB

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