|
@@ -1,79 +1,79 @@
|
|
|
package config
|
|
|
|
|
|
import (
|
|
|
- qutil "app.yhyue.com/moapp/jybase/common"
|
|
|
- "app.yhyue.com/moapp/jybase/mail"
|
|
|
- "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"
|
|
|
- "github.com/gogf/gf/v2/os/gctx"
|
|
|
+ qutil "app.yhyue.com/moapp/jybase/common"
|
|
|
+ "app.yhyue.com/moapp/jybase/mail"
|
|
|
+ "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"
|
|
|
+ "github.com/gogf/gf/v2/os/gctx"
|
|
|
)
|
|
|
|
|
|
type config struct {
|
|
|
- WebPort string
|
|
|
- Mail []struct {
|
|
|
- Addr string
|
|
|
- Port int
|
|
|
- Pwd string
|
|
|
- User string
|
|
|
- }
|
|
|
- PortraitPool int
|
|
|
- PortraitCacheDay int
|
|
|
- PortraitScreenPool int64
|
|
|
- RdProLimit int
|
|
|
- FollowPushRpc string
|
|
|
- FollowEnt followConfig
|
|
|
- FollowProject followConfig
|
|
|
- AttachmentRPC string
|
|
|
- AttachmentMail string
|
|
|
- AttachmentMailTitle string
|
|
|
- ReTry int
|
|
|
- Industry map[string]interface{}
|
|
|
- KeyMaxLength int
|
|
|
- WarnMailbox []string
|
|
|
- WarnMbTitle string
|
|
|
- TimeSpan int
|
|
|
- RegWinner string
|
|
|
- OldSubscribeMoveTip int64
|
|
|
- Customers []CustomerInfo
|
|
|
- NewFreeUser int64 //免费用户 -- 订阅升级新用户
|
|
|
- FileUploadNum map[string]int //每月附件下载次数
|
|
|
- CreatePdfServer string //生成pdf文件服务地址
|
|
|
- PdfServerPoor int //生成pdf线程数量控制
|
|
|
- PdfDataApiWhiteList []string //pdf数据接口白名单
|
|
|
- MainWebDomain string //附件剑鱼地址
|
|
|
- marketAnalysisPool int
|
|
|
- MarketAnalysisPool struct {
|
|
|
- Limit int `json:"limit"` //查询并发池
|
|
|
- TimeOut int `json:"timeOut"` //并发池等待超时时长,单位秒
|
|
|
- ProjectNumLimit int `json:"projectNumLimit"` //自定义报告限制项目个数
|
|
|
- } `json:"marketAnalysisPool"` //市场分析
|
|
|
- ForecastTime int //中标预测结果redis 缓存时间
|
|
|
- IsAddCacheTime int //isadd 接口数据存储时间 + 120 内随机数
|
|
|
- IsAddUrls struct {
|
|
|
- Free []string `json:"free"`
|
|
|
- Vip []string `json:"vip"`
|
|
|
- BigMember []string `json:"bigMember"`
|
|
|
- EntNiche []string `json:"entNiche"`
|
|
|
- }
|
|
|
- PotentialSwitch bool `json:"potentialSwitch"` //潜在客户 潜在竞争对手 新逻辑开关
|
|
|
- PortraitEntnicheCount int `json:"portraitEntnicheCount"` //商机管理 默认画像每月权限次数
|
|
|
+ WebPort string
|
|
|
+ Mail []struct {
|
|
|
+ Addr string
|
|
|
+ Port int
|
|
|
+ Pwd string
|
|
|
+ User string
|
|
|
+ }
|
|
|
+ PortraitPool int
|
|
|
+ PortraitCacheDay int
|
|
|
+ PortraitScreenPool int64
|
|
|
+ RdProLimit int
|
|
|
+ FollowPushRpc string
|
|
|
+ FollowEnt followConfig
|
|
|
+ FollowProject followConfig
|
|
|
+ AttachmentRPC string
|
|
|
+ AttachmentMail string
|
|
|
+ AttachmentMailTitle string
|
|
|
+ ReTry int
|
|
|
+ Industry map[string]interface{}
|
|
|
+ KeyMaxLength int
|
|
|
+ WarnMailbox []string
|
|
|
+ WarnMbTitle string
|
|
|
+ TimeSpan int
|
|
|
+ RegWinner string
|
|
|
+ OldSubscribeMoveTip int64
|
|
|
+ Customers []CustomerInfo
|
|
|
+ NewFreeUser int64 //免费用户 -- 订阅升级新用户
|
|
|
+ FileUploadNum map[string]int //每月附件下载次数
|
|
|
+ CreatePdfServer string //生成pdf文件服务地址
|
|
|
+ PdfServerPoor int //生成pdf线程数量控制
|
|
|
+ PdfDataApiWhiteList []string //pdf数据接口白名单
|
|
|
+ MainWebDomain string //附件剑鱼地址
|
|
|
+ marketAnalysisPool int
|
|
|
+ MarketAnalysisPool struct {
|
|
|
+ Limit int `json:"limit"` //查询并发池
|
|
|
+ TimeOut int `json:"timeOut"` //并发池等待超时时长,单位秒
|
|
|
+ ProjectNumLimit int `json:"projectNumLimit"` //自定义报告限制项目个数
|
|
|
+ } `json:"marketAnalysisPool"` //市场分析
|
|
|
+ ForecastTime int //中标预测结果redis 缓存时间
|
|
|
+ IsAddCacheTime int //isadd 接口数据存储时间 + 120 内随机数
|
|
|
+ IsAddUrls struct {
|
|
|
+ Free []string `json:"free"`
|
|
|
+ Vip []string `json:"vip"`
|
|
|
+ BigMember []string `json:"bigMember"`
|
|
|
+ EntNiche []string `json:"entNiche"`
|
|
|
+ }
|
|
|
+ PotentialSwitch bool `json:"potentialSwitch"` //潜在客户 潜在竞争对手 新逻辑开关
|
|
|
+ PortraitEntnicheCount int `json:"portraitEntnicheCount"` //商机管理 默认画像每月权限次数
|
|
|
|
|
|
- Claim struct {
|
|
|
- Details string `json:"details"`
|
|
|
- ListPage string `json:"listPage"`
|
|
|
- } `json:"claim"`
|
|
|
+ Claim struct {
|
|
|
+ Details string `json:"details"`
|
|
|
+ ListPage string `json:"listPage"`
|
|
|
+ } `json:"claim"`
|
|
|
}
|
|
|
|
|
|
type CustomerInfo struct {
|
|
|
- Name string `json:"name"`
|
|
|
- Wxer string `json:"wxer"`
|
|
|
- Remark string `json:"remark"`
|
|
|
+ Name string `json:"name"`
|
|
|
+ Wxer string `json:"wxer"`
|
|
|
+ Remark string `json:"remark"`
|
|
|
}
|
|
|
type followConfig struct {
|
|
|
- Normal int
|
|
|
- BigVip int
|
|
|
+ Normal int
|
|
|
+ BigVip int
|
|
|
}
|
|
|
|
|
|
var Config *config
|
|
@@ -81,19 +81,19 @@ var GmailAuth []*mail.GmailAuth
|
|
|
var Middleground *middleground.Middleground
|
|
|
|
|
|
func init() {
|
|
|
- //程序配置文件
|
|
|
- qutil.ReadConfig(&Config)
|
|
|
- qutil.ReadConfig("./baseApi.json", &middleGround.JyApiConfig) //初始化中台请求接口
|
|
|
- for _, v := range Config.Mail {
|
|
|
- mail := &mail.GmailAuth{
|
|
|
- SmtpHost: v.Addr,
|
|
|
- SmtpPort: v.Port,
|
|
|
- User: v.User,
|
|
|
- Pwd: v.Pwd,
|
|
|
- }
|
|
|
- GmailAuth = append(GmailAuth, mail)
|
|
|
- }
|
|
|
- g.Cfg().GetAdapter().(*gcfg.AdapterFile).SetFileName("config.yaml")
|
|
|
- var ctx = gctx.New()
|
|
|
+ //程序配置文件
|
|
|
+ qutil.ReadConfig(&Config)
|
|
|
+ qutil.ReadConfig("./baseApi.json", &middleGround.JyApiConfig) //初始化中台请求接口
|
|
|
+ for _, v := range Config.Mail {
|
|
|
+ mail := &mail.GmailAuth{
|
|
|
+ SmtpHost: v.Addr,
|
|
|
+ SmtpPort: v.Port,
|
|
|
+ User: v.User,
|
|
|
+ Pwd: v.Pwd,
|
|
|
+ }
|
|
|
+ GmailAuth = append(GmailAuth, mail)
|
|
|
+ }
|
|
|
+ g.Cfg().GetAdapter().(*gcfg.AdapterFile).SetFileName("config.yaml")
|
|
|
+ var ctx = gctx.New()
|
|
|
Middleground = middleground.NewMiddleground(g.Cfg().MustGet(ctx, "etcd.hosts").Strings()).RegPowerCheckCenter(g.Cfg().MustGet(ctx, "powerCheckCenterKey").String())
|
|
|
}
|