|
@@ -1,6 +1,7 @@
|
|
|
package stdlib
|
|
|
|
|
|
import (
|
|
|
+ "app.yhyue.com/moapp/jy_docs/services/partner"
|
|
|
"fmt"
|
|
|
"log"
|
|
|
"regexp"
|
|
@@ -106,6 +107,21 @@ func DocQuery(in *stdlib.DocQueryRequest) *stdlib.DocQueryResponse {
|
|
|
}
|
|
|
}
|
|
|
for _, v := range *list {
|
|
|
+ tags := strings.Split(common.ObjToString(v["docTags"]), "")
|
|
|
+ tmptags := []string{}
|
|
|
+ subTag := ""
|
|
|
+ for i := 0; i < len(tags); i++ {
|
|
|
+ dtpKey := fmt.Sprintf("p_%s_0_tag", tags[i]) //一级tag
|
|
|
+ if _, ok := partner.DocClassMap[dtpKey]; ok && len(tmptags) == 0 {
|
|
|
+ tmptags = append(tmptags, tags[i])
|
|
|
+ } else {
|
|
|
+ subTag = tags[i]
|
|
|
+ }
|
|
|
+ if subTag != "" && len(tags) > 0 {
|
|
|
+ tmptags = append(tmptags, subTag)
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
doc := &stdlib.Doc{
|
|
|
DocId: common.ObjToString(v["id"]),
|
|
|
DocName: common.ObjToString(v["docName"]),
|
|
@@ -119,7 +135,7 @@ func DocQuery(in *stdlib.DocQueryRequest) *stdlib.DocQueryResponse {
|
|
|
PreviewImgId: common.ObjToString(v["previewImgId"]),
|
|
|
ProductType: common.Int64All(v["productType"]),
|
|
|
Source: common.Int64All(v["source"]),
|
|
|
- DocTags: common.ObjToString(v["docTags"]),
|
|
|
+ DocTags: strings.Join(tmptags, ","),
|
|
|
}
|
|
|
highlight, _ := v["highlight"].(map[string][]string)
|
|
|
if len(highlight["docName"]) > 0 {
|