Explorar o código

wip:商情推荐 推送标题调整

wangshan hai 1 ano
pai
achega
d60144fb3b
Modificáronse 5 ficheiros con 8 adicións e 7 borrados
  1. 0 1
      go.mod
  2. 0 3
      go.sum
  3. 1 0
      rpc/etc/message.yaml
  4. 6 3
      rpc/internal/common/task.go
  5. 1 0
      rpc/internal/config/config.go

+ 0 - 1
go.mod

@@ -6,7 +6,6 @@ require (
 	app.yhyue.com/moapp/jybase v0.0.0-20230901064756-2fc66b18db40
 	app.yhyue.com/moapp/jybase v0.0.0-20230901064756-2fc66b18db40
 	bp.jydev.jianyu360.cn/BaseService/gateway v1.3.4
 	bp.jydev.jianyu360.cn/BaseService/gateway v1.3.4
 	github.com/ClickHouse/clickhouse-go/v2 v2.2.0
 	github.com/ClickHouse/clickhouse-go/v2 v2.2.0
-	github.com/RoaringBitmap/roaring v1.5.0
 	github.com/go-xorm/xorm v0.7.9
 	github.com/go-xorm/xorm v0.7.9
 	github.com/gogf/gf/contrib/drivers/clickhouse/v2 v2.6.1
 	github.com/gogf/gf/contrib/drivers/clickhouse/v2 v2.6.1
 	github.com/robfig/cron/v3 v3.0.1
 	github.com/robfig/cron/v3 v3.0.1

+ 0 - 3
go.sum

@@ -76,7 +76,6 @@ github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q
 github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
 github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ=
 github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
 github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
 github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
 github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
-github.com/RoaringBitmap/roaring v1.5.0 h1:V0VCSiHjroItEYCM3guC8T83ehi5QMt3oM9EefTTOms=
 github.com/RoaringBitmap/roaring v1.5.0/go.mod h1:plvDsJQpxOC5bw8LRteu/MLWHsHez/3y6cubLI4/1yE=
 github.com/RoaringBitmap/roaring v1.5.0/go.mod h1:plvDsJQpxOC5bw8LRteu/MLWHsHez/3y6cubLI4/1yE=
 github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
 github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
 github.com/Shopify/sarama v1.30.0/go.mod h1:zujlQQx1kzHsh4jfV1USnptCQrHAEZ2Hk8fTKCulPVs=
 github.com/Shopify/sarama v1.30.0/go.mod h1:zujlQQx1kzHsh4jfV1USnptCQrHAEZ2Hk8fTKCulPVs=
@@ -104,7 +103,6 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24
 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
 github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
 github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
 github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
 github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
-github.com/bits-and-blooms/bitset v1.2.0 h1:Kn4yilvwNtMACtf1eYDlG8H77R07mZSPbMjLyS07ChA=
 github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA=
 github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA=
 github.com/bkaradzic/go-lz4 v1.0.0/go.mod h1:0YdlkowM3VswSROI7qDxhRvJ3sLhlFrRRwjwegp5jy4=
 github.com/bkaradzic/go-lz4 v1.0.0/go.mod h1:0YdlkowM3VswSROI7qDxhRvJ3sLhlFrRRwjwegp5jy4=
 github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
 github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
@@ -464,7 +462,6 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb
 github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
 github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
 github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
 github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
 github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
 github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
-github.com/mschoch/smat v0.2.0 h1:8imxQsjDm8yFEAVBe7azKmKSgzSkZXDuKkSq9374khM=
 github.com/mschoch/smat v0.2.0/go.mod h1:kc9mz7DoBKqDyiRL7VZN8KvXQMWeTaVnttLRXOlotKw=
 github.com/mschoch/smat v0.2.0/go.mod h1:kc9mz7DoBKqDyiRL7VZN8KvXQMWeTaVnttLRXOlotKw=
 github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
 github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
 github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
 github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=

+ 1 - 0
rpc/etc/message.yaml

@@ -95,4 +95,5 @@ IsFilterActive: true
 RedisFailureTime: 120
 RedisFailureTime: 120
 ThreadCount: 15
 ThreadCount: 15
 MsgLogLimit: 3000
 MsgLogLimit: 3000
+MsgTitlePS: "【商机情报】%s有新的采购计划"
 
 

+ 6 - 3
rpc/internal/common/task.go

@@ -72,10 +72,13 @@ func PushData(users []string, ids []int64, data *[]map[string]interface{}) {
 				link = append(link, mobLink)
 				link = append(link, mobLink)
 				link = append(link, mobLink)
 				link = append(link, mobLink)
 				link = append(link, mobLink)
 				link = append(link, mobLink)
-
+				var title = "您有一条专属商机情报"
+				if strings.Contains(config.ConfigJson.MsgTitlePS, "%s") {
+					title = fmt.Sprintf(config.ConfigJson.MsgTitlePS, common.InterfaceToStr(m["buyer"]))
+				}
 				iData := map[string]interface{}{
 				iData := map[string]interface{}{
 					"msg_type":    9,
 					"msg_type":    9,
-					"title":       "您有一条专属商机情报",
+					"title":       title,
 					"content":     fmt.Sprintf("【商机情报】%s", common.ObjToString(m["title"])),
 					"content":     fmt.Sprintf("【商机情报】%s", common.ObjToString(m["title"])),
 					"send_mode":   1,
 					"send_mode":   1,
 					"send_time":   time.Now().Format("2006-01-02 15:04:05"),
 					"send_time":   time.Now().Format("2006-01-02 15:04:05"),
@@ -263,7 +266,7 @@ func messageData(number int) *[]map[string]interface{} {
 	query := map[string]interface{}{
 	query := map[string]interface{}{
 		"yucetime": map[string]interface{}{"$gt": starttime, "$lt": enttime},
 		"yucetime": map[string]interface{}{"$gt": starttime, "$lt": enttime},
 	}
 	}
-	data, _ := entity.Bidding.Find("project_forecast", query, `{"yucetime": -1}`, `{"title":1,"_id":1}`, false, 0, number)
+	data, _ := entity.Bidding.Find("project_forecast", query, `{"yucetime": -1}`, `{"title":1,"_id":1,"buyer":1}`, false, 0, number)
 	return data
 	return data
 }
 }
 
 

+ 1 - 0
rpc/internal/config/config.go

@@ -39,6 +39,7 @@ type Config struct {
 	RedisFailureTime  int    `json:"RedisFailureTime"` //用户消息缓存失效时间
 	RedisFailureTime  int    `json:"RedisFailureTime"` //用户消息缓存失效时间
 	ThreadCount       int    `json:"ThreadCount"`      //线程锁,配置15个,用户hash取锁
 	ThreadCount       int    `json:"ThreadCount"`      //线程锁,配置15个,用户hash取锁
 	MsgLogLimit       int    `json:"MsgLogLimit"`      //加载消息记录条数
 	MsgLogLimit       int    `json:"MsgLogLimit"`      //加载消息记录条数
+	MsgTitlePS        string `json:"MsgTitlePS"`       //商情推荐标题前后缀
 }
 }
 
 
 type CHouseConfig struct {
 type CHouseConfig struct {