|
@@ -5,139 +5,145 @@ import (
|
|
|
beeLogger "github.com/beego/bee/v2/logger"
|
|
|
"github.com/beego/beego/v2/server/web"
|
|
|
"github.com/rdlucklib/rdluck_tools/cache"
|
|
|
+ "strconv"
|
|
|
)
|
|
|
|
|
|
var (
|
|
|
- RunMode string //运行模式
|
|
|
- MYSQL_URL string //数据库连接
|
|
|
- MYSQL_URL_RDDP string //数据库连接
|
|
|
- MYSQL_URL_EDB string
|
|
|
- MYSQL_URL_DATA string
|
|
|
- MYSQL_URL_GL string
|
|
|
- MYSQL_LOG_URL string
|
|
|
- MYSQL_URL_COMEIN_DATA string // 路演记录数据库
|
|
|
+ RunMode string //运行模式
|
|
|
+ MYSQL_URL string //数据库连接
|
|
|
+ MYSQL_URL_RDDP string //数据库连接
|
|
|
+ MYSQL_URL_EDB string
|
|
|
+ MYSQL_URL_DATA string
|
|
|
+ MYSQL_URL_GL string
|
|
|
+ MYSQL_LOG_URL string
|
|
|
+ MYSQL_URL_COMEIN_DATA string // 路演记录数据库
|
|
|
|
|
|
REDIS_CACHE string //缓存地址
|
|
|
Rc *cache.Cache //redis缓存
|
|
|
Re error //redis错误
|
|
|
)
|
|
|
|
|
|
+// SystemType 系统类型; hz:弘则;trial:试用平台;custom:客户
|
|
|
+var SystemType string
|
|
|
+
|
|
|
+// 基础配置
|
|
|
var (
|
|
|
- STATIC_DIR string
|
|
|
+ STATIC_DIR string
|
|
|
+ DesKey string // 接口返回加密KEY
|
|
|
+ APPNAME string //项目中文名称
|
|
|
+ EmailSendToUsers string // 邮件提醒人员
|
|
|
+ // LibreOfficePath LibreOfficePath的地址
|
|
|
+ LibreOfficePath string
|
|
|
)
|
|
|
|
|
|
-// 微信配置信息
|
|
|
+// 公共api内部服务调用
|
|
|
var (
|
|
|
- WxId string //微信原始ID
|
|
|
- WxAppId string
|
|
|
- WxAppSecret string
|
|
|
- TemplateIdByProduct string //产品运行报告通知-模板ID
|
|
|
+ // EDB_LIB_URL 公共指标库
|
|
|
+ EDB_LIB_URL string
|
|
|
+ APP_EDB_LIB_NAME_EN string
|
|
|
+ EDB_LIB_Md5_KEY string
|
|
|
|
|
|
- TemplateRedirectUrl string //模板消息跳转地址
|
|
|
- DayReportTemplateRedirectUrl string //模板消息跳转地址(晨报、周报)
|
|
|
- TemplateIdByCompanyApply string //客户申请单审批通知-模板ID
|
|
|
- TemplateCompanyApplyRedirectUrl string //审批单模板消息跳转地址
|
|
|
- TemplateIdByCompanyReceive string //销售跨部门领取客户通知-模板ID
|
|
|
- TemplateIdByCompanyReceivePermission string //销售"添加客户/领取客户"权限变更通知
|
|
|
- WxMsgTemplateIdActivityChangeApply string //查研观向活动变更通知-模板ID
|
|
|
- WxMsgTemplateIdActivityChangeApplyXzs string //查研观向活动变更通知-模板ID(小助手)
|
|
|
- TemplateIdByProductXzs string //产品运行报告通知-模板ID(小助手)
|
|
|
- WxCygxAppId string //查研观向小程序APPID
|
|
|
- WxMsgTemplateIdAskByUser string //查研观向用户提问新消息推送ID
|
|
|
- WxCrmAppId string //随手办公小程序APPID
|
|
|
- WxPublicIdXzs string //查研观向小助手公众号
|
|
|
- WxPublicSecretXzs string //查研观向小助手公众号
|
|
|
- WxYbAppId string //弘则研报小程序APPID
|
|
|
- YiDongHuaWeiYunUrl string //易董 华为云请求域名
|
|
|
-
|
|
|
- WxMsgTemplateIdWithRoadshowPending string //路演->研究员收到待处理的申请
|
|
|
- WxMsgTemplateIdWithRoadshowDetailResult string //路演->销售收到处理结果
|
|
|
- WxMsgTemplateIdWithRoadshowDeleteNotice string //路演->研究员收到活动删除通知
|
|
|
-
|
|
|
- WxMsgTemplateIdWithYbCommunityQuestion string // 研报小程序->问答社区回复通知
|
|
|
- WxMsgTemplateIdWithSealApplyFinished string // 用印申请-已签回通知
|
|
|
-
|
|
|
- //内部员工公众号(弘则部门)
|
|
|
- AdminWxAppId string
|
|
|
- AdminWxAppSecret string
|
|
|
- UserTemplateIdByProduct string //客户产品运行报告通知-模板ID
|
|
|
+ // PublicChartHost 公共图库的host
|
|
|
+ PublicChartHost string
|
|
|
|
|
|
-)
|
|
|
+ // SendWxTemplateMsgUrl 模板消息推送
|
|
|
+ SendWxTemplateMsgUrl string
|
|
|
|
|
|
-var (
|
|
|
- THS_SendUrl string //同花顺地址url
|
|
|
- THS_PubKey string //同花顺公钥
|
|
|
+ // SendTemplateMsgAuthorization 模板推送秘钥
|
|
|
+ SendTemplateMsgAuthorization string
|
|
|
+
|
|
|
+ // HandleVideoDecibelUrl 处理音频分贝的url
|
|
|
+ HandleVideoDecibelUrl string
|
|
|
+
|
|
|
+ // Ppt2ImageUrl ppt转图片服务的地址
|
|
|
+ Ppt2ImageUrl string
|
|
|
+
|
|
|
+ // EnglishShareUrl 英文研报群发邮件分享地址
|
|
|
+ EnglishShareUrl string
|
|
|
+
|
|
|
+ // AlarmMsgUrl 报警服务地址
|
|
|
+ AlarmMsgUrl string
|
|
|
)
|
|
|
|
|
|
+// TemplateIdByProduct 微信配置信息
|
|
|
var (
|
|
|
- IndexName string //Es索引
|
|
|
- IndexNameArticleHistory string //文章阅读记录Es索引
|
|
|
- SummaryArticleId int //手动添加的纪要库开始ID
|
|
|
- YanxSummaryPermissionId int //研选纪要分类ID
|
|
|
- YanxViewpointPermissionId int //研选观点分类ID
|
|
|
- DATA_INDEX_NAME string //数据指标库索引
|
|
|
- CHART_INDEX_NAME string //研究图库索引
|
|
|
- EsReportIndexName string //研报ES索引
|
|
|
- EsEnglishReportIndexName string //英文研报ES索引
|
|
|
- Hz_CeLue_Article_Url string //策略平台报告地址
|
|
|
- MY_CHART_INDEX_NAME string //研究图库(MY ETA)索引
|
|
|
- EsSemanticAnalysisDocIndexName string //ES语义分析文档索引名
|
|
|
+ TemplateIdByProduct string //产品运行报告通知-模板ID
|
|
|
+ WxYbAppId string // 研报小程序appid
|
|
|
+ WxYbId string // 研报小程序微信原始ID
|
|
|
+ WxYbAppSecret string // 研报小程序秘钥
|
|
|
+ WxYbPlatform int //弘则研报来源
|
|
|
)
|
|
|
|
|
|
+// ES配置
|
|
|
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"
|
|
|
+ ES_URL string // ES服务器地址
|
|
|
+ ES_USERNAME string // ES账号
|
|
|
+ ES_PASSWORD string // ES密码
|
|
|
)
|
|
|
|
|
|
-// LibreOfficePath LibreOfficePath的地址
|
|
|
-var LibreOfficePath string
|
|
|
-
|
|
|
-// 经济数据库
|
|
|
+// ES索引配置
|
|
|
var (
|
|
|
- EDB_LIB_URL string
|
|
|
+ DATA_INDEX_NAME string //数据指标库索引
|
|
|
+ CHART_INDEX_NAME string //研究图库索引
|
|
|
+ EsReportIndexName string //研报ES索引
|
|
|
+ EsEnglishReportIndexName string //英文研报ES索引
|
|
|
+ MY_CHART_INDEX_NAME string //研究图库(MY ETA)索引
|
|
|
)
|
|
|
|
|
|
-// 上海crm开放api配置
|
|
|
+// 阿里云配置
|
|
|
var (
|
|
|
- CRM_OPEN_API_URL string
|
|
|
- CRM_OPEN_API_APP_KEY string
|
|
|
- CRM_OPEN_API_APP_SECRET string
|
|
|
+ Bucketname string
|
|
|
+ Endpoint string
|
|
|
+ Imghost string
|
|
|
+ UploadDir string
|
|
|
+ Upload_Audio_Dir string
|
|
|
+ AccessKeyId string
|
|
|
+ AccessKeySecret string
|
|
|
)
|
|
|
|
|
|
-// 全时会议账号信息
|
|
|
+// 阿里云oss前端上传用
|
|
|
var (
|
|
|
- QsAppID string
|
|
|
- QsSecretKey string
|
|
|
- QsUserId int64
|
|
|
- QsUserName string
|
|
|
+ AliStsScheme string
|
|
|
+ RegionId string
|
|
|
+ RoleArn string
|
|
|
+ RoleSessionName string
|
|
|
+ RAMAccessKeyId string
|
|
|
+ RAMAccessKeySecret string
|
|
|
+ STSTokenCacheKey string
|
|
|
)
|
|
|
|
|
|
-// 进门财经账号信息
|
|
|
+// 科大讯飞--语音合成
|
|
|
var (
|
|
|
- COMEIN_URL string
|
|
|
- COMEIN_APPID string
|
|
|
- COMEIN_SECREKEY string
|
|
|
+ XfSTATUS_FIRST_FRAME = 0 //第一帧标识
|
|
|
+ XfSTATUS_CONTINUE_FRAME = 1 //中间帧标识
|
|
|
+ XfSTATUS_LAST_FRAME = 2 //最后一帧标识
|
|
|
+ XfHost = "tts-api.xfyun.cn"
|
|
|
+ XfMaxFontSize = 8000
|
|
|
+ XfAPPID string
|
|
|
+ XfAPIKey string
|
|
|
+ XfAPISecret string
|
|
|
+ XfHostUrl string
|
|
|
+ XfOrigin string
|
|
|
+ XfVcn string //发言人
|
|
|
)
|
|
|
|
|
|
-// 模板消息推送
|
|
|
+// 阿里云邮箱配置
|
|
|
var (
|
|
|
- SendWxTemplateMsgUrl string
|
|
|
+ AliyunEmailAccountName string
|
|
|
+ AliyunEmailAccessKeyId string
|
|
|
+ AliyunEmailAccessKeySecret string
|
|
|
+ AliyunEmailReplyAddress string
|
|
|
+ AliyunEmailReplyAddressAlias string
|
|
|
)
|
|
|
|
|
|
-// ppt转图片服务的地址
|
|
|
-var Ppt2ImageUrl string
|
|
|
-
|
|
|
-// 开放openapi的地址
|
|
|
-var HongzeOpenApiHost string
|
|
|
-
|
|
|
-var EnglishShareUrl string //英文研报群发邮件分享地址
|
|
|
+// 腾讯云邮箱配置
|
|
|
+var (
|
|
|
+ TencentSDKSecretId string // 腾讯云主账号SecretId
|
|
|
+ TencentSDKSecretKey string // 腾讯云主账号SecretKey
|
|
|
|
|
|
-var EnPolicyReportUrl string
|
|
|
+ TencentEmailFromEmailAddress string // 腾讯云邮件发信地址
|
|
|
+ TencentEmailTemplateID uint64 // 云邮件模板ID
|
|
|
+)
|
|
|
|
|
|
func init() {
|
|
|
tmpRunMode, err := web.AppConfig.String("run_mode")
|
|
@@ -185,250 +191,156 @@ func init() {
|
|
|
fmt.Println(Re)
|
|
|
panic(Re)
|
|
|
}
|
|
|
- WxCygxAppId = "wxcc32b61f96720d2f"
|
|
|
- SummaryArticleId = 1000000 //手动添加的纪要库开始ID
|
|
|
- YanxSummaryPermissionId = 1001 //研选纪要分类ID
|
|
|
- YanxViewpointPermissionId = 1002 //研选观点分类ID
|
|
|
- Hz_CeLue_Article_Url = "https://vmp.hzinsights.com/v2/articles/" //策略平台项目报告地址
|
|
|
-
|
|
|
- //随手办公 微信小程序appid
|
|
|
- WxCrmAppId = `wx67b68e39913e511e`
|
|
|
- WxYbAppId = `wxb059c872d79b9967` //弘则研报小程序
|
|
|
-
|
|
|
- //内部员工公众号(弘则部门)
|
|
|
- AdminWxAppId = "wx1392111da5426e9e"
|
|
|
- AdminWxAppSecret = "30eceb7cf29bf2f046031155ab55d7b4"
|
|
|
-
|
|
|
- THS_PubKey = `-----BEGIN PUBLIC KEY-----
|
|
|
-MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqugglfCboOEfWtHlGBOW
|
|
|
-40a4Y3xOs0MPBwjTOzHgcaWzx5XCc20VftGVXkWlpjs8u4dza/Bp1SV7SJ5Y7U95
|
|
|
-jgUOP8Js9Qgp6UVqBJDJf3i1KpjHzlk3ma8zxAYUAdieEUE+SKSxSY+BD9A6lpf5
|
|
|
-n+igXLmzR5GeVGFeLzoMhB1+pXgGhW30ao9wPwuRF7DBl+FKa/ACi7iXLiwXVgqT
|
|
|
-FFi29TKeerEENu3EpMXvPml7tNUiVmVW6d83hlascfbAlkShwuHLSGpLqK7brtg6
|
|
|
-jRS9hreKFKb0BUQ4TB26e7IDCstbMRvUp4+OGezexzic5NYPQ8uLo5OTaS7f7PrW
|
|
|
-ZwIDAQAB
|
|
|
------END PUBLIC KEY-----`
|
|
|
-
|
|
|
- if RunMode == "release" {
|
|
|
-
|
|
|
- TemplateRedirectUrl = "https://ficc.hzinsights.com/reportdtl?id="
|
|
|
- DayReportTemplateRedirectUrl = "https://report.hzinsights.com/#/allindex/" //晨报模板跳转url
|
|
|
-
|
|
|
- TemplateCompanyApplyRedirectUrl = "https://ficc.hzinsights.com/approval/approval/list"
|
|
|
-
|
|
|
- STATIC_DIR = "/home/static/imgs/"
|
|
|
- Endpoint = "oss-cn-shanghai-internal.aliyuncs.com"
|
|
|
- //Endpoint = "oss-cn-shanghai.aliyuncs.com"
|
|
|
- IndexName = "cygx_article_v03_23"
|
|
|
- IndexNameArticleHistory = "cygx_article_history_v07_08"
|
|
|
- TemplateCompanyApplyRedirectUrl = "https://ficc.hzinsights.com/approval/approval/list"
|
|
|
-
|
|
|
- //同花顺正式地址
|
|
|
- THS_SendUrl = `https://board.10jqka.com.cn/gateway/ps/syncNews`
|
|
|
-
|
|
|
- DATA_INDEX_NAME = "hz_data_lib_v20220214"
|
|
|
- CHART_INDEX_NAME = "hz_chart_lib_v2"
|
|
|
- MY_CHART_INDEX_NAME = "hz_my_chart_v1"
|
|
|
- //同花顺,万得接口服务地址(阿里云windows服务器地址;内网地址)
|
|
|
- Hz_Server_Data_Url = "http://172.19.173.231:7000/"
|
|
|
- EDB_LIB_URL = "http://172.19.173.232:8300/edbapi/"
|
|
|
- EsReportIndexName = "research_report_v1"
|
|
|
- EsEnglishReportIndexName = "english_report_v1"
|
|
|
- EsSemanticAnalysisDocIndexName = "semantic_analysis_v1"
|
|
|
-
|
|
|
- WxRelease()
|
|
|
-
|
|
|
- SendWxTemplateMsgUrl = "http://127.0.0.1:8086/v1/wechat/send_template_msg"
|
|
|
- HongzeOpenApiHost = "http://127.0.0.1:8609"
|
|
|
- EnglishShareUrl = "https://ybpcen.hzinsights.com"
|
|
|
- EnPolicyReportUrl = "https://en.hzinsights.com/v2api/"
|
|
|
- } else {
|
|
|
-
|
|
|
- TemplateRedirectUrl = "http://rddpweb.brilliantstart.cn/reportdtl?id="
|
|
|
- DayReportTemplateRedirectUrl = "http://report.brilliantstart.cn/#/allindex/" //晨报模板跳转url
|
|
|
-
|
|
|
- TemplateCompanyApplyRedirectUrl = "http://advisoryadmin.brilliantstart.cn/approval/approval/list"
|
|
|
-
|
|
|
- STATIC_DIR = "static/imgs/"
|
|
|
- Endpoint = "oss-cn-shanghai.aliyuncs.com"
|
|
|
- IndexName = "cygx_article_v1"
|
|
|
- IndexNameArticleHistory = "cygx_article_history_v1"
|
|
|
-
|
|
|
- //同花顺测试地址
|
|
|
- THS_SendUrl = `https://mtest.10jqka.com.cn/gateway/ps/syncNews`
|
|
|
- DATA_INDEX_NAME = "test_hz_data_lib_v20220120"
|
|
|
- CHART_INDEX_NAME = "test_hz_chart_lib_v2"
|
|
|
- MY_CHART_INDEX_NAME = "test_hz_my_chart_v1"
|
|
|
- //同花顺,万得接口服务地址(阿里云windows服务器地址;外网地址)
|
|
|
- Hz_Server_Data_Url = "http://139.196.136.213:7000/"
|
|
|
- EDB_LIB_URL = "http://8.136.199.33:8300/edbapi/"
|
|
|
- //EDB_LIB_URL = "http://127.0.0.1:8900/edbapi/"
|
|
|
- EsReportIndexName = "test_research_report_v1"
|
|
|
- EsEnglishReportIndexName = "test_english_report_v1"
|
|
|
- EsSemanticAnalysisDocIndexName = "test_semantic_analysis_v1"
|
|
|
-
|
|
|
- WxDebug()
|
|
|
- SendWxTemplateMsgUrl = "http://127.0.0.1:8086/v1/wechat/send_template_msg"
|
|
|
- HongzeOpenApiHost = "http://127.0.0.1:8608"
|
|
|
- EnglishShareUrl = "http://8.136.199.33:8301"
|
|
|
- //EnPolicyReportUrl = "https://beta.internal.hzinsights.com/v2api/"
|
|
|
- EnPolicyReportUrl = "https://en.hzinsights.com/v2api/"
|
|
|
- }
|
|
|
- tmpLibreOfficePath, err := web.AppConfig.String("libreOfficePath")
|
|
|
+
|
|
|
+ // 系统类型
|
|
|
+ systemType, err := web.AppConfig.String("system_type")
|
|
|
if err != nil {
|
|
|
- panic("配置文件读取libreOfficePath错误 " + err.Error())
|
|
|
+ panic(any("配置文件读取system_type错误 " + err.Error()))
|
|
|
}
|
|
|
- LibreOfficePath = tmpLibreOfficePath
|
|
|
+ SystemType = systemType
|
|
|
|
|
|
- //上海crm开放api配置
|
|
|
- CrmOpenApiConfig()
|
|
|
+ // 项目中文名称
|
|
|
+ appNameCn, err := web.AppConfig.String("app_name_cn")
|
|
|
+ if err != nil {
|
|
|
+ panic(any("配置文件读取app_name_cn错误 " + err.Error()))
|
|
|
+ }
|
|
|
+ APPNAME = appNameCn
|
|
|
|
|
|
- //初始化全时开放api配置
|
|
|
- initQsOpenApiConfig()
|
|
|
+ // 初始化内部服务配置
|
|
|
|
|
|
- //进门财经开放api配置
|
|
|
- ComeinOpenApiConfig()
|
|
|
+ // 接口返回加密KEY
|
|
|
+ DesKey = config["des_key"]
|
|
|
|
|
|
- //易董开放api配置
|
|
|
- YiDongApiConfig()
|
|
|
+ // 服务基本配置
|
|
|
+ {
|
|
|
+ // 邮件提醒人员
|
|
|
+ EmailSendToUsers = config["email_send_to_users"]
|
|
|
|
|
|
- // 初始化内部服务配置
|
|
|
- initSystemServer()
|
|
|
-}
|
|
|
+ // 静态文件目录
|
|
|
+ STATIC_DIR = config["static_dir"]
|
|
|
+ }
|
|
|
|
|
|
-// 测试环境模板消息
|
|
|
-func WxDebug() {
|
|
|
- WxAppId = "wx9b5d7291e581233a"
|
|
|
- WxAppSecret = "f4d52e34021eee262dce9682b31f8861"
|
|
|
- WxId = "gh_5dc508325c6f"
|
|
|
- //模板消息
|
|
|
+ // 系统内部服务地址
|
|
|
{
|
|
|
- TemplateIdByProduct = "-YjuPOB7Fqd-S3ilabYa6wvjDY9aXmeEfPN6DCiy-EY"
|
|
|
- WxMsgTemplateIdAskByUser = `qfNuops-sKrfIkbA7U97A7gSrX03mUpoEpJksRUdloo`
|
|
|
- TemplateIdByCompanyApply = "yqaDUavXAKBpsPqTr0zYXAGIQYeCijZtWwFsT07wTbE"
|
|
|
- //销售跨部门领取客户通知
|
|
|
- TemplateIdByCompanyReceive = "-ccp916f5rjMhwj8CtOAW_d_Os6ran8q5okVCENg924"
|
|
|
- //销售"添加客户/领取客户"权限变更通知
|
|
|
- TemplateIdByCompanyReceivePermission = "rciDm9ThigRBGi1SZ4TFd74XA4aoAxSz_ugdv_tZ450"
|
|
|
- WxMsgTemplateIdActivityChangeApply = "CB7bOl7f3viMG4s1uhRo7WM0Jbx3WvodKuIZ8A_z8fM"
|
|
|
-
|
|
|
- //路演
|
|
|
- WxMsgTemplateIdWithRoadshowPending = "1JG9fvKx9o9B-wkZe_gBFQQzMBnp07-hvpZI9QiFcKQ" //路演->研究员收到待处理的申请
|
|
|
- WxMsgTemplateIdWithRoadshowDetailResult = "rciDm9ThigRBGi1SZ4TFd74XA4aoAxSz_ugdv_tZ450" //路演->销售收到处理结果
|
|
|
- WxMsgTemplateIdWithRoadshowDeleteNotice = "rciDm9ThigRBGi1SZ4TFd74XA4aoAxSz_ugdv_tZ450" //路演->研究员收到活动删除通知
|
|
|
-
|
|
|
- // 研报小程序
|
|
|
- WxMsgTemplateIdWithYbCommunityQuestion = "rciDm9ThigRBGi1SZ4TFd74XA4aoAxSz_ugdv_tZ450" // 研报小程序->问答社区回复通知
|
|
|
- WxMsgTemplateIdWithSealApplyFinished = "rciDm9ThigRBGi1SZ4TFd74XA4aoAxSz_ugdv_tZ450" // 用印申请-已签回通知
|
|
|
- UserTemplateIdByProduct = "-YjuPOB7Fqd-S3ilabYa6wvjDY9aXmeEfPN6DCiy-EY"
|
|
|
+ // 公共指标库相关
|
|
|
+ EDB_LIB_URL = config["edb_lib_url"]
|
|
|
+ APP_EDB_LIB_NAME_EN = config["app_edb_lib_name_en"]
|
|
|
+ EDB_LIB_Md5_KEY = config["edb_lib_md5_key"]
|
|
|
+
|
|
|
+ // 图表项目域名
|
|
|
+ PublicChartHost = config["public_chart_host"]
|
|
|
+
|
|
|
+ // 发送微信模板消息地址
|
|
|
+ SendWxTemplateMsgUrl = config["send_wx_template_msg_url"]
|
|
|
+
|
|
|
+ // 发送微信模板消息地址
|
|
|
+ SendTemplateMsgAuthorization = config["send_template_msg_authorization"]
|
|
|
+
|
|
|
+ // 语音分贝处理的地址
|
|
|
+ HandleVideoDecibelUrl = config["handle_video_decibel_url"]
|
|
|
+
|
|
|
+ // 英文研报分享的地址
|
|
|
+ EnglishShareUrl = config["english_share_url"]
|
|
|
+
|
|
|
+ // 报警服务地址
|
|
|
+ AlarmMsgUrl = config["alarm_msg_url"]
|
|
|
+
|
|
|
+ // ppt 转图片服务地址
|
|
|
+ Ppt2ImageUrl = config["ppt2_image_url"]
|
|
|
}
|
|
|
|
|
|
- //查研观向小助手
|
|
|
+ // ES配置
|
|
|
{
|
|
|
- //原有的模板ID
|
|
|
- WxPublicIdXzs = "wx9b5d7291e581233a" //查研观向小助手
|
|
|
- WxPublicSecretXzs = "f4d52e34021eee262dce9682b31f8861" //查研观向小助手
|
|
|
- WxMsgTemplateIdActivityChangeApplyXzs = "CB7bOl7f3viMG4s1uhRo7WM0Jbx3WvodKuIZ8A_z8fM" //查研观向活动变更通知-模板ID(小助手)
|
|
|
- TemplateIdByProductXzs = "-YjuPOB7Fqd-S3ilabYa6wvjDY9aXmeEfPN6DCiy-EY" //产品运行报告通知-模板ID(小助手)
|
|
|
+ ES_URL = config["es_url"]
|
|
|
+ ES_USERNAME = config["es_username"]
|
|
|
+ ES_PASSWORD = config["es_password"]
|
|
|
}
|
|
|
|
|
|
-}
|
|
|
-
|
|
|
-// 生产环境模板消息
|
|
|
-func WxRelease() {
|
|
|
- WxAppId = "wx4a844c734d8c8e56"
|
|
|
- WxAppSecret = "26c586e7ccb3c575433f0f37797b3eeb"
|
|
|
- WxId = "gh_b67e0049fb8c"
|
|
|
- //模板消息
|
|
|
+ // ES 索引
|
|
|
{
|
|
|
- TemplateIdByProduct = "Cp2wF8gvBtxyWV4DeYuI172oqwyYXVRSm3AyJO42d84"
|
|
|
- TemplateIdByCompanyApply = "yqaDUavXAKBpsPqTr0zYXAGIQYeCijZtWwFsT07wTbE"
|
|
|
- WxMsgTemplateIdActivityChangeApply = "dYg6iHooRq74PyCXmw_Ns7qdJZmbtLoKS2p2FKeaXl0"
|
|
|
- //销售跨部门领取客户通知
|
|
|
- TemplateIdByCompanyReceive = "-ccp916f5rjMhwj8CtOAW_d_Os6ran8q5okVCENg924"
|
|
|
- //销售"添加客户/领取客户"权限变更通知
|
|
|
- TemplateIdByCompanyReceivePermission = "rciDm9ThigRBGi1SZ4TFd74XA4aoAxSz_ugdv_tZ450"
|
|
|
- //路演
|
|
|
- WxMsgTemplateIdWithRoadshowPending = "1JG9fvKx9o9B-wkZe_gBFQQzMBnp07-hvpZI9QiFcKQ" //路演->研究员收到待处理的申请
|
|
|
- WxMsgTemplateIdWithRoadshowDetailResult = "rciDm9ThigRBGi1SZ4TFd74XA4aoAxSz_ugdv_tZ450" //路演->销售收到处理结果
|
|
|
- WxMsgTemplateIdWithRoadshowDeleteNotice = "rciDm9ThigRBGi1SZ4TFd74XA4aoAxSz_ugdv_tZ450" //路演->研究员收到活动删除通知
|
|
|
-
|
|
|
- // 研报小程序
|
|
|
- WxMsgTemplateIdWithYbCommunityQuestion = "rciDm9ThigRBGi1SZ4TFd74XA4aoAxSz_ugdv_tZ450" // 研报小程序->问答社区回复通知
|
|
|
- WxMsgTemplateIdWithSealApplyFinished = "rciDm9ThigRBGi1SZ4TFd74XA4aoAxSz_ugdv_tZ450" // 用印申请-已签回通知
|
|
|
- UserTemplateIdByProduct = "Cp2wF8gvBtxyWV4DeYuI172oqwyYXVRSm3AyJO42d84" //用户产品允许通知模版
|
|
|
+ DATA_INDEX_NAME = config["data_index_name"]
|
|
|
+ CHART_INDEX_NAME = config["chart_index_name"]
|
|
|
+ MY_CHART_INDEX_NAME = config["my_chart_index_name"]
|
|
|
+ EsReportIndexName = config["es_report_index_name"]
|
|
|
+ EsEnglishReportIndexName = config["es_english_report_index_name"]
|
|
|
}
|
|
|
|
|
|
- //查研观向小助手
|
|
|
+ // 微信相关
|
|
|
{
|
|
|
- //新的模板ID
|
|
|
- WxPublicIdXzs = "wxb7cb8a15abad5b8e" //查研观向小助手
|
|
|
- WxPublicSecretXzs = "f425ba2863084249722af1e2a5cfffd3" //查研观向小助手
|
|
|
- WxMsgTemplateIdActivityChangeApplyXzs = "7qe3i4MrGxAIPhJeMgoqqw6j0A_foUB65DLSmxKe05s" //查研观向活动变更通知-模板ID(小助手)
|
|
|
- TemplateIdByProductXzs = "tNcCUiK_uUkuxaFF7M9NP2RwLkw8uHFjG-TDIxGUKxo" //产品运行报告通知-模板ID(小助手)
|
|
|
+ //模板消息
|
|
|
+ TemplateIdByProduct = config["template_id_by_product"]
|
|
|
+ WxYbAppId = config["wx_yb_appid"] //弘则研报小程序
|
|
|
+ WxYbId = config["wx_yb_id"] // 研报小程序微信原始ID
|
|
|
+ WxYbAppSecret = config["wx_yb_app_secret"] // 研报小程序秘钥
|
|
|
+ wxYbPlatformStr := config["wx_yb_platform"]
|
|
|
+ if wxYbPlatformStr != `` {
|
|
|
+ WxYbPlatform, err = strconv.Atoi(wxYbPlatformStr) //弘则研报来源
|
|
|
+ if err != nil {
|
|
|
+ panic(any("配置文件读取wx_yb_platform错误 " + err.Error()))
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
-}
|
|
|
|
|
|
-// CrmOpenApiConfig 上海crm开放api配置
|
|
|
-func CrmOpenApiConfig() {
|
|
|
- if RunMode == "release" {
|
|
|
- CRM_OPEN_API_URL = "http://crm.hzinsights.com/openapi"
|
|
|
- CRM_OPEN_API_APP_KEY = "26945134"
|
|
|
- CRM_OPEN_API_APP_SECRET = "b99cb2bdec70d20156000f664ec5ac30"
|
|
|
- } else {
|
|
|
- CRM_OPEN_API_URL = "http://106.15.192.100:8100/openapi"
|
|
|
- CRM_OPEN_API_APP_KEY = "26945134"
|
|
|
- CRM_OPEN_API_APP_SECRET = "b99cb2bdec70d20156000f664ec5ac30"
|
|
|
+ // OSS相关
|
|
|
+ {
|
|
|
+ Endpoint = config["endpoint"]
|
|
|
+ Bucketname = config["bucket_name"]
|
|
|
+ Imghost = config["img_host"]
|
|
|
+ UploadDir = config["upload_dir"]
|
|
|
+ Upload_Audio_Dir = config["upload_audio_dir"]
|
|
|
+ AccessKeyId = config["access_key_id"]
|
|
|
+ AccessKeySecret = config["access_key_secret"]
|
|
|
}
|
|
|
-}
|
|
|
|
|
|
-// initQsOpenApiConfig 全时开放api配置
|
|
|
-func initQsOpenApiConfig() {
|
|
|
- QsAppID = "ed1cc7c87c97089263fc899fbab193b0"
|
|
|
- QsSecretKey = "d92b91265dbbc5e3af44edfb82503635"
|
|
|
- if RunMode == "release" {
|
|
|
- QsUserId = 22330940
|
|
|
- QsUserName = "1406228535@qq.com"
|
|
|
- } else {
|
|
|
- QsUserId = 19896481
|
|
|
- QsUserName = "pyan@hzinsights.com"
|
|
|
+ // OSS相关(前端使用)
|
|
|
+ {
|
|
|
+ AliStsScheme = config["ali_sts_scheme"]
|
|
|
+ RegionId = config["region_id"]
|
|
|
+ RoleArn = config["role_arn"]
|
|
|
+ RoleSessionName = config["role_session_name"]
|
|
|
+ RAMAccessKeyId = config["ram_access_key_id"]
|
|
|
+ RAMAccessKeySecret = config["ram_access_key_secret"]
|
|
|
+ STSTokenCacheKey = config["sts_token_cache_key"]
|
|
|
}
|
|
|
-}
|
|
|
|
|
|
-// 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"
|
|
|
+ // 阿里云邮箱配置
|
|
|
+ {
|
|
|
+ AliyunEmailAccountName = config["aliyun_email_account_name"]
|
|
|
+ AliyunEmailAccessKeyId = config["aliyun_email_access_key_id"]
|
|
|
+ AliyunEmailAccessKeySecret = config["aliyun_email_access_key_secret"]
|
|
|
+ AliyunEmailReplyAddress = config["aliyun_email_reply_address"]
|
|
|
+ AliyunEmailReplyAddressAlias = config["aliyun_email_reply_address_alias"]
|
|
|
}
|
|
|
-}
|
|
|
|
|
|
-// YiDongApiConfig 易董开放api配置
|
|
|
-func YiDongApiConfig() {
|
|
|
- if RunMode == "release" {
|
|
|
- YiDongHuaWeiYunUrl = "https://achievement.valueonline.cn/"
|
|
|
- } else {
|
|
|
- YiDongHuaWeiYunUrl = "https://achievement-test.valueonline.cn/"
|
|
|
+ // 腾讯云邮箱配置
|
|
|
+ {
|
|
|
+ TencentSDKSecretId = config["tencent_sdk_secret_id"] // 腾讯云主账号SecretId
|
|
|
+ TencentSDKSecretKey = config["tencent_sdk_secret_key"] // 腾讯云主账号SecretKey
|
|
|
+ TencentEmailFromEmailAddress = config["tencent_email_from_email_address"] // 腾讯云邮件发信地址
|
|
|
+
|
|
|
+ tencentEmailTemplateIDtr := config["tencent_email_template_id"]
|
|
|
+ if tencentEmailTemplateIDtr != `` {
|
|
|
+ tmpTencentEmailTemplateID, err := strconv.Atoi(tencentEmailTemplateIDtr) //弘则研报来源
|
|
|
+ if err != nil {
|
|
|
+ panic(any("配置文件读取tencent_email_template_id错误 " + err.Error()))
|
|
|
+ }
|
|
|
+ TencentEmailTemplateID = uint64(tmpTencentEmailTemplateID)
|
|
|
+ }
|
|
|
}
|
|
|
-}
|
|
|
|
|
|
-// initSystemServer 内部服务配置
|
|
|
-func initSystemServer() {
|
|
|
- if RunMode == "release" {
|
|
|
- // ppt 转图片服务地址
|
|
|
- Ppt2ImageUrl = "http://172.19.173.232:8086/v1/image/ppt2img"
|
|
|
- } else {
|
|
|
- // ppt 转图片服务地址
|
|
|
- Ppt2ImageUrl = "http://127.0.0.1:8086/v1/image/ppt2img"
|
|
|
+ // 科大讯飞
|
|
|
+ {
|
|
|
+
|
|
|
+ XfAPPID = config["xf_appid"]
|
|
|
+ XfAPIKey = config["xf_api_key"]
|
|
|
+ XfAPISecret = config["xf_api_secret"]
|
|
|
+ XfHostUrl = config["xf_host_url"]
|
|
|
+ XfOrigin = config["xf_origin"]
|
|
|
+ XfVcn = config["xf_vcn"]
|
|
|
}
|
|
|
|
|
|
-}
|
|
|
+ LibreOfficePath = config["libre_office_path"]
|
|
|
|
|
|
-//http://adminapi.brilliantstart.cn/admin/
|
|
|
-//http://adminapi.brilliantstart.cn/swagger/
|
|
|
-//http://8.136.199.33:8602/swagger/
|
|
|
+ // 初始化ES
|
|
|
+ initEs()
|
|
|
+}
|