|
@@ -1,353 +1,353 @@
|
|
|
package config
|
|
|
|
|
|
import (
|
|
|
- "sort"
|
|
|
- "time"
|
|
|
+ "sort"
|
|
|
+ "time"
|
|
|
|
|
|
- "github.com/gogf/gf/v2/os/gctx"
|
|
|
+ "github.com/gogf/gf/v2/os/gctx"
|
|
|
|
|
|
- qutil "app.yhyue.com/moapp/jybase/common"
|
|
|
- . "app.yhyue.com/moapp/jybase/date"
|
|
|
- "app.yhyue.com/moapp/jybase/mail"
|
|
|
- qrpc "app.yhyue.com/moapp/jybase/rpc"
|
|
|
- "app.yhyue.com/moapp/jypkg/common/src/qfw/util/middleGround"
|
|
|
- "app.yhyue.com/moapp/jypkg/middleground"
|
|
|
- "github.com/gogf/gf/v2/frame/g"
|
|
|
- "github.com/gogf/gf/v2/os/gcfg"
|
|
|
+ qutil "app.yhyue.com/moapp/jybase/common"
|
|
|
+ . "app.yhyue.com/moapp/jybase/date"
|
|
|
+ "app.yhyue.com/moapp/jybase/mail"
|
|
|
+ qrpc "app.yhyue.com/moapp/jybase/rpc"
|
|
|
+ "app.yhyue.com/moapp/jypkg/common/src/qfw/util/middleGround"
|
|
|
+ "app.yhyue.com/moapp/jypkg/middleground"
|
|
|
+ "github.com/gogf/gf/v2/frame/g"
|
|
|
+ "github.com/gogf/gf/v2/os/gcfg"
|
|
|
)
|
|
|
|
|
|
type config struct {
|
|
|
- MongodbServers string
|
|
|
- MongodbPoolSize int
|
|
|
- MongodbName string
|
|
|
- Mongoent *mgoConf
|
|
|
- Mongobidding *mgoConf
|
|
|
- Mongolog *mgoConf
|
|
|
- MongoQyfw *mgoConf
|
|
|
- Elasticsearch string
|
|
|
- ElasticPoolSize int
|
|
|
- ElasticVersion string
|
|
|
- ElasticUserName string
|
|
|
- ElasticPassword string
|
|
|
- Redisaddrs string
|
|
|
- Appid string
|
|
|
- Appsecret string
|
|
|
- Webport string
|
|
|
- Webrpcport string
|
|
|
- Weixinrpc string
|
|
|
- Mysql struct {
|
|
|
- DbName string
|
|
|
- Address string
|
|
|
- UserName string
|
|
|
- PassWord string
|
|
|
- MaxOpenConns int
|
|
|
- MaxIdleConns int
|
|
|
- }
|
|
|
- BaseMysql struct {
|
|
|
- DbName string
|
|
|
- Address string
|
|
|
- UserName string
|
|
|
- PassWord string
|
|
|
- MaxOpenConns int
|
|
|
- MaxIdleConns int
|
|
|
- }
|
|
|
- PushMysql struct {
|
|
|
- DbName string
|
|
|
- Address string
|
|
|
- UserName string
|
|
|
- PassWord string
|
|
|
- MaxOpenConns int
|
|
|
- MaxIdleConns int
|
|
|
- }
|
|
|
- InfoMysql struct {
|
|
|
- DbName string
|
|
|
- Address string
|
|
|
- UserName string
|
|
|
- PassWord string
|
|
|
- MaxOpenConns int
|
|
|
- MaxIdleConns int
|
|
|
- }
|
|
|
- ActivityMysql struct {
|
|
|
- DbName string
|
|
|
- Address string
|
|
|
- UserName string
|
|
|
- PassWord string
|
|
|
- MaxOpenConns int
|
|
|
- MaxIdleConns int
|
|
|
- }
|
|
|
- AppPushServiceRpc string
|
|
|
- WebDomain string
|
|
|
- AppDomain string
|
|
|
- WxDomain string
|
|
|
- Mail []struct {
|
|
|
- Addr string
|
|
|
- Port int
|
|
|
- Pwd string
|
|
|
- User string
|
|
|
- }
|
|
|
- VipKeyMaxLength int64
|
|
|
- ExpireRemind []int
|
|
|
- WxTplExpire string
|
|
|
- TermValidity int
|
|
|
- OrderCountdown interface{}
|
|
|
- AllPayMoney int
|
|
|
- AutoMergeTime int64
|
|
|
- ProfitTitle string
|
|
|
- ProfitDescript string
|
|
|
- AccountMergeOnline string
|
|
|
- OptimalTime string
|
|
|
- ActivityName string
|
|
|
- ShareRedisName string
|
|
|
- Product map[string]bool
|
|
|
- SmsServiceRpc string
|
|
|
- Nsq string
|
|
|
- Nsq_Topic string
|
|
|
- UserCenterApi string
|
|
|
- ActivityOrderCountdown int64
|
|
|
- CompanySize int64
|
|
|
- WebSiteParameter struct {
|
|
|
- Addr string
|
|
|
- Action string
|
|
|
- Title string
|
|
|
- Content string
|
|
|
- Link string
|
|
|
- AndroidUrl string
|
|
|
- IosUrl string
|
|
|
- WeChatUrl string
|
|
|
- }
|
|
|
- KeywordsLimit int
|
|
|
- BreakRenewTipTime string
|
|
|
- TaskStartTime int64
|
|
|
- FinanceMail string
|
|
|
- EquityActive struct {
|
|
|
- Open bool `json:"open"` // 活动开关
|
|
|
- SiteMsg struct {
|
|
|
- CallPlatform string `json:"callPlatform"`
|
|
|
- MsgType int `json:"msgType"`
|
|
|
- Title string `json:"title"`
|
|
|
- Content string `json:"content"`
|
|
|
- Link string `json:"link"`
|
|
|
- AndroidUrl string `json:"androidUrl"`
|
|
|
- IosUrl string `json:"iosUrl"`
|
|
|
- WeChatUrl string `json:"weChatUrl"`
|
|
|
- } `json:"siteMsg"` // 站内信内容配置
|
|
|
- MailAlarm struct {
|
|
|
- To []string `json:"to"`
|
|
|
- Title string `json:"title"`
|
|
|
- ReTry int `json:"reTry"`
|
|
|
- Threshold map[string]struct {
|
|
|
- Name string `json:"name"`
|
|
|
- Value int `json:"value"`
|
|
|
- } `json:"threshold"` // 库存剩余阈值
|
|
|
- } `json:"mailAlarm"` // 库存告警
|
|
|
- Sms struct {
|
|
|
- Args []string `json:"args"` // 短信部分可配置参数
|
|
|
- Tid string `json:"tid"` // 短信模板id
|
|
|
- } `json:"sms"` // 短信配置
|
|
|
- SaleDep map[string]bool // 代用户下单业绩归属部门配置 只有业绩归属为运营部才赠送
|
|
|
- } `json:"equityActive"` // p459赠送视频权益活动配置
|
|
|
- PayRaffle struct {
|
|
|
- Open bool `json:"open"` // 活动开关
|
|
|
- SiteMsg struct {
|
|
|
- CallPlatform string `json:"callPlatform"`
|
|
|
- MsgType int `json:"msgType"`
|
|
|
- Title string `json:"title"`
|
|
|
- Content string `json:"content"`
|
|
|
- Link string `json:"link"`
|
|
|
- AndroidUrl string `json:"androidUrl"`
|
|
|
- IosUrl string `json:"iosUrl"`
|
|
|
- WeChatUrl string `json:"weChatUrl"`
|
|
|
- } `json:"siteMsg"`
|
|
|
- Activity map[string]struct {
|
|
|
- ActivityId bool `json:"activityId"` // 是否去查数据库活动表
|
|
|
- Name string `json:"name"`
|
|
|
- } `json:"activity"`
|
|
|
- } `json:"payRaffle"`
|
|
|
- NewOrderTime int64 `json:"newOrderTime"`
|
|
|
+ MongodbServers string
|
|
|
+ MongodbPoolSize int
|
|
|
+ MongodbName string
|
|
|
+ Mongoent *mgoConf
|
|
|
+ Mongobidding *mgoConf
|
|
|
+ Mongolog *mgoConf
|
|
|
+ MongoQyfw *mgoConf
|
|
|
+ Elasticsearch string
|
|
|
+ ElasticPoolSize int
|
|
|
+ ElasticVersion string
|
|
|
+ ElasticUserName string
|
|
|
+ ElasticPassword string
|
|
|
+ Redisaddrs string
|
|
|
+ Appid string
|
|
|
+ Appsecret string
|
|
|
+ Webport string
|
|
|
+ Webrpcport string
|
|
|
+ Weixinrpc string
|
|
|
+ Mysql struct {
|
|
|
+ DbName string
|
|
|
+ Address string
|
|
|
+ UserName string
|
|
|
+ PassWord string
|
|
|
+ MaxOpenConns int
|
|
|
+ MaxIdleConns int
|
|
|
+ }
|
|
|
+ BaseMysql struct {
|
|
|
+ DbName string
|
|
|
+ Address string
|
|
|
+ UserName string
|
|
|
+ PassWord string
|
|
|
+ MaxOpenConns int
|
|
|
+ MaxIdleConns int
|
|
|
+ }
|
|
|
+ PushMysql struct {
|
|
|
+ DbName string
|
|
|
+ Address string
|
|
|
+ UserName string
|
|
|
+ PassWord string
|
|
|
+ MaxOpenConns int
|
|
|
+ MaxIdleConns int
|
|
|
+ }
|
|
|
+ InfoMysql struct {
|
|
|
+ DbName string
|
|
|
+ Address string
|
|
|
+ UserName string
|
|
|
+ PassWord string
|
|
|
+ MaxOpenConns int
|
|
|
+ MaxIdleConns int
|
|
|
+ }
|
|
|
+ ActivityMysql struct {
|
|
|
+ DbName string
|
|
|
+ Address string
|
|
|
+ UserName string
|
|
|
+ PassWord string
|
|
|
+ MaxOpenConns int
|
|
|
+ MaxIdleConns int
|
|
|
+ }
|
|
|
+ AppPushServiceRpc string
|
|
|
+ WebDomain string
|
|
|
+ AppDomain string
|
|
|
+ WxDomain string
|
|
|
+ Mail []struct {
|
|
|
+ Addr string
|
|
|
+ Port int
|
|
|
+ Pwd string
|
|
|
+ User string
|
|
|
+ }
|
|
|
+ VipKeyMaxLength int64
|
|
|
+ ExpireRemind []int
|
|
|
+ WxTplExpire string
|
|
|
+ TermValidity int
|
|
|
+ OrderCountdown interface{}
|
|
|
+ AllPayMoney int
|
|
|
+ AutoMergeTime int64
|
|
|
+ ProfitTitle string
|
|
|
+ ProfitDescript string
|
|
|
+ AccountMergeOnline string
|
|
|
+ OptimalTime string
|
|
|
+ ActivityName string
|
|
|
+ ShareRedisName string
|
|
|
+ Product map[string]bool
|
|
|
+ SmsServiceRpc string
|
|
|
+ Nsq string
|
|
|
+ Nsq_Topic string
|
|
|
+ UserCenterApi string
|
|
|
+ ActivityOrderCountdown int64
|
|
|
+ CompanySize int64
|
|
|
+ WebSiteParameter struct {
|
|
|
+ Addr string
|
|
|
+ Action string
|
|
|
+ Title string
|
|
|
+ Content string
|
|
|
+ Link string
|
|
|
+ AndroidUrl string
|
|
|
+ IosUrl string
|
|
|
+ WeChatUrl string
|
|
|
+ }
|
|
|
+ KeywordsLimit int
|
|
|
+ BreakRenewTipTime string
|
|
|
+ TaskStartTime int64
|
|
|
+ FinanceMail string
|
|
|
+ EquityActive struct {
|
|
|
+ Open bool `json:"open"` // 活动开关
|
|
|
+ SiteMsg struct {
|
|
|
+ CallPlatform string `json:"callPlatform"`
|
|
|
+ MsgType int `json:"msgType"`
|
|
|
+ Title string `json:"title"`
|
|
|
+ Content string `json:"content"`
|
|
|
+ Link string `json:"link"`
|
|
|
+ AndroidUrl string `json:"androidUrl"`
|
|
|
+ IosUrl string `json:"iosUrl"`
|
|
|
+ WeChatUrl string `json:"weChatUrl"`
|
|
|
+ } `json:"siteMsg"` // 站内信内容配置
|
|
|
+ MailAlarm struct {
|
|
|
+ To []string `json:"to"`
|
|
|
+ Title string `json:"title"`
|
|
|
+ ReTry int `json:"reTry"`
|
|
|
+ Threshold map[string]struct {
|
|
|
+ Name string `json:"name"`
|
|
|
+ Value int `json:"value"`
|
|
|
+ } `json:"threshold"` // 库存剩余阈值
|
|
|
+ } `json:"mailAlarm"` // 库存告警
|
|
|
+ Sms struct {
|
|
|
+ Args []string `json:"args"` // 短信部分可配置参数
|
|
|
+ Tid string `json:"tid"` // 短信模板id
|
|
|
+ } `json:"sms"` // 短信配置
|
|
|
+ SaleDep map[string]bool // 代用户下单业绩归属部门配置 只有业绩归属为运营部才赠送
|
|
|
+ } `json:"equityActive"` // p459赠送视频权益活动配置
|
|
|
+ PayRaffle struct {
|
|
|
+ Open bool `json:"open"` // 活动开关
|
|
|
+ SiteMsg struct {
|
|
|
+ CallPlatform string `json:"callPlatform"`
|
|
|
+ MsgType int `json:"msgType"`
|
|
|
+ Title string `json:"title"`
|
|
|
+ Content string `json:"content"`
|
|
|
+ Link string `json:"link"`
|
|
|
+ AndroidUrl string `json:"androidUrl"`
|
|
|
+ IosUrl string `json:"iosUrl"`
|
|
|
+ WeChatUrl string `json:"weChatUrl"`
|
|
|
+ } `json:"siteMsg"`
|
|
|
+ Activity map[string]struct {
|
|
|
+ ActivityId bool `json:"activityId"` // 是否去查数据库活动表
|
|
|
+ Name string `json:"name"`
|
|
|
+ } `json:"activity"`
|
|
|
+ } `json:"payRaffle"`
|
|
|
+ NewOrderTime int64 `json:"newOrderTime"`
|
|
|
}
|
|
|
type mgoConf struct {
|
|
|
- Address string
|
|
|
- Size int
|
|
|
- DbName string
|
|
|
- ReplSet string
|
|
|
- Collection string
|
|
|
- Collection_change string
|
|
|
- UserName string
|
|
|
- Password string
|
|
|
+ Address string
|
|
|
+ Size int
|
|
|
+ DbName string
|
|
|
+ ReplSet string
|
|
|
+ Collection string
|
|
|
+ Collection_change string
|
|
|
+ UserName string
|
|
|
+ Password string
|
|
|
}
|
|
|
type timeTaskConfig struct {
|
|
|
- IsRun bool //是否执行定时任务
|
|
|
- ExpireRemind string //到期提醒
|
|
|
- SyncVipUpgrade string //同步未及时生效的数据
|
|
|
- CheckIsExpire string //定时更新用户vip状态
|
|
|
- UnpaidRemind struct {
|
|
|
- //未支付订单提醒
|
|
|
- AfterOrder int64 //下单后n小时提醒
|
|
|
- BeforeExpire int64 //n小时自动关闭提醒
|
|
|
- RemindDuration int //定时任务时间间隔
|
|
|
- LoadOrderDuration int //定时任务时间间隔
|
|
|
- LiveActiveAfterOrder int64 //直播活动下单后n小时提醒
|
|
|
- LiveActiveAfterOrders int64 //直播活动下单后n小时提醒(2次提醒)
|
|
|
- }
|
|
|
- CourseTask string //更新课程已下线状态
|
|
|
- MemberExpire string //大会员gengx到期时间
|
|
|
- MemberIsStart string //大会员用户开启时间
|
|
|
- MemberServiceIsExpire string //大会员用户服务开启或到期时间
|
|
|
- DataExportSendMailDuringMinute int //数据导出发送邮件定时任务
|
|
|
- UpdateDEStatus string //定时更新超时订单状态-2
|
|
|
- ProvinceExpire string //省份订阅包
|
|
|
- UpdateTimeLimitActivityOrderStatus string //限时活动取消订单定时任务
|
|
|
+ IsRun bool //是否执行定时任务
|
|
|
+ ExpireRemind string //到期提醒
|
|
|
+ SyncVipUpgrade string //同步未及时生效的数据
|
|
|
+ CheckIsExpire string //定时更新用户vip状态
|
|
|
+ UnpaidRemind struct {
|
|
|
+ //未支付订单提醒
|
|
|
+ AfterOrder int64 //下单后n小时提醒
|
|
|
+ BeforeExpire int64 //n小时自动关闭提醒
|
|
|
+ RemindDuration int //定时任务时间间隔
|
|
|
+ LoadOrderDuration int //定时任务时间间隔
|
|
|
+ LiveActiveAfterOrder int64 //直播活动下单后n小时提醒
|
|
|
+ LiveActiveAfterOrders int64 //直播活动下单后n小时提醒(2次提醒)
|
|
|
+ }
|
|
|
+ CourseTask string //更新课程已下线状态
|
|
|
+ MemberExpire string //大会员gengx到期时间
|
|
|
+ MemberIsStart string //大会员用户开启时间
|
|
|
+ MemberServiceIsExpire string //大会员用户服务开启或到期时间
|
|
|
+ DataExportSendMailDuringMinute int //数据导出发送邮件定时任务
|
|
|
+ UpdateDEStatus string //定时更新超时订单状态-2
|
|
|
+ ProvinceExpire string //省份订阅包
|
|
|
+ UpdateTimeLimitActivityOrderStatus string //限时活动取消订单定时任务
|
|
|
+ SubVipTipDuring SubVipTipDuring //超级订阅提醒
|
|
|
}
|
|
|
type messageConfig struct {
|
|
|
- WxTpl_SoonExpire *WxTplMsg //微信-超级订阅-即将到期
|
|
|
- WxTpl_Expired *WxTplMsg //微信-超级订阅-已到期
|
|
|
- WxTpl_BigMember_SoonExpire *WxTplMsg //微信-大会员-即将到期
|
|
|
- WxTpl_BigMember_Expired *WxTplMsg //微信-大会员-已到期
|
|
|
- WxTpl_Unpaid *WxTplMsg //未支付订单
|
|
|
- WxTpl_PaySuccess *WxTplMsg //支付成功
|
|
|
- WxTpl_DataReport *WxTplMsg //数据报告
|
|
|
- App_OnTrial_SoonExpire string //app-超级订阅-试用即将到期
|
|
|
- App_OnTrial_Expired string //app-超级订阅-试用已到期
|
|
|
- App_SoonExpire string //app-超级订阅-即将到期
|
|
|
- App_Expired string //app-超级订阅-已到期
|
|
|
- App_BigMember_SoonExpire string //app-大会员-即将到期
|
|
|
- App_BigMember_Expired string //app-大会员-已到期
|
|
|
- App_Unpaid string //app-订单未支付
|
|
|
- App_PaySuccess string //app-订单支付成功
|
|
|
- SubVipTipDuring SubVipTipDuring //超级订阅提醒
|
|
|
+ WxTpl_SoonExpire *WxTplMsg //微信-超级订阅-即将到期
|
|
|
+ WxTpl_Expired *WxTplMsg //微信-超级订阅-已到期
|
|
|
+ WxTpl_BigMember_SoonExpire *WxTplMsg //微信-大会员-即将到期
|
|
|
+ WxTpl_BigMember_Expired *WxTplMsg //微信-大会员-已到期
|
|
|
+ WxTpl_Unpaid *WxTplMsg //未支付订单
|
|
|
+ WxTpl_PaySuccess *WxTplMsg //支付成功
|
|
|
+ WxTpl_DataReport *WxTplMsg //数据报告
|
|
|
+ App_OnTrial_SoonExpire string //app-超级订阅-试用即将到期
|
|
|
+ App_OnTrial_Expired string //app-超级订阅-试用已到期
|
|
|
+ App_SoonExpire string //app-超级订阅-即将到期
|
|
|
+ App_Expired string //app-超级订阅-已到期
|
|
|
+ App_BigMember_SoonExpire string //app-大会员-即将到期
|
|
|
+ App_BigMember_Expired string //app-大会员-已到期
|
|
|
+ App_Unpaid string //app-订单未支付
|
|
|
+ App_PaySuccess string //app-订单支付成功
|
|
|
}
|
|
|
type SubVipTipDuring []struct {
|
|
|
- Day int64 `json:"day"` //到期前x天提醒
|
|
|
- Cycle int64 `json:"cycle"` //购买周期
|
|
|
+ Day int64 `json:"day"` //到期前x天提醒
|
|
|
+ Cycle int64 `json:"cycle"` //购买周期
|
|
|
}
|
|
|
|
|
|
type WxTplMsg struct {
|
|
|
- Id string
|
|
|
- Keyword1 *qrpc.TmplItem
|
|
|
- Keyword2 *qrpc.TmplItem
|
|
|
- Keyword3 *qrpc.TmplItem
|
|
|
- Keyword4 *qrpc.TmplItem
|
|
|
- Keyword44 *qrpc.TmplItem
|
|
|
+ Id string
|
|
|
+ Keyword1 *qrpc.TmplItem
|
|
|
+ Keyword2 *qrpc.TmplItem
|
|
|
+ Keyword3 *qrpc.TmplItem
|
|
|
+ Keyword4 *qrpc.TmplItem
|
|
|
+ Keyword44 *qrpc.TmplItem
|
|
|
}
|
|
|
type Invoice struct {
|
|
|
- Invoice_manager string
|
|
|
- Invoice_name string
|
|
|
- Invoice_nature string
|
|
|
- Tax_rate string
|
|
|
- Tax_policy string
|
|
|
- Invoice_interface_address string
|
|
|
- Code string
|
|
|
- Switch_paymch struct {
|
|
|
- Model int
|
|
|
- Time string
|
|
|
- }
|
|
|
- Invoice_switch bool
|
|
|
- Red_invoice_switch bool //红冲发票是否可用开关
|
|
|
- Red_invoice_msg string //提示信息
|
|
|
- Third_party_switch bool //第三方开票开关
|
|
|
- Order_createtime int64 //24年之前的订单不能开票
|
|
|
- SigningSubject string `json:"signing_subject"` //管理后台订单发票签约主体配置
|
|
|
- SubmitNum int64 `json:"submit_num"`
|
|
|
- Invoice_type map[string]bool //发票类型
|
|
|
+ Invoice_manager string
|
|
|
+ Invoice_name string
|
|
|
+ Invoice_nature string
|
|
|
+ Tax_rate string
|
|
|
+ Tax_policy string
|
|
|
+ Invoice_interface_address string
|
|
|
+ Code string
|
|
|
+ Switch_paymch struct {
|
|
|
+ Model int
|
|
|
+ Time string
|
|
|
+ }
|
|
|
+ Invoice_switch bool
|
|
|
+ Red_invoice_switch bool //红冲发票是否可用开关
|
|
|
+ Red_invoice_msg string //提示信息
|
|
|
+ Third_party_switch bool //第三方开票开关
|
|
|
+ Order_createtime int64 //24年之前的订单不能开票
|
|
|
+ SigningSubject string `json:"signing_subject"` //管理后台订单发票签约主体配置
|
|
|
+ SubmitNum int64 `json:"submit_num"`
|
|
|
+ Invoice_type map[string]bool //发票类型
|
|
|
}
|
|
|
|
|
|
type entnicheConfig struct {
|
|
|
- Price map[string]float64
|
|
|
- Discount float64
|
|
|
+ Price map[string]float64
|
|
|
+ Discount float64
|
|
|
}
|
|
|
|
|
|
type memberConfig struct {
|
|
|
- Price map[string]float64
|
|
|
- OriginalPrice map[string]float64
|
|
|
- Power struct {
|
|
|
- Formal_fwinner int //大会员正式用户中标预测项目数量
|
|
|
- Trial_fwinner int //大会员试用用户中标预测项目数量
|
|
|
- Trial_dproject int //大会员试用用户投标决策分析项目数量
|
|
|
- Trial_potential int //大会员试用用户潜在客户|竞争对手获取信息条数
|
|
|
- Trial_bidfile int //大会员试用用户文件解读次数
|
|
|
- Formal_enterprise int //大会员正式用户企业情报和监控功能企业数量
|
|
|
- Formal_project int //大会员正式用户关注项目数量
|
|
|
- Formal_customer int //大会员正式用户关注客户数量
|
|
|
- Formal_package int //大会员专家版2.0单日限量包数量
|
|
|
- Business_enterprise int //大会员商机版本2.0企业情报和监控功能企业数量
|
|
|
- Business_project int //大会员商机版2.0关注项目数量
|
|
|
- Business_package int //大会员商机版2.0单日限量包数量
|
|
|
- }
|
|
|
- AiForecastPack float64 //AI预测包价格
|
|
|
+ Price map[string]float64
|
|
|
+ OriginalPrice map[string]float64
|
|
|
+ Power struct {
|
|
|
+ Formal_fwinner int //大会员正式用户中标预测项目数量
|
|
|
+ Trial_fwinner int //大会员试用用户中标预测项目数量
|
|
|
+ Trial_dproject int //大会员试用用户投标决策分析项目数量
|
|
|
+ Trial_potential int //大会员试用用户潜在客户|竞争对手获取信息条数
|
|
|
+ Trial_bidfile int //大会员试用用户文件解读次数
|
|
|
+ Formal_enterprise int //大会员正式用户企业情报和监控功能企业数量
|
|
|
+ Formal_project int //大会员正式用户关注项目数量
|
|
|
+ Formal_customer int //大会员正式用户关注客户数量
|
|
|
+ Formal_package int //大会员专家版2.0单日限量包数量
|
|
|
+ Business_enterprise int //大会员商机版本2.0企业情报和监控功能企业数量
|
|
|
+ Business_project int //大会员商机版2.0关注项目数量
|
|
|
+ Business_package int //大会员商机版2.0单日限量包数量
|
|
|
+ }
|
|
|
+ AiForecastPack float64 //AI预测包价格
|
|
|
}
|
|
|
|
|
|
type bidfileConfig struct {
|
|
|
- Price float64
|
|
|
- File_number int
|
|
|
- AttachmentRPC string
|
|
|
+ Price float64
|
|
|
+ File_number int
|
|
|
+ AttachmentRPC string
|
|
|
}
|
|
|
|
|
|
// 数据导出配置文件
|
|
|
type DataExportConfig struct {
|
|
|
- UnitPrice_normal float64 `json:"unitPrice_normal"`
|
|
|
- UnitPrice_senior float64 `json:"unitPrice_senior"`
|
|
|
- Discount float64 `json:"discount"`
|
|
|
- OrderMinPrice float64 `json:"orderMinPrice"`
|
|
|
- Packs_validityYear int `json:"packs_validityYear"` //数据包有效期 暂时只有两年
|
|
|
- Packs_showList []struct {
|
|
|
- PackNum int `json:"packNum"`
|
|
|
- Normal_discount float64 `json:"normal_discount"`
|
|
|
- Senior_discount float64 `json:"senior_discount"`
|
|
|
- } `json:"packs_showList"` //在售数据包列表
|
|
|
- MsgMaxCount int `json:"msgMaxCount"`
|
|
|
- Standard_Fields []*ExeclCell `json:"standard"`
|
|
|
- Senior_Fields []*ExeclCell `json:"senior"`
|
|
|
- Mail_attach_content string `json:"mail_attach_content"`
|
|
|
- Mail_attach_pack_content string `json:"mail_attach_pack_content"`
|
|
|
- Mail_attach_pack_attachment string `json:"mail_attach_pack_attachment"`
|
|
|
- Mail_attach_common_attachment string `json:"mail_attach_common_attachment"`
|
|
|
- Mail_attach_content_key string `json:"mail_attach_content_key"`
|
|
|
- Mail_notice_content string `json:"mail_notice_content"`
|
|
|
- Mail_notice_title string `json:"mail_notice_title"`
|
|
|
- Mail_retry int `json:"mail_retry"`
|
|
|
- AuditPersons []string `json:"auditPersons"`
|
|
|
- Font Font `json:"font"`
|
|
|
- Mail_invoice_finance_content string `json:"mail_invoice_finance_content"` //to北京财务订单内容
|
|
|
- Mail_vip_invoice_finance_content string `json:"mail_vip_invoice_finance_content"` //vip订单 to北京财务申请发票内容
|
|
|
- Mail_ent_invoice_finance_content string `json:"mail_ent_invoice_finance_content"` //企业商机管理 to北京财务申请发票内容
|
|
|
- Mail_order_finance_content string `json:"mail_order_finance_content"` //to北京财务申请发票内容
|
|
|
- Finance_emails []string `json:"finance_emails"`
|
|
|
- ErrNote_emails []string `json:"errNote_emails"` //数据导出异常通知邮箱
|
|
|
- Qmxdomain string `json:"qmxdomain"`
|
|
|
- DataReportContent string `json:"dataReportContent"`
|
|
|
- ExcelReadyPath string `json:"excelReadyPath"`
|
|
|
- ExcelPayedPath string `json:"excelPayedPath"`
|
|
|
- ExcelEntPath string `json:"excelEntPath"`
|
|
|
+ UnitPrice_normal float64 `json:"unitPrice_normal"`
|
|
|
+ UnitPrice_senior float64 `json:"unitPrice_senior"`
|
|
|
+ Discount float64 `json:"discount"`
|
|
|
+ OrderMinPrice float64 `json:"orderMinPrice"`
|
|
|
+ Packs_validityYear int `json:"packs_validityYear"` //数据包有效期 暂时只有两年
|
|
|
+ Packs_showList []struct {
|
|
|
+ PackNum int `json:"packNum"`
|
|
|
+ Normal_discount float64 `json:"normal_discount"`
|
|
|
+ Senior_discount float64 `json:"senior_discount"`
|
|
|
+ } `json:"packs_showList"` //在售数据包列表
|
|
|
+ MsgMaxCount int `json:"msgMaxCount"`
|
|
|
+ Standard_Fields []*ExeclCell `json:"standard"`
|
|
|
+ Senior_Fields []*ExeclCell `json:"senior"`
|
|
|
+ Mail_attach_content string `json:"mail_attach_content"`
|
|
|
+ Mail_attach_pack_content string `json:"mail_attach_pack_content"`
|
|
|
+ Mail_attach_pack_attachment string `json:"mail_attach_pack_attachment"`
|
|
|
+ Mail_attach_common_attachment string `json:"mail_attach_common_attachment"`
|
|
|
+ Mail_attach_content_key string `json:"mail_attach_content_key"`
|
|
|
+ Mail_notice_content string `json:"mail_notice_content"`
|
|
|
+ Mail_notice_title string `json:"mail_notice_title"`
|
|
|
+ Mail_retry int `json:"mail_retry"`
|
|
|
+ AuditPersons []string `json:"auditPersons"`
|
|
|
+ Font Font `json:"font"`
|
|
|
+ Mail_invoice_finance_content string `json:"mail_invoice_finance_content"` //to北京财务订单内容
|
|
|
+ Mail_vip_invoice_finance_content string `json:"mail_vip_invoice_finance_content"` //vip订单 to北京财务申请发票内容
|
|
|
+ Mail_ent_invoice_finance_content string `json:"mail_ent_invoice_finance_content"` //企业商机管理 to北京财务申请发票内容
|
|
|
+ Mail_order_finance_content string `json:"mail_order_finance_content"` //to北京财务申请发票内容
|
|
|
+ Finance_emails []string `json:"finance_emails"`
|
|
|
+ ErrNote_emails []string `json:"errNote_emails"` //数据导出异常通知邮箱
|
|
|
+ Qmxdomain string `json:"qmxdomain"`
|
|
|
+ DataReportContent string `json:"dataReportContent"`
|
|
|
+ ExcelReadyPath string `json:"excelReadyPath"`
|
|
|
+ ExcelPayedPath string `json:"excelPayedPath"`
|
|
|
+ ExcelEntPath string `json:"excelEntPath"`
|
|
|
}
|
|
|
|
|
|
type ExeclCell struct {
|
|
|
- Name string `json:"name"` //名称
|
|
|
- Filed string `json:"filed"` //对应字段
|
|
|
- Width float64 `json:"width"` //宽度
|
|
|
- Color string `json:"color"` //北京颜色
|
|
|
- VMerge int `json:"vMerge"` //垂直合并单元格
|
|
|
- HMerge int `json:"hMerge"` //水平合并单元格
|
|
|
+ Name string `json:"name"` //名称
|
|
|
+ Filed string `json:"filed"` //对应字段
|
|
|
+ Width float64 `json:"width"` //宽度
|
|
|
+ Color string `json:"color"` //北京颜色
|
|
|
+ VMerge int `json:"vMerge"` //垂直合并单元格
|
|
|
+ HMerge int `json:"hMerge"` //水平合并单元格
|
|
|
}
|
|
|
|
|
|
type Font struct {
|
|
|
- Enabled bool `json:"enabled"`
|
|
|
- ConvertVersionDefault string `json:"convertVersionDefault"`
|
|
|
- UnConvertVersionDefault string `json:"unConvertVersionDefault"`
|
|
|
- MappingFileExt string `json:"mappingFileExt"`
|
|
|
- MappingFilePath string `json:"mappingFilePath"`
|
|
|
- RedisPool string `json:"redisPool"`
|
|
|
- RedisKey string `json:"redisKey"`
|
|
|
+ Enabled bool `json:"enabled"`
|
|
|
+ ConvertVersionDefault string `json:"convertVersionDefault"`
|
|
|
+ UnConvertVersionDefault string `json:"unConvertVersionDefault"`
|
|
|
+ MappingFileExt string `json:"mappingFileExt"`
|
|
|
+ MappingFilePath string `json:"mappingFilePath"`
|
|
|
+ RedisPool string `json:"redisPool"`
|
|
|
+ RedisKey string `json:"redisKey"`
|
|
|
}
|
|
|
|
|
|
type Integral struct {
|
|
|
- BasicIntegral int `json:"basicIntegral"` //最低积分基础购买额度
|
|
|
- BasicDiscount int `json:"basicDiscount"` //基础折扣
|
|
|
- ActiveIng bool `json:"activeIng"` //活动是否进行
|
|
|
- ActiveDiscount int `json:"activeDiscount"` //活动折扣
|
|
|
- SlewRate int `json:"slewRate"` //积分购买转换率
|
|
|
- IntegralHarvestHref string `json:"integralHarvestHref"` //调用充值积分接口
|
|
|
- IntegralBalanceCheckHref string `json:"integralBalanceCheckHref"` //积分余额接口
|
|
|
- Appid string `json:"appid"` //剑鱼标识,默认10000,其余待定
|
|
|
+ BasicIntegral int `json:"basicIntegral"` //最低积分基础购买额度
|
|
|
+ BasicDiscount int `json:"basicDiscount"` //基础折扣
|
|
|
+ ActiveIng bool `json:"activeIng"` //活动是否进行
|
|
|
+ ActiveDiscount int `json:"activeDiscount"` //活动折扣
|
|
|
+ SlewRate int `json:"slewRate"` //积分购买转换率
|
|
|
+ IntegralHarvestHref string `json:"integralHarvestHref"` //调用充值积分接口
|
|
|
+ IntegralBalanceCheckHref string `json:"integralBalanceCheckHref"` //积分余额接口
|
|
|
+ Appid string `json:"appid"` //剑鱼标识,默认10000,其余待定
|
|
|
}
|
|
|
|
|
|
// 积分
|
|
@@ -355,25 +355,25 @@ var IntegralConfig *Integral
|
|
|
|
|
|
// 卡卷
|
|
|
type Coupon struct {
|
|
|
- CouponUpdate string `json:"couponUpdate"` //卡卷中台api 修改卡卷状态地址
|
|
|
- CouponInfo string `json:"couponInfo"` //卡卷中台api 获取卡卷信息
|
|
|
- AppId string `json:"appId"`
|
|
|
- Products map[string]string `json:"products"`
|
|
|
- Giveinfo string `json:"giveinfo"` //中台 赠品api 获取赠品详情地址
|
|
|
- FindUserLotteryId string `json:"findUserLotteryId"` //获取user_prize的主键id
|
|
|
- GetAllActivity string `json:"getAllActivity"` //活动获取
|
|
|
- LotteryReceive string `json:"lotteryReceive"` //奖券领取
|
|
|
- UserLottery string `json:"userLottery"` //用户下的奖券
|
|
|
- LotteryInfo string `json:"lotteryInfo"` //奖券详情(新版)
|
|
|
- ChoosedProductId map[string][]int64 `json:"choosedProductId"` //选中的商品
|
|
|
+ CouponUpdate string `json:"couponUpdate"` //卡卷中台api 修改卡卷状态地址
|
|
|
+ CouponInfo string `json:"couponInfo"` //卡卷中台api 获取卡卷信息
|
|
|
+ AppId string `json:"appId"`
|
|
|
+ Products map[string]string `json:"products"`
|
|
|
+ Giveinfo string `json:"giveinfo"` //中台 赠品api 获取赠品详情地址
|
|
|
+ FindUserLotteryId string `json:"findUserLotteryId"` //获取user_prize的主键id
|
|
|
+ GetAllActivity string `json:"getAllActivity"` //活动获取
|
|
|
+ LotteryReceive string `json:"lotteryReceive"` //奖券领取
|
|
|
+ UserLottery string `json:"userLottery"` //用户下的奖券
|
|
|
+ LotteryInfo string `json:"lotteryInfo"` //奖券详情(新版)
|
|
|
+ ChoosedProductId map[string][]int64 `json:"choosedProductId"` //选中的商品
|
|
|
}
|
|
|
|
|
|
var CouponConfig *Coupon
|
|
|
|
|
|
type ResourceCfg struct {
|
|
|
- Product map[string]string `json:"product"`
|
|
|
- AttachmentDownPackPrice map[string]int `json:"attachmentDownPackPrice"`
|
|
|
- BuyerPortraitPackPrice map[string]int `json:"buyerPortraitPackPrice"`
|
|
|
+ Product map[string]string `json:"product"`
|
|
|
+ AttachmentDownPackPrice map[string]int `json:"attachmentDownPackPrice"`
|
|
|
+ BuyerPortraitPackPrice map[string]int `json:"buyerPortraitPackPrice"`
|
|
|
}
|
|
|
|
|
|
//数据导出配置文件-end
|
|
@@ -402,53 +402,52 @@ var AutoMergeTimeStamp int64
|
|
|
var Middleground *middleground.Middleground
|
|
|
|
|
|
func init() {
|
|
|
- //程序配置文件
|
|
|
- qutil.ReadConfig(&Config)
|
|
|
- qutil.ReadConfig("./timetask.json", &TimeTaskConfig)
|
|
|
- qutil.ReadConfig("./message.json", &MessageConfig)
|
|
|
- qutil.ReadConfig("./entniche.json", &EntnicheConfig)
|
|
|
- qutil.ReadConfig("./invoice.json", &InvoiceConfig)
|
|
|
- qutil.ReadConfig("./member.json", &MemberConfig)
|
|
|
- qutil.ReadConfig("./bidfile.json", &BidfileConfig)
|
|
|
- qutil.ReadConfig("./dataexport.json", &ExConf)
|
|
|
- qutil.ReadConfig("./integral.json", &IntegralConfig)
|
|
|
- qutil.ReadConfig("./coupon.json", &CouponConfig)
|
|
|
- qutil.ReadConfig("./resourcePack.json", &ResConf)
|
|
|
- qutil.ReadConfig("./baseApi.json", &middleGround.JyApiConfig) //初始化中台请求接口
|
|
|
- g.Cfg().GetAdapter().(*gcfg.AdapterFile).SetFileName("config.yaml")
|
|
|
- var ctx = gctx.New()
|
|
|
- Middleground = middleground.NewMiddleground(g.Cfg().MustGet(ctx, "etcd.hosts").Strings()).
|
|
|
- RegUserCenter(g.Cfg().MustGet(ctx, "userCenterKey").String()).
|
|
|
- RegPowerCheckCenter(g.Cfg().MustGet(ctx, "powerCheckCenterKey").String()).
|
|
|
- RegActivity(g.Cfg().MustGet(ctx, "activityKey").String()).
|
|
|
- RegJyBase(g.Cfg().MustGet(ctx, "bxbaseKey").String())
|
|
|
- for _, v := range Config.Mail {
|
|
|
- mail := &mail.GmailAuth{
|
|
|
- SmtpHost: v.Addr,
|
|
|
- SmtpPort: v.Port,
|
|
|
- User: v.User,
|
|
|
- Pwd: v.Pwd,
|
|
|
- }
|
|
|
- GmailAuth = append(GmailAuth, mail)
|
|
|
- }
|
|
|
- //支付配置文件
|
|
|
- qutil.ReadConfig("./pay_config.json", &PayConf)
|
|
|
- AliPayConf = PayConf["aliPay"].(map[string]interface{})
|
|
|
- WxPayConf = PayConf["wxPay"].(map[string]interface{})
|
|
|
+ //程序配置文件
|
|
|
+ qutil.ReadConfig(&Config)
|
|
|
+ qutil.ReadConfig("./timetask.json", &TimeTaskConfig)
|
|
|
+ qutil.ReadConfig("./message.json", &MessageConfig)
|
|
|
+ qutil.ReadConfig("./entniche.json", &EntnicheConfig)
|
|
|
+ qutil.ReadConfig("./invoice.json", &InvoiceConfig)
|
|
|
+ qutil.ReadConfig("./member.json", &MemberConfig)
|
|
|
+ qutil.ReadConfig("./bidfile.json", &BidfileConfig)
|
|
|
+ qutil.ReadConfig("./dataexport.json", &ExConf)
|
|
|
+ qutil.ReadConfig("./integral.json", &IntegralConfig)
|
|
|
+ qutil.ReadConfig("./coupon.json", &CouponConfig)
|
|
|
+ qutil.ReadConfig("./resourcePack.json", &ResConf)
|
|
|
+ qutil.ReadConfig("./baseApi.json", &middleGround.JyApiConfig) //初始化中台请求接口
|
|
|
+ g.Cfg().GetAdapter().(*gcfg.AdapterFile).SetFileName("config.yaml")
|
|
|
+ var ctx = gctx.New()
|
|
|
+ Middleground = middleground.NewMiddleground(g.Cfg().MustGet(ctx, "etcd.hosts").Strings()).
|
|
|
+ RegUserCenter(g.Cfg().MustGet(ctx, "userCenterKey").String()).
|
|
|
+ RegPowerCheckCenter(g.Cfg().MustGet(ctx, "powerCheckCenterKey").String()).
|
|
|
+ RegActivity(g.Cfg().MustGet(ctx, "activityKey").String()).
|
|
|
+ RegJyBase(g.Cfg().MustGet(ctx, "bxbaseKey").String())
|
|
|
+ for _, v := range Config.Mail {
|
|
|
+ mail := &mail.GmailAuth{
|
|
|
+ SmtpHost: v.Addr,
|
|
|
+ SmtpPort: v.Port,
|
|
|
+ User: v.User,
|
|
|
+ Pwd: v.Pwd,
|
|
|
+ }
|
|
|
+ GmailAuth = append(GmailAuth, mail)
|
|
|
+ }
|
|
|
+ //支付配置文件
|
|
|
+ qutil.ReadConfig("./pay_config.json", &PayConf)
|
|
|
+ AliPayConf = PayConf["aliPay"].(map[string]interface{})
|
|
|
+ WxPayConf = PayConf["wxPay"].(map[string]interface{})
|
|
|
|
|
|
- //微信
|
|
|
- Wxoauth = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=` + Config.Appid + `&redirect_uri=%s&response_type=code&scope=snsapi_base&state=%s#wechat_redirect`
|
|
|
- Wxoauthinfo = `https://api.weixin.qq.com/sns/oauth2/access_token?appid=` + Config.Appid + `&secret=` + Config.Appsecret + `&code=%s&grant_type=authorization_code`
|
|
|
+ //微信
|
|
|
+ Wxoauth = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=` + Config.Appid + `&redirect_uri=%s&response_type=code&scope=snsapi_base&state=%s#wechat_redirect`
|
|
|
+ Wxoauthinfo = `https://api.weixin.qq.com/sns/oauth2/access_token?appid=` + Config.Appid + `&secret=` + Config.Appsecret + `&code=%s&grant_type=authorization_code`
|
|
|
|
|
|
- //账户合并
|
|
|
- time, err := time.ParseInLocation(Date_Full_Layout, Config.AccountMergeOnline, time.Local)
|
|
|
- if err != nil {
|
|
|
- panic(err.(interface{}))
|
|
|
- }
|
|
|
- AutoMergeTimeStamp = time.Unix()
|
|
|
+ //账户合并
|
|
|
+ time, err := time.ParseInLocation(Date_Full_Layout, Config.AccountMergeOnline, time.Local)
|
|
|
+ if err != nil {
|
|
|
+ panic(err.(interface{}))
|
|
|
+ }
|
|
|
+ AutoMergeTimeStamp = time.Unix()
|
|
|
|
|
|
- sort.Slice(MessageConfig.SubVipTipDuring, func(i, j int) bool {
|
|
|
- return MessageConfig.SubVipTipDuring[i].Cycle > MessageConfig.SubVipTipDuring[j].Cycle
|
|
|
- })
|
|
|
- g.Dump(MessageConfig.SubVipTipDuring)
|
|
|
+ sort.Slice(TimeTaskConfig.SubVipTipDuring, func(i, j int) bool {
|
|
|
+ return TimeTaskConfig.SubVipTipDuring[i].Cycle > TimeTaskConfig.SubVipTipDuring[j].Cycle
|
|
|
+ })
|
|
|
}
|