config.go 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. package utils
  2. import (
  3. beego "github.com/beego/beego/v2/adapter"
  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. MYSQL_URL_GL string
  12. )
  13. var (
  14. CompanyId int
  15. AdminId int
  16. RealName string
  17. )
  18. var (
  19. WxAppId string
  20. WxAppSecret string
  21. TemplateId string
  22. RemindTemplateId string
  23. )
  24. //oss配置
  25. var (
  26. Bucketname string = "hongze"
  27. Endpoint string
  28. Imghost string = "https://hongze.oss-accelerate.aliyuncs.com/"
  29. Upload_dir string = "static/images/"
  30. Upload_Audio_Dir string = "static/audio/"
  31. AccessKeyId string = "LTAIFMZYQhS2BTvW"
  32. AccessKeySecret string = "12kk1ptCHoGWedhBnKRVW5hRJzq9Fq"
  33. )
  34. var (
  35. THS_SendUrl string //同花顺地址url
  36. THS_SyncWxGroupUrl string //同花顺同步微信群url
  37. THS_PubKey string //同花顺公钥
  38. )
  39. func init() {
  40. RunMode = beego.AppConfig.String("run_mode")
  41. config, err := beego.AppConfig.GetSection(RunMode)
  42. if err != nil {
  43. panic("配置文件读取错误 " + err.Error())
  44. }
  45. beego.Info(RunMode + " 模式")
  46. MYSQL_URL = config["mysql_url"]
  47. MYSQL_URL_RDDP = config["mysql_url_rddp"]
  48. MYSQL_URL_EDB = config["mysql_url_edb"]
  49. MYSQL_URL_DATA = config["mysql_url_data"]
  50. MYSQL_URL_GL = config["mysql_url_gl"]
  51. //同花顺公钥
  52. THS_PubKey = `-----BEGIN PUBLIC KEY-----
  53. MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqugglfCboOEfWtHlGBOW
  54. 40a4Y3xOs0MPBwjTOzHgcaWzx5XCc20VftGVXkWlpjs8u4dza/Bp1SV7SJ5Y7U95
  55. jgUOP8Js9Qgp6UVqBJDJf3i1KpjHzlk3ma8zxAYUAdieEUE+SKSxSY+BD9A6lpf5
  56. n+igXLmzR5GeVGFeLzoMhB1+pXgGhW30ao9wPwuRF7DBl+FKa/ACi7iXLiwXVgqT
  57. FFi29TKeerEENu3EpMXvPml7tNUiVmVW6d83hlascfbAlkShwuHLSGpLqK7brtg6
  58. jRS9hreKFKb0BUQ4TB26e7IDCstbMRvUp4+OGezexzic5NYPQ8uLo5OTaS7f7PrW
  59. ZwIDAQAB
  60. -----END PUBLIC KEY-----`
  61. if RunMode == "release" {
  62. CompanyId = 16
  63. RealName = "超级管理员"
  64. WxAppId = "wx4a844c734d8c8e56"
  65. WxAppSecret = "26c586e7ccb3c575433f0f37797b3eeb"
  66. TemplateId = "P0klzaZjEI2UYth-z-WnmtOQgyxcF8klPoA_MlsA8Eo"
  67. RemindTemplateId = "PaHpQjVffrvmeW8wiOUcqlEhnD1LXyU9FnPVF-Jg9wM"
  68. //同花顺正式地址
  69. THS_SendUrl = `https://board.10jqka.com.cn/gateway/ps/syncNews`
  70. THS_SyncWxGroupUrl = `https://board.10jqka.com.cn/gateway/ps/syncWechatGroupInfo`
  71. //同花顺,万得接口服务地址(阿里云windows服务器地址;内网地址)
  72. Hz_Server_Data_Url = "http://172.19.173.231:7000/"
  73. } else {
  74. CompanyId = 16
  75. RealName = "超级管理员"
  76. AdminId = 11
  77. WxAppId = "wx9b5d7291e581233a"
  78. WxAppSecret = "f4d52e34021eee262dce9682b31f8861"
  79. TemplateId = "P0klzaZjEI2UYth-z-WnmtOQgyxcF8klPoA_MlsA8Eo"
  80. RemindTemplateId = "9JYV6sHMJlu2EHRBIj_8ift6wkrrTb9_UO-M_-YXKBw"
  81. //同花顺测试地址
  82. THS_SendUrl = `https://mtest.10jqka.com.cn/gateway/ps/syncNews`
  83. THS_SyncWxGroupUrl = `https://mtest.10jqka.com.cn/gateway/ps/syncWechatGroupInfo`
  84. //同花顺,万得接口服务地址(阿里云windows服务器地址;外网地址)
  85. Hz_Server_Data_Url = "http://139.196.136.213:7000/"
  86. }
  87. }
  88. //http://entryapi.brilliantstart.cn
  89. //http://entryapi.brilliantstart.cn/swagger/