|
@@ -44,16 +44,34 @@ func (b *Pjob) CreateUserInterestWord() {
|
|
|
}
|
|
|
|
|
|
//遍历数据只做标题预览
|
|
|
-func (p *Pjob) EachInfoForView(mopenid string) map[string]interface{} {
|
|
|
+func (p *Pjob) EachInfoForView(mopenid, words string) map[string]interface{} {
|
|
|
defer func() {
|
|
|
if r := recover(); r != nil {
|
|
|
- fmt.Println("推送开始[E]", r)
|
|
|
+ log.Println("[E]", r)
|
|
|
+ for skip := 0; ; skip++ {
|
|
|
+ _, file, line, ok := runtime.Caller(skip)
|
|
|
+ if !ok {
|
|
|
+ break
|
|
|
+ }
|
|
|
+ go log.Printf("%v,%v\n", file, line)
|
|
|
+ }
|
|
|
}
|
|
|
}()
|
|
|
p.Cache = new(map[string]*[]*push.MemberInterest)
|
|
|
- *p.Cache = push.InitCache(p.Stype, mopenid)
|
|
|
+ if words != "" {
|
|
|
+ pm := push.MemberInterest{
|
|
|
+ Province: "A",
|
|
|
+ ProvinceVal: 0,
|
|
|
+ Interest: []string{words},
|
|
|
+ }
|
|
|
+ ss := []*push.MemberInterest{&pm}
|
|
|
+ *p.Cache = map[string]*[]*push.MemberInterest{
|
|
|
+ words: &ss,
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ *p.Cache = push.InitCache(p.Stype, mopenid)
|
|
|
+ }
|
|
|
p.CreateUserInterestWord()
|
|
|
-
|
|
|
session := mongodb.GetMgoConn()
|
|
|
defer mongodb.DestoryMongoConn(session)
|
|
|
q := `{"type":"` + p.Stype + `"}`
|
|
@@ -72,8 +90,11 @@ func (p *Pjob) EachInfoForView(mopenid string) map[string]interface{} {
|
|
|
res := p.Dfa.Analy(title)
|
|
|
if len(res) > 0 {
|
|
|
province := (*tmp)["area"].(string)
|
|
|
+
|
|
|
provinceVal := push.GetChoiceCode(province)
|
|
|
- (*tmp)["title"] = `[<span class='area'>` + province + `</span>]` + title
|
|
|
+ if "A" != province {
|
|
|
+ (*tmp)["title"] = `[<span class='area'>` + province + `</span>]` + title
|
|
|
+ }
|
|
|
for _, v := range res {
|
|
|
//根据关键词返回用户指针
|
|
|
tw := (*p.Cache)[v]
|
|
@@ -183,7 +204,9 @@ L1:
|
|
|
if len(res) > 0 {
|
|
|
province := (*tmp)["area"].(string)
|
|
|
provinceVal := push.GetChoiceCode(province)
|
|
|
- (*tmp)["title"] = `[<span class='area'>` + province + `</span>]` + title
|
|
|
+ if "A" != province {
|
|
|
+ (*tmp)["title"] = `[<span class='area'>` + province + `</span>]` + title
|
|
|
+ }
|
|
|
for _, v := range res {
|
|
|
//根据关键词返回用户指针
|
|
|
tw := (*cache)[v]
|