Explorar o código

feat:正文截取2

wangchuanjin hai 10 meses
pai
achega
6103ff7f50
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      jyBXSubscribe/rpc/model/push.go

+ 3 - 3
jyBXSubscribe/rpc/model/push.go

@@ -232,7 +232,7 @@ func (s *subscribePush) InfoFormat(p *PushCa, info *map[string]interface{}, isPa
 	}
 	isValidFile, _ := (*info)["isValidFile"].(bool)
 	detail := common.InterfaceToStr(common.If(isDetail, (*info)["detail"], ""))
-	detail = s.subStrDetail(strings.Join(p.Keys, " "), detail)
+	detail = subStrDetail(strings.Join(p.Keys, " "), detail)
 	formatInfo := &bxsubscribe.SubscribeInfo{
 		XId:            encrypt.EncodeArticleId2ByCheck(_id),
 		Title:          common.InterfaceToStr((*info)["title"]),
@@ -299,7 +299,7 @@ func (s *subscribePush) InfoFormat(p *PushCa, info *map[string]interface{}, isPa
 	return formatInfo
 
 }
-func (s *subscribePush) subStrDetail(matchKey, detail string) string {
+func subStrDetail(matchKey, detail string) string {
 	matchKeys := []string{}
 	for _, v := range regexp.MustCompile(`\s|\+`).Split(matchKey, -1) {
 		if v == "" {
@@ -995,7 +995,7 @@ func getDetail(Mgo_bidding mongodb.MongodbSim, bidding, bidding_back string, sub
 		if infos[id[0]] == nil {
 			continue
 		}
-		data.Detail = common.ObjToString(infos[id[0]]["detail"])
+		data.Detail = subStrDetail(strings.Join(data.MatchKeys, " "), common.ObjToString(infos[id[0]]["detail"]))
 	}
 }