package utils

import (
	"fmt"
	beeLogger "github.com/beego/bee/v2/logger"
	"github.com/beego/beego/v2/server/web"
	"github.com/rdlucklib/rdluck_tools/cache"
)

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 // 路演记录数据库
	MYSQL_URL_WEEKLY_TRIAL string // ETA试用
	MYSQL_URL_FMS          string // 财务系统
	MYSQL_URL_CYGX         string // 查研观向

	REDIS_CACHE string       //缓存地址
	Rc          *cache.Cache //redis缓存
	Re          error        //redis错误
)

var (
	STATIC_DIR string
)

// 微信配置信息
var (
	WxId                     string //微信原始ID
	WxAppId                  string
	WxAppSecret              string
	TemplateIdByProduct      string //产品运行报告通知-模板ID
	Wx_MFYX_Refund_NotifyUrl string //买方研选微信商户退款回调地址

	TemplateRedirectUrl                      string //模板消息跳转地址
	DayReportTemplateRedirectUrl             string //模板消息跳转地址（晨报、周报）
	TemplateIdByCompanyApply                 string //客户申请单审批通知-模板ID
	TemplateCompanyApplyRedirectUrl          string //审批单模板消息跳转地址
	TemplateIdByCompanyReceive               string //销售跨部门领取客户通知-模板ID
	TemplateIdByCompanyReceivePermission     string //销售"添加客户/领取客户"权限变更通知
	WxMsgTemplateIdActivityChangeApply       string //查研观向活动变更通知-模板ID
	WxMsgTemplateIdActivityChangeApplyXzs    string //查研观向活动变更通知-模板ID（小助手）
	TemplateIdByProductXzs                   string //产品运行报告通知-模板ID(小助手)
	WxMsgTemplateIdActivityApplyXzs          string //查研观向销售帮对应客户报名通知-模板ID
	WxMsgTemplateIdCompanyApprovalMessageRai string //权益销售签约成功通知查研观向小助手模版消息
	WxCygxAppId                              string //查研观向小程序APPID
	WxCygxAppSecret                          string //查研观向小程序 秘钥
	WxMsgTemplateIdAskByUser                 string //查研观向用户提问新消息推送ID
	WxCrmAppId                               string //随手办公小程序APPID
	WxPublicIdXzs                            string //查研观向小助手公众号
	WxPublicSecretXzs                        string //查研观向小助手公众号
	WxYbAppId                                string //弘则研报小程序APPID
	YiDongHuaWeiYunUrl                       string //易董 华为云请求域名
	YiDongZhengTongYunUrl                    string //易董 证通云请求域名
	YiDongZhengTongYunClientId               string //易董 证通云client_id
	YiDongZhengTongYunClientSecret           string //易董 证通云client_secret
	WxMsgTemplateIdWithRoadshowPending       string //路演->研究员收到待处理的申请
	WxMsgTemplateIdWithRoadshowDetailResult  string //路演->销售收到处理结果
	WxMsgTemplateIdWithRoadshowDeleteNotice  string //路演->研究员收到活动删除通知
	CYGX_WEB_URL                             string //查研观向web端网址
	CYGX_MFYX_URL                            string //查研观向web端网址
	WxMfyxAppId                              string //买方研选小程序APPID
	WxMfyxAppSecret                          string //买方研选小程序 秘钥

	WxMsgCategoryTemplateIdActivityChangeApply       string //买方研选活动变更通知-类目模板ID
	WxMsgCategoryTemplateIdActivityCancleApply       string //买方研选活动取消通知-类目模板ID
	WxMsgCategoryTemplateIdActivityPublishApply      string //买方研选关注的产业下，单个活动/研选报告发布通知-类目模板ID
	WxMsgCategoryTemplateIdCompanyApprovalMessageRai string //权益销售签约成功通知买方研选类目模版消息
	WxMsgCategoryTemplateIdActivityApply             string //后台研选活动给客户报名或取消报名模版消息

	WxMsgTemplateIdWithYbCommunityQuestion string // 研报小程序->问答社区回复通知
	WxMsgTemplateIdWithSealApplyFinished   string // 用印申请-已签回通知

	//内部员工公众号（弘则部门）
	AdminWxAppId            string
	AdminWxAppSecret        string
	UserTemplateIdByProduct string //客户产品运行报告通知-模板ID

)

var (
	THS_SendUrl string //同花顺地址url
	THS_PubKey  string //同花顺公钥
)

var (
	IndexName                      string //Es索引
	IndexNameArticleHistory        string //文章阅读记录Es索引
	IndexNameComprehensive         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语义分析文档索引名
)

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"
)

// LibreOfficePath LibreOfficePath的地址
var LibreOfficePath string

// 经济数据库
var (
	EDB_LIB_URL string
)

// 上海crm开放api配置
var (
	CRM_OPEN_API_URL        string
	CRM_OPEN_API_APP_KEY    string
	CRM_OPEN_API_APP_SECRET string
)

// 全时会议账号信息
var (
	QsAppID     string
	QsSecretKey string
	QsUserId    int64
	QsUserName  string
)

// 进门财经账号信息
var (
	COMEIN_URL      string
	COMEIN_APPID    string
	COMEIN_SECREKEY string
)

// 公共api内部服务调用
var (
	// SendWxTemplateMsgUrl 模板消息推送
	SendWxTemplateMsgUrl         string
	SendWxCategoryTemplateMsgUrl string
	// HandleVideoDecibelUrl 处理音频分贝的url
	HandleVideoDecibelUrl string
)

// ppt转图片服务的地址
var Ppt2ImageUrl string

// 开放openapi的地址
var HongzeOpenApiHost string

var EnglishShareUrl string //英文研报群发邮件分享地址

var EnPolicyReportUrl string

// MayCurBaseUrl 每刻报销地址
var MayCurBaseUrl string

// CrmEtaServerUrl CRM-ETA服务地址
var CrmEtaServerUrl string

// eta_forum_hub ETA社区桥接服务地址
var (
	ETA_FORUM_HUB_URL     string
	ETA_FORUM_HUB_NAME_EN string
	ETA_FORUM_HUB_MD5_KEY string
)

func init() {
	tmpRunMode, err := web.AppConfig.String("run_mode")
	if err != nil {
		panic(any("配置文件读取run_mode错误 " + err.Error()))
	}
	RunMode = tmpRunMode
	fmt.Println("RunMode:", RunMode)
	if RunMode == "" {
		localIp, err := GetLocalIP()
		fmt.Println("localIp:", localIp)
		if localIp == "10.0.0.123" {
			RunMode = "debug"
		} else {
			RunMode = "release"
		}
		fmt.Println("RunMode:", RunMode)
		configPath := `/home/code/config/hz_crm_api/conf/app.conf`
		fmt.Println("configPath:", configPath)
		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(any("配置文件读取错误 " + err.Error()))
	}
	beeLogger.Log.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"]
	MYSQL_LOG_URL = config["mysql_url_log"]
	MYSQL_URL_COMEIN_DATA = config["mysql_url_comein_data"]
	MYSQL_URL_WEEKLY_TRIAL = config["mysql_url_weekly_trial"]
	MYSQL_URL_FMS = config["mysql_url_fms"]
	MYSQL_URL_CYGX = config["mysql_url_cygx"]

	REDIS_CACHE = config["beego_cache"]
	if len(REDIS_CACHE) <= 0 {
		panic(any("redis链接参数没有配置"))
	}
	Rc, Re = cache.NewCache(REDIS_CACHE) //初始化缓存
	if Re != nil {
		fmt.Println(Re)
		panic(any(Re))
	}
	WxCygxAppId = "wxcc32b61f96720d2f"                               //查研观向小程序
	WxCygxAppSecret = "06894933fafb24dafead7eaae09c08e0"             //查研观向小程序
	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"

	// 买方研选
	WxMfyxAppId = "wx5e3240ab90c247ac"
	WxMfyxAppSecret = "6b1316b46dc9c63429f5c1df6f51b4ac"

	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"
		IndexNameComprehensive = "cygx_comprehensive"
		CYGX_WEB_URL = "https://web.hzinsights.com"
		CYGX_MFYX_URL = "https://www.research-select.com"
		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"
		SendWxCategoryTemplateMsgUrl = "http://127.0.0.1:8086/v1/wechat/send_category_template_msg"
		HandleVideoDecibelUrl = "http://172.19.173.232:8086/v1/report/handle_video_decibel"
		HongzeOpenApiHost = "http://127.0.0.1:8609"
		EnglishShareUrl = "https://ybpcen.hzinsights.com"
		EnPolicyReportUrl = "https://en.hzinsights.com/v2api/"

		MayCurBaseUrl = "https://ng.maycur.com"

		// CRM-ETA服务地址
		CrmEtaServerUrl = "http://127.0.0.1:8708"

		// eta_forum_hub ETA社区桥接服务地址
		{
			ETA_FORUM_HUB_URL = config["eta_forum_hub_url"]
			ETA_FORUM_HUB_NAME_EN = config["eta_forum_hub_name_en"]
			ETA_FORUM_HUB_MD5_KEY = config["eta_forum_hub_md5_key"]
		}
	} 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"
		IndexNameComprehensive = "cygx_comprehensive_test"
		CYGX_WEB_URL = "https://clpttest.hzinsights.com"
		CYGX_MFYX_URL = "http://test.research-select.com"

		//同花顺测试地址
		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"
		SendWxCategoryTemplateMsgUrl = "http://127.0.0.1:8086/v1/wechat/send_category_template_msg"
		HandleVideoDecibelUrl = "http://127.0.0.1:8086/v1/report/handle_video_decibel"
		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/"

		//MayCurBaseUrl = "https://ng-uat.maycur.com"
		MayCurBaseUrl = "https://ng.maycur.com"

		// CRM-ETA服务地址
		CrmEtaServerUrl = "http://127.0.0.1:8702"

		// eta_forum_hub ETA社区桥接服务地址
		{
			ETA_FORUM_HUB_URL = config["eta_forum_hub_url"]
			ETA_FORUM_HUB_NAME_EN = config["eta_forum_hub_name_en"]
			ETA_FORUM_HUB_MD5_KEY = config["eta_forum_hub_md5_key"]
		}
	}
	tmpLibreOfficePath, err := web.AppConfig.String("libreOfficePath")
	if err != nil {
		panic(any("配置文件读取libreOfficePath错误 " + err.Error()))
	}
	LibreOfficePath = tmpLibreOfficePath

	//上海crm开放api配置
	CrmOpenApiConfig()

	//初始化全时开放api配置
	initQsOpenApiConfig()

	//进门财经开放api配置
	ComeinOpenApiConfig()

	//易董开放api配置
	YiDongApiConfig()

	// 初始化内部服务配置
	initSystemServer()

	//微信商户内部配置
	WxPayConfig()
}

// 测试环境模板消息
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 = "D6AFTJ7CbDDFBYg1R-HRir5bBXkIqGrwUtb2bjN-Wr4" //路演->销售收到处理结果
		WxMsgTemplateIdWithRoadshowDeleteNotice = "rciDm9ThigRBGi1SZ4TFd74XA4aoAxSz_ugdv_tZ450" //路演->研究员收到活动删除通知

		// 研报小程序
		WxMsgTemplateIdWithYbCommunityQuestion = "rciDm9ThigRBGi1SZ4TFd74XA4aoAxSz_ugdv_tZ450" // 研报小程序->问答社区回复通知
		WxMsgTemplateIdWithSealApplyFinished = "rciDm9ThigRBGi1SZ4TFd74XA4aoAxSz_ugdv_tZ450"   // 用印申请-已签回通知
		UserTemplateIdByProduct = "-YjuPOB7Fqd-S3ilabYa6wvjDY9aXmeEfPN6DCiy-EY"

		// 买方研选小程序
		WxMsgCategoryTemplateIdActivityChangeApply = "M975oDGwJXSX5rv4brhF4mbhl8LLoXcY_HzSKzQOtQs"       //买方研选活动变更通知-类目模板ID
		WxMsgCategoryTemplateIdActivityCancleApply = "NdnEwNmqTy8LSVGJNGSAEkTdG9U17Vk7dveqwroiTLM"       //买方研选活动取消通知-类目模板ID
		WxMsgCategoryTemplateIdActivityPublishApply = "wLeV7tVK4ZJBoAvsmfXkHveVW8yefGAkwnVKQWRi8uQ"      //买方研选活动报告发布通知-类目模板ID
		WxMsgCategoryTemplateIdCompanyApprovalMessageRai = "wU4x_c5XruwuA44VZelyklRNOfq4XrU9ILckTtDs6hg" //权益销售签约成功通知买方研选类目模版消息通知-类目模板ID
		WxMsgCategoryTemplateIdActivityApply = "IemWOTzbnLBqJ2ozSiFqm13WjaotoC3V4uXaxTij08I"             //后台研选活动给客户报名或取消报名模版消息
	}

	//查研观向小助手
	{
		//原有的模板ID
		WxPublicIdXzs = "wx9b5d7291e581233a"                                                     //查研观向小助手
		WxPublicSecretXzs = "f4d52e34021eee262dce9682b31f8861"                                   //查研观向小助手
		WxMsgTemplateIdActivityChangeApplyXzs = "CB7bOl7f3viMG4s1uhRo7WM0Jbx3WvodKuIZ8A_z8fM"    //查研观向活动变更通知-模板ID（小助手）
		TemplateIdByProductXzs = "-YjuPOB7Fqd-S3ilabYa6wvjDY9aXmeEfPN6DCiy-EY"                   //产品运行报告通知-模板ID(小助手)
		WxMsgTemplateIdActivityApplyXzs = "U3su--7d6xsCDcP6Tya0N0wWpKn_uI0zO1cutRK52cc"          //查研观向销售帮对应客户报名通知-模板ID
		WxMsgTemplateIdCompanyApprovalMessageRai = "RcV2uM5nFSiUtOHsq4SdYz2Fhk-OVfg5rutWz2IsSJQ" //权益销售签约成功通知查研观向小助手模版消息-模板ID
	}

}

// 生产环境模板消息
func WxRelease() {
	WxAppId = "wx4a844c734d8c8e56"
	WxAppSecret = "26c586e7ccb3c575433f0f37797b3eeb"
	WxId = "gh_b67e0049fb8c"
	//模板消息
	{
		TemplateIdByProduct = "Cp2wF8gvBtxyWV4DeYuI172oqwyYXVRSm3AyJO42d84"
		TemplateIdByCompanyApply = "yqaDUavXAKBpsPqTr0zYXAGIQYeCijZtWwFsT07wTbE"
		WxMsgTemplateIdActivityChangeApply = "dYg6iHooRq74PyCXmw_Ns7qdJZmbtLoKS2p2FKeaXl0"
		//销售跨部门领取客户通知
		TemplateIdByCompanyReceive = "-ccp916f5rjMhwj8CtOAW_d_Os6ran8q5okVCENg924"
		//销售"添加客户/领取客户"权限变更通知
		TemplateIdByCompanyReceivePermission = "rciDm9ThigRBGi1SZ4TFd74XA4aoAxSz_ugdv_tZ450"
		//路演
		WxMsgTemplateIdWithRoadshowPending = "1JG9fvKx9o9B-wkZe_gBFQQzMBnp07-hvpZI9QiFcKQ"      //路演->研究员收到待处理的申请
		WxMsgTemplateIdWithRoadshowDetailResult = "D6AFTJ7CbDDFBYg1R-HRir5bBXkIqGrwUtb2bjN-Wr4" //路演->销售收到处理结果
		WxMsgTemplateIdWithRoadshowDeleteNotice = "rciDm9ThigRBGi1SZ4TFd74XA4aoAxSz_ugdv_tZ450" //路演->研究员收到活动删除通知

		// 研报小程序
		WxMsgTemplateIdWithYbCommunityQuestion = "rciDm9ThigRBGi1SZ4TFd74XA4aoAxSz_ugdv_tZ450" // 研报小程序->问答社区回复通知
		WxMsgTemplateIdWithSealApplyFinished = "rciDm9ThigRBGi1SZ4TFd74XA4aoAxSz_ugdv_tZ450"   // 用印申请-已签回通知
		UserTemplateIdByProduct = "Cp2wF8gvBtxyWV4DeYuI172oqwyYXVRSm3AyJO42d84"                //用户产品允许通知模版

		// 买方研选小程序
		WxMsgCategoryTemplateIdActivityChangeApply = "mpaOZ8xGABHJE40KaK53vzMtn30Pe9nhYK54Vvl6f0E"       //买方研选活动变更通知-类目模板ID
		WxMsgCategoryTemplateIdActivityCancleApply = "N1oPORd3cHUJKAX6IZysZPQfemXv-ARf8iTYp0w0IvA"       //买方研选活动取消通知-类目模板ID
		WxMsgCategoryTemplateIdActivityPublishApply = "IBMqiE61lVgUfFM4rsH0XCH57R_G3PbWvRbnzg9JHPI"      //买方研选活动报告发布通知-类目模板ID
		WxMsgCategoryTemplateIdCompanyApprovalMessageRai = "t1CcxcOkoZkWZrDRs6zYUlceBGYMV3mhkBYUa8a6Mx0" //权益销售签约成功通知买方研选类目模版消息通知-类目模板ID
		WxMsgCategoryTemplateIdActivityApply = "HKD03oZfSv8LJgeoHz0pynai3G2Ls4h8zZ6BfOpZmIA"             //后台研选活动给客户报名或取消报名模版消息

	}

	//查研观向小助手
	{
		//新的模板ID
		WxPublicIdXzs = "wxb7cb8a15abad5b8e"                                                     //查研观向小助手
		WxPublicSecretXzs = "f425ba2863084249722af1e2a5cfffd3"                                   //查研观向小助手
		WxMsgTemplateIdActivityChangeApplyXzs = "7qe3i4MrGxAIPhJeMgoqqw6j0A_foUB65DLSmxKe05s"    //查研观向活动变更通知-模板ID（小助手）
		TemplateIdByProductXzs = "tNcCUiK_uUkuxaFF7M9NP2RwLkw8uHFjG-TDIxGUKxo"                   //产品运行报告通知-模板ID(小助手)
		WxMsgTemplateIdActivityApplyXzs = "mItHdTF6swcunM4P36lOjnLknGbHaLqYdbOsRKscBq4"          //查研观向销售帮对应客户报名通知-模板ID
		WxMsgTemplateIdCompanyApprovalMessageRai = "JlGx2rKZKIsolvkQ1ZbGSBDNzIIJAaF1bbwcdLuJwQ8" //权益销售签约成功通知查研观向小助手模版消息-模板ID
	}
}

// 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"
	}
}

// initQsOpenApiConfig 全时开放api配置
func initQsOpenApiConfig() {
	QsAppID = "ed1cc7c87c97089263fc899fbab193b0"
	QsSecretKey = "d92b91265dbbc5e3af44edfb82503635"
	if RunMode == "release" {
		QsUserId = 22330940
		QsUserName = "1406228535@qq.com"
	} else {
		QsUserId = 19896481
		QsUserName = "pyan@hzinsights.com"
	}
}

// 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"
	}
}

// YiDongApiConfig 易董开放api配置
func YiDongApiConfig() {
	if RunMode == "release" {
		YiDongHuaWeiYunUrl = "https://achievement.valueonline.cn/"
		YiDongZhengTongYunUrl = "https://services.valueonline.cn/"
		YiDongZhengTongYunClientId = "ca86a257ebb46fce"
		YiDongZhengTongYunClientSecret = "338db2b2ca86a257ebb46fced9003f53"
	} else {
		YiDongHuaWeiYunUrl = "https://achievement-test.valueonline.cn/"
		YiDongZhengTongYunUrl = "https://services-dev.valueonline.cn/"
		YiDongZhengTongYunClientId = "d9bfb79627ac30d0"
		YiDongZhengTongYunClientSecret = "96a61dd2d9bfb79627ac30d02188bbe2"
	}
}

// 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"
	}

}

// WxPayConfig 微信商户内部配置
func WxPayConfig() {
	if RunMode == "release" {
		Wx_MFYX_Refund_NotifyUrl = "https://mfyx.hzinsights.com/api/wechat/wxpay/refunds/notify/" //买方研选微信商户退款回调地址
	} else {
		Wx_MFYX_Refund_NotifyUrl = "https://testmfyx.hzinsights.com/api/wechat/wxpay/refunds/notify" //买方研选微信商户退款回调地址
	}
}

//http://adminapi.brilliantstart.cn/admin/
//http://adminapi.brilliantstart.cn/swagger/
//http://8.136.199.33:8602/swagger/
