Browse Source

wip:索引库配置

wangshan 7 months ago
parent
commit
7fee1e06a6

+ 7 - 0
src/jfw/modules/bigmember/src/config.yaml

@@ -6,3 +6,10 @@ etcd:
 powerCheckCenterKey: "powercheck.rpc" #权益校验中台
 userCenterKey: "usercenter.rpc" #用户中台rpc
 resourceCenterKey: "resource.rpc" #资源中台
+
+ma:
+  index: projectdetail
+  type: projectdetail
+  fields:
+    - projectname.pname
+    - detail

+ 127 - 124
src/jfw/modules/bigmember/src/config/config.go

@@ -1,116 +1,116 @@
 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/compatible"
-    ma "app.yhyue.com/moapp/jypkg/marketanalysis"
-    "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"
-    "jy/src/jfw/modules/bigmember/src/restriction"
+	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/compatible"
+	ma "app.yhyue.com/moapp/jypkg/marketanalysis"
+	"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"
+	"jy/src/jfw/modules/bigmember/src/restriction"
 )
 
 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"` //自定义报告限制项目个数
-        KeyWordsCount   int `json:"keyWordsCount"`   // 关键词数量附加词排除词加起来限制
-    } `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"` //自定义报告限制项目个数
+		KeyWordsCount   int `json:"keyWordsCount"`   // 关键词数量附加词排除词加起来限制
+	} `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"`
-    ContextOldVipLimit  int64    `json:"contextOldVipLimit"` //超级订阅部分用户:--- 超前项目权限
-    PotentialCount      int      `json:"potentialCount"`     //潜在客户 潜在竞争对手数据量
-    NewDataTime         int64    `json:"newDataTime"`        // 用于周边月报区分是否为新数据 、配置为p350发版的时间
-    ProjectCount        int      `json:"projectCount"`       //画像和报告项目明细最大数量
-    PortraitStartTime   int      `json:"portraitStartTime"`
-    PortraitDynamicTime int      `json:"portraitDynamicTime"`
-    PortraitCount       int      `json:"portraitCount"`
-    Nsq                 string   `json:"nsq"`
-    Nsq_topic           string   `json:"nsq_topic"`
-    AttachmentResPower  []string `json:"attachmentResPower"`
-    MsgMaxCount         int      `json:"msgMaxCount"`
-    AnalysisPDFPhone    string   `json:"analysisPDFPhone"`
-    PayUserCollLimit    int64    `json:"payUserCollLimit"`  //付费用户收藏数量最大限制
-    FreeUserCollLimit   int64    `json:"freeUserCollLimit"` //免费用户收藏数量最大限制
-    FollowCustomer      struct {
-        Member map[string]int //大会员 default 10个,商机版2.0 100个,专家版2.0 500个
-        Vip    struct { //超级订阅 新老版都是10个
-            New int
-            Old int
-        }
-        Ent struct { //商机管理 新老版都是10个
-            New int
-            Old int
-        }
-        EntService int //企业管理服务 10个
-        Free       int //免费用户 0个
-    }
-    MiniPortraitCacheTime int
-    RestrictionSwitch     bool
-    RestrictionDoPool     int
-    RestrictionWaitPool   int
-    BidSearchOldUserLimit int64 // p480  原/publicapply/bidcoll/power 接口返回值的isOld添加到isAdd接口
+	Claim struct {
+		Details  string `json:"details"`
+		ListPage string `json:"listPage"`
+	} `json:"claim"`
+	ContextOldVipLimit  int64    `json:"contextOldVipLimit"` //超级订阅部分用户:--- 超前项目权限
+	PotentialCount      int      `json:"potentialCount"`     //潜在客户 潜在竞争对手数据量
+	NewDataTime         int64    `json:"newDataTime"`        // 用于周边月报区分是否为新数据 、配置为p350发版的时间
+	ProjectCount        int      `json:"projectCount"`       //画像和报告项目明细最大数量
+	PortraitStartTime   int      `json:"portraitStartTime"`
+	PortraitDynamicTime int      `json:"portraitDynamicTime"`
+	PortraitCount       int      `json:"portraitCount"`
+	Nsq                 string   `json:"nsq"`
+	Nsq_topic           string   `json:"nsq_topic"`
+	AttachmentResPower  []string `json:"attachmentResPower"`
+	MsgMaxCount         int      `json:"msgMaxCount"`
+	AnalysisPDFPhone    string   `json:"analysisPDFPhone"`
+	PayUserCollLimit    int64    `json:"payUserCollLimit"`  //付费用户收藏数量最大限制
+	FreeUserCollLimit   int64    `json:"freeUserCollLimit"` //免费用户收藏数量最大限制
+	FollowCustomer      struct {
+		Member map[string]int //大会员 default 10个,商机版2.0 100个,专家版2.0 500个
+		Vip    struct {       //超级订阅 新老版都是10个
+			New int
+			Old int
+		}
+		Ent struct { //商机管理 新老版都是10个
+			New int
+			Old int
+		}
+		EntService int //企业管理服务 10个
+		Free       int //免费用户 0个
+	}
+	MiniPortraitCacheTime int
+	RestrictionSwitch     bool
+	RestrictionDoPool     int
+	RestrictionWaitPool   int
+	BidSearchOldUserLimit int64 // p480  原/publicapply/bidcoll/power 接口返回值的isOld添加到isAdd接口
 }
 
 type CustomerInfo struct {
-    Name   string `json:"name"`
-    Wxer   string `json:"wxer"`
-    Remark string `json:"remark"`
-    Vip    bool   `json:"vip"`
+	Name   string `json:"name"`
+	Wxer   string `json:"wxer"`
+	Remark string `json:"remark"`
+	Vip    bool   `json:"vip"`
 }
 type followConfig struct {
-    Normal int
-    BigVip int
+	Normal int
+	BigVip int
 }
 
 var Config *config
@@ -119,27 +119,30 @@ var Middleground *middleground.Middleground
 var Compatible *compatible.Compatible
 
 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()
-    Middleground = middleground.NewMiddleground(g.Cfg().MustGet(ctx, "etcd.hosts").Strings()).
-        RegPowerCheckCenter(g.Cfg().MustGet(ctx, "powerCheckCenterKey").String()).
-        RegUserCenter(g.Cfg().MustGet(ctx, "userCenterKey").String()).
-        RegResourceCenter(g.Cfg().MustGet(ctx, "resourceCenterKey").String())
-    if Config.RestrictionSwitch {
-        restriction.ReqLimitInit(Config.RestrictionDoPool, Config.RestrictionWaitPool)
-    }
-    //定制化报告
-    ma.MAInit(Config.MarketAnalysisPool.Limit, Config.MarketAnalysisPool.TimeOut, Config.MarketAnalysisPool.ProjectNumLimit, Config.MarketAnalysisPool.KeyWordsCount, Config.ProjectCount)
+	//程序配置文件
+	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()).
+		RegUserCenter(g.Cfg().MustGet(ctx, "userCenterKey").String()).
+		RegResourceCenter(g.Cfg().MustGet(ctx, "resourceCenterKey").String())
+	if Config.RestrictionSwitch {
+		restriction.ReqLimitInit(Config.RestrictionDoPool, Config.RestrictionWaitPool)
+	}
+	//定制化报告
+	ptIndex := g.Cfg().MustGet(gctx.New(), "ma.index").String()
+	ptType := g.Cfg().MustGet(gctx.New(), "ma.type").String()
+	fields := g.Cfg().MustGet(gctx.New(), "ma.fields").Strings()
+	ma.MAInit(Config.MarketAnalysisPool.Limit, Config.MarketAnalysisPool.TimeOut, Config.MarketAnalysisPool.ProjectNumLimit, Config.MarketAnalysisPool.KeyWordsCount, Config.ProjectCount, ptType, ptIndex, fields)
 }

+ 1 - 1
src/jfw/modules/bigmember/src/go.mod

@@ -5,7 +5,7 @@ go 1.20
 require (
 	app.yhyue.com/moapp/jybase v0.0.0-20240226084952-7e7b38ef8a66
 	app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545
-	app.yhyue.com/moapp/jypkg v1.28.4
+	app.yhyue.com/moapp/jypkg v1.28.6
 	bp.jydev.jianyu360.cn/BaseService/powerCheckCenter v0.0.0-20241213060113-ac41966a58ec
 	bp.jydev.jianyu360.cn/BaseService/userCenter v1.2.18
 	github.com/donnie4w/go-logger v0.0.0-20230316073421-36a48f87a69a

+ 2 - 2
src/jfw/modules/bigmember/src/go.sum

@@ -20,8 +20,8 @@ app.yhyue.com/moapp/jybase v0.0.0-20240226084952-7e7b38ef8a66/go.mod h1:XHNATN6t
 app.yhyue.com/moapp/jyfs v0.0.0-20231024061508-480c270480d4/go.mod h1:61hzZ3dZHXL28BNl8BOgZsvM2S5UVY5YFzOkEUPrSu4=
 app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545 h1:+Lak4m1zgsigQloOsvp8AJ+0XeX/+PGp9QP550xlbBQ=
 app.yhyue.com/moapp/jylog v0.0.0-20230522075550-05d7230ca545/go.mod h1:uFrsdUBFbETiJlEmr4PtJWPsZlUpPj2bHQRhryu6ggk=
-app.yhyue.com/moapp/jypkg v1.28.4 h1:Ag3E35MgmdcI1syztPq3FcNPZnAaRuGLQam6iNQmyIU=
-app.yhyue.com/moapp/jypkg v1.28.4/go.mod h1:7f9hBxeF9RTp6vhTMZ24k4VLsn7HJHyAXOx6qzA3xOw=
+app.yhyue.com/moapp/jypkg v1.28.6 h1:n4lr4XnEoh1C0IjxlA4yDcumqE0cH7RNf1h46Qs8ICo=
+app.yhyue.com/moapp/jypkg v1.28.6/go.mod h1:7f9hBxeF9RTp6vhTMZ24k4VLsn7HJHyAXOx6qzA3xOw=
 app.yhyue.com/moapp/message v0.0.0-20231204024949-8c7145bfc161 h1:WGi4OEIoqw6NpNFGioUEBZnjK9aBa+xJqf/5WY+QyhM=
 app.yhyue.com/moapp/message v0.0.0-20231204024949-8c7145bfc161/go.mod h1:0Oj8SB4pVjdCLD28sy2zyM3hS0WHGpNuVcakLW43GmI=
 bp.jydev.jianyu360.cn/BP/jynsq v0.0.0-20220222052708-ebc43af90698/go.mod h1:ojo/AUH9Yr1wzarEjOaNMkj1Cet/9r8IgLyba64Z52E=