|
@@ -2295,6 +2295,11 @@ func KeyHandle(a_items map[string]interface{}) []interface{} {
|
|
}
|
|
}
|
|
return keyArr
|
|
return keyArr
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+var (
|
|
|
|
+ Rx = regexp.MustCompile("\n+")
|
|
|
|
+)
|
|
|
|
+
|
|
func MapToarr(data map[string][]interface{}) []*bxsubscribe.KeyItems {
|
|
func MapToarr(data map[string][]interface{}) []*bxsubscribe.KeyItems {
|
|
result := []*bxsubscribe.KeyItems{}
|
|
result := []*bxsubscribe.KeyItems{}
|
|
for k, v := range data {
|
|
for k, v := range data {
|
|
@@ -2305,7 +2310,19 @@ func MapToarr(data map[string][]interface{}) []*bxsubscribe.KeyItems {
|
|
keys.Notkey = common.ObjArrToStringArr(m["notkey"].([]interface{}))
|
|
keys.Notkey = common.ObjArrToStringArr(m["notkey"].([]interface{}))
|
|
}
|
|
}
|
|
if m["key"] != nil {
|
|
if m["key"] != nil {
|
|
- keys.Key = common.ObjArrToStringArr(m["key"].([]interface{}))
|
|
|
|
|
|
+ var (
|
|
|
|
+ key = common.ObjArrToStringArr(m["key"].([]interface{}))
|
|
|
|
+ keyWords []string
|
|
|
|
+ )
|
|
|
|
+ for _, kv := range key {
|
|
|
|
+ if strings.TrimSpace(Rx.ReplaceAllString(kv, " ")) != "" {
|
|
|
|
+ keyWords = append(keyWords, strings.TrimSpace(kv))
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if len(keyWords) == 0 {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+ keys.Key = keyWords
|
|
}
|
|
}
|
|
if m["matchway"] != nil {
|
|
if m["matchway"] != nil {
|
|
keys.Matchway = common.Int64All(m["matchway"])
|
|
keys.Matchway = common.Int64All(m["matchway"])
|