package utils import ( "fmt" beego "github.com/beego/beego/v2/adapter" "github.com/beego/beego/v2/server/web" ) var ( RunMode string //运行模式 MYSQL_URL string //数据库连接 MYSQL_URL_RDDP string //数据库连接 MYSQL_URL_EDB string MYSQL_URL_DATA string MYSQL_URL_GL string ) var ( CompanyId int AdminId int RealName string ) var ( WxAppId string WxAppSecret string TemplateId string RemindTemplateId string AppointmentRemindTemplateId string //活动预约通知模板id WxYbAppId string //微信研报小程序 ) //oss配置 var ( Bucketname string = "hongze" Endpoint string Imghost string = "https://hongze.oss-accelerate.aliyuncs.com/" Upload_dir string = "static/images/" Upload_Audio_Dir string = "static/audio/" AccessKeyId string = "LTAIFMZYQhS2BTvW" AccessKeySecret string = "12kk1ptCHoGWedhBnKRVW5hRJzq9Fq" ) var ( THS_SendUrl string //同花顺地址url THS_SyncWxGroupUrl string //同花顺同步微信群url THS_PubKey string //同花顺公钥 ) // 经济数据库 var ( EDB_LIB_URL string ) //进门财经账号信息 var ( COMEIN_URL string COMEIN_APPID string COMEIN_SECREKEY string ) func init() { tmpRunMode, err := web.AppConfig.String("run_mode") if err != nil { panic("配置文件读取run_mode错误 " + err.Error()) } RunMode = tmpRunMode if RunMode == "" { localIp, err := GetLocalIP() fmt.Println("localIp:", localIp) if localIp == "10.0.0.123" { RunMode = "debug" } else { RunMode = "release" } //RunMode = "release" configPath := `/home/code/config/hongze_task/conf/app.conf` err = web.LoadAppConfig("ini", configPath) if err != nil { fmt.Println("web.LoadAppConfig Err:" + err.Error()) } } config, err := web.AppConfig.GetSection(RunMode) if err != nil { panic("配置文件读取错误 " + err.Error()) } beego.Info(RunMode + " 模式") MYSQL_URL = config["mysql_url"] MYSQL_URL_RDDP = config["mysql_url_rddp"] MYSQL_URL_EDB = config["mysql_url_edb"] MYSQL_URL_DATA = config["mysql_url_data"] MYSQL_URL_GL = config["mysql_url_gl"] //同花顺公钥 THS_PubKey = `-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqugglfCboOEfWtHlGBOW 40a4Y3xOs0MPBwjTOzHgcaWzx5XCc20VftGVXkWlpjs8u4dza/Bp1SV7SJ5Y7U95 jgUOP8Js9Qgp6UVqBJDJf3i1KpjHzlk3ma8zxAYUAdieEUE+SKSxSY+BD9A6lpf5 n+igXLmzR5GeVGFeLzoMhB1+pXgGhW30ao9wPwuRF7DBl+FKa/ACi7iXLiwXVgqT FFi29TKeerEENu3EpMXvPml7tNUiVmVW6d83hlascfbAlkShwuHLSGpLqK7brtg6 jRS9hreKFKb0BUQ4TB26e7IDCstbMRvUp4+OGezexzic5NYPQ8uLo5OTaS7f7PrW ZwIDAQAB -----END PUBLIC KEY-----` WxYbAppId = "wxb059c872d79b9967" //弘则研报小程序 if RunMode == "release" { CompanyId = 16 RealName = "超级管理员" WxAppId = "wx4a844c734d8c8e56" WxAppSecret = "26c586e7ccb3c575433f0f37797b3eeb" TemplateId = "P0klzaZjEI2UYth-z-WnmtOQgyxcF8klPoA_MlsA8Eo" RemindTemplateId = "PaHpQjVffrvmeW8wiOUcqlEhnD1LXyU9FnPVF-Jg9wM" //同花顺正式地址 THS_SendUrl = `https://board.10jqka.com.cn/gateway/ps/syncNews` THS_SyncWxGroupUrl = `https://board.10jqka.com.cn/gateway/ps/syncWechatGroupInfo` //同花顺,万得接口服务地址(阿里云windows服务器地址;内网地址) Hz_Server_Data_Url = "http://172.19.173.231:7000/" EDB_LIB_URL = "http://172.19.173.232:8300/edbapi/" //EDB_LIB_URL = "http://47.102.213.75:8300/edbapi/" } else { CompanyId = 16 RealName = "超级管理员" AdminId = 11 WxAppId = "wx9b5d7291e581233a" WxAppSecret = "f4d52e34021eee262dce9682b31f8861" TemplateId = "pDk4o924gSZWj80ZdNnHodnLMIXjPSlKZU0ciQMOhec" RemindTemplateId = "9JYV6sHMJlu2EHRBIj_8ift6wkrrTb9_UO-M_-YXKBw" AppointmentRemindTemplateId = `Y59n_AHg-RLCKaz293geW76KDHpGL1qOnE7eF_lxelY` //活动预约通知模板id //同花顺测试地址 THS_SendUrl = `https://mtest.10jqka.com.cn/gateway/ps/syncNews` THS_SyncWxGroupUrl = `https://mtest.10jqka.com.cn/gateway/ps/syncWechatGroupInfo` //同花顺,万得接口服务地址(阿里云windows服务器地址;外网地址) Hz_Server_Data_Url = "http://139.196.136.213:7000/" EDB_LIB_URL = "http://8.136.199.33:8300/edbapi/" } // 进门财经开放api配置 ComeinOpenApiConfig() } // ComeinOpenApiConfig 进门开放api配置 func ComeinOpenApiConfig() { if RunMode == "release" { COMEIN_URL = "https://server.comein.cn/comein/index.php" COMEIN_APPID = "39b48779-debd-446a-a303-900322d8e356" COMEIN_SECREKEY = "9102a767f20f11ecb5d6b8599f142ed4" } else { COMEIN_URL = "https://testserver.comein.cn/comein/index.php" COMEIN_APPID = "7b966708-4a8b-4d24-9066-fe29920e7eee" COMEIN_SECREKEY = "76e004876fae4b3c8721a3f4c2d115da" } } //http://entryapi.brilliantstart.cn //http://entryapi.brilliantstart.cn/swagger/