|
@@ -5,6 +5,7 @@ import (
|
|
|
beeLogger "github.com/beego/bee/v2/logger"
|
|
|
"github.com/beego/beego/v2/server/web"
|
|
|
"github.com/rdlucklib/rdluck_tools/cache"
|
|
|
+ "strconv"
|
|
|
)
|
|
|
|
|
|
var (
|
|
@@ -29,16 +30,29 @@ var (
|
|
|
DesKey string // 接口返回加密KEY
|
|
|
APPNAME string //项目中文名称
|
|
|
EmailSendToUsers string // 邮件提醒人员
|
|
|
+ JhGnAppKey string // 聚合短信,国内AppKey
|
|
|
+)
|
|
|
+
|
|
|
+// ES配置
|
|
|
+var (
|
|
|
+ ES_URL string // ES服务器地址
|
|
|
+ ES_USERNAME string // ES账号
|
|
|
+ ES_PASSWORD string // ES密码
|
|
|
)
|
|
|
|
|
|
// 公共api内部服务调用
|
|
|
var (
|
|
|
// EDB_LIB_URL 公共指标库
|
|
|
- EDB_LIB_URL string
|
|
|
+ EDB_LIB_URL string
|
|
|
+ APP_EDB_LIB_NAME_EN string
|
|
|
+ EDB_LIB_Md5_KEY string
|
|
|
|
|
|
// SendWxTemplateMsgUrl 模板消息推送
|
|
|
SendWxTemplateMsgUrl string
|
|
|
|
|
|
+ // SendTemplateMsgAuthorization 模板推送秘钥
|
|
|
+ SendTemplateMsgAuthorization string
|
|
|
+
|
|
|
// HandleVideoDecibelUrl 处理音频分贝的url
|
|
|
HandleVideoDecibelUrl string
|
|
|
|
|
@@ -53,16 +67,28 @@ var (
|
|
|
|
|
|
// EnPolicyReportUrl 英文策略报告
|
|
|
EnPolicyReportUrl string
|
|
|
+
|
|
|
+ // GoogleTranslateUrl 谷歌翻译服务
|
|
|
+ GoogleTranslateUrl string
|
|
|
+
|
|
|
+ // AlarmMsgUrl 报警服务地址
|
|
|
+ AlarmMsgUrl string
|
|
|
+
|
|
|
+ // ChatUrl chatGPT服务地址
|
|
|
+ ChatUrl string
|
|
|
)
|
|
|
|
|
|
// 微信配置信息
|
|
|
var (
|
|
|
WxId string //微信原始ID
|
|
|
- WxAppId string
|
|
|
- WxAppSecret string
|
|
|
+ WxAppId string // 公众号appid
|
|
|
+ WxAppSecret string // 公众号秘钥
|
|
|
TemplateIdByProduct string //产品运行报告通知-模板ID
|
|
|
|
|
|
- WxYbAppId string // 研报小程序appid
|
|
|
+ WxYbAppId string // 研报小程序appid
|
|
|
+ WxYbId string // 研报小程序微信原始ID
|
|
|
+ WxYbAppSecret string // 研报小程序秘钥
|
|
|
+ WxYbPlatform int //弘则研报来源
|
|
|
)
|
|
|
|
|
|
// ES索引配置
|
|
@@ -75,17 +101,6 @@ var (
|
|
|
EsSemanticAnalysisDocIndexName string //ES语义分析文档索引名
|
|
|
)
|
|
|
|
|
|
-// 阿里云配置
|
|
|
-var (
|
|
|
- Bucketname string
|
|
|
- Endpoint string
|
|
|
- Imghost string
|
|
|
- UploadDir string
|
|
|
- Upload_Audio_Dir string
|
|
|
- AccessKeyId string
|
|
|
- AccessKeySecret string
|
|
|
-)
|
|
|
-
|
|
|
// 科大讯飞--语音合成
|
|
|
var (
|
|
|
XfSTATUS_FIRST_FRAME = 0 //第一帧标识
|
|
@@ -101,6 +116,44 @@ var (
|
|
|
XfVcn string //发言人
|
|
|
)
|
|
|
|
|
|
+// 阿里云配置
|
|
|
+var (
|
|
|
+ Bucketname string
|
|
|
+ Endpoint string
|
|
|
+ Imghost string
|
|
|
+ UploadDir string
|
|
|
+ Upload_Audio_Dir string
|
|
|
+ AccessKeyId string
|
|
|
+ AccessKeySecret string
|
|
|
+)
|
|
|
+
|
|
|
+// 阿里云oss前端上传用
|
|
|
+var (
|
|
|
+ RoleArn string
|
|
|
+ RoleSessionName string
|
|
|
+ RAMAccessKeyId string
|
|
|
+ RAMAccessKeySecret string
|
|
|
+ STSTokenCacheKey string
|
|
|
+)
|
|
|
+
|
|
|
+// 阿里云邮箱配置
|
|
|
+var (
|
|
|
+ AliyunEmailAccountName string
|
|
|
+ AliyunEmailAccessKeyId string
|
|
|
+ AliyunEmailAccessKeySecret string
|
|
|
+ AliyunEmailReplyAddress string
|
|
|
+ AliyunEmailReplyAddressAlias string
|
|
|
+)
|
|
|
+
|
|
|
+// 腾讯云邮箱配置
|
|
|
+var (
|
|
|
+ TencentSDKSecretId string // 腾讯云主账号SecretId
|
|
|
+ TencentSDKSecretKey string // 腾讯云主账号SecretKey
|
|
|
+
|
|
|
+ TencentEmailFromEmailAddress string // 腾讯云邮件发信地址
|
|
|
+ TencentEmailTemplateID uint64 // 云邮件模板ID
|
|
|
+)
|
|
|
+
|
|
|
// LibreOfficePath LibreOfficePath的地址
|
|
|
var LibreOfficePath string
|
|
|
|
|
@@ -168,40 +221,79 @@ func init() {
|
|
|
|
|
|
// 接口返回加密KEY
|
|
|
DesKey = config["des_key"]
|
|
|
+
|
|
|
// 邮件提醒人员
|
|
|
EmailSendToUsers = config["email_send_to_users"]
|
|
|
|
|
|
+ // 聚合短信,国内AppKey
|
|
|
+ JhGnAppKey = config["jh_gn_app_key"]
|
|
|
+
|
|
|
// ppt 转图片服务地址
|
|
|
Ppt2ImageUrl = config["ppt2_image_url"]
|
|
|
|
|
|
// 静态文件目录
|
|
|
STATIC_DIR = config["static_dir"]
|
|
|
|
|
|
- EDB_LIB_URL = config["edb_lib_url"]
|
|
|
+ // 系统内部服务地址
|
|
|
+ {
|
|
|
+ // 公共指标库相关
|
|
|
+ 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"]
|
|
|
+
|
|
|
+ // 发送微信模板消息地址
|
|
|
+ SendWxTemplateMsgUrl = config["send_wx_template_msg_url"]
|
|
|
|
|
|
- // 发送微信模板消息地址
|
|
|
- SendWxTemplateMsgUrl = config["send_wx_template_msg_url"]
|
|
|
+ // 发送微信模板消息地址
|
|
|
+ SendTemplateMsgAuthorization = config["send_template_msg_authorization"]
|
|
|
|
|
|
- // 语音分贝处理的地址
|
|
|
- HandleVideoDecibelUrl = config["handle_video_decibel_url"]
|
|
|
+ // 语音分贝处理的地址
|
|
|
+ HandleVideoDecibelUrl = config["handle_video_decibel_url"]
|
|
|
|
|
|
- // 弘则open api的地址
|
|
|
- HongzeOpenApiHost = config["hongze_open_api_host"]
|
|
|
+ // 弘则open api的地址
|
|
|
+ HongzeOpenApiHost = config["hongze_open_api_host"]
|
|
|
|
|
|
- // 英文研报分享的地址
|
|
|
- EnglishShareUrl = config["english_share_url"]
|
|
|
+ // 英文研报分享的地址
|
|
|
+ EnglishShareUrl = config["english_share_url"]
|
|
|
|
|
|
- // 策略报告地址
|
|
|
- EnPolicyReportUrl = config["en_policy_report_url"]
|
|
|
+ // 策略报告地址
|
|
|
+ EnPolicyReportUrl = config["en_policy_report_url"]
|
|
|
+
|
|
|
+ // 谷歌翻译服务地址
|
|
|
+ GoogleTranslateUrl = config["google_translate_url"]
|
|
|
+
|
|
|
+ // 报警服务地址
|
|
|
+ AlarmMsgUrl = config["alarm_msg_url"]
|
|
|
+
|
|
|
+ // chatGPT服务地址
|
|
|
+ ChatUrl = config["chat_url"]
|
|
|
+ }
|
|
|
+
|
|
|
+ // ES配置
|
|
|
+ {
|
|
|
+ ES_URL = config["es_url"]
|
|
|
+ ES_USERNAME = config["es_username"]
|
|
|
+ ES_PASSWORD = config["es_password"]
|
|
|
+ }
|
|
|
|
|
|
// 微信相关
|
|
|
{
|
|
|
- WxYbAppId = config["wx_yb_appid"] //弘则研报小程序
|
|
|
WxAppId = config["wx_appid"]
|
|
|
WxAppSecret = config["wx_app_secret"]
|
|
|
WxId = config["wx_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()))
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// OSS相关
|
|
@@ -215,6 +307,40 @@ func init() {
|
|
|
AccessKeySecret = config["access_key_secret"]
|
|
|
}
|
|
|
|
|
|
+ // OSS相关(前端使用)
|
|
|
+ {
|
|
|
+ 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"]
|
|
|
+ }
|
|
|
+
|
|
|
+ // 阿里云邮箱配置
|
|
|
+ {
|
|
|
+ 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"]
|
|
|
+ }
|
|
|
+
|
|
|
+ // 腾讯云邮箱配置
|
|
|
+ {
|
|
|
+ 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)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 科大讯飞
|
|
|
{
|
|
|
|