|
@@ -169,10 +169,14 @@ func init() {
|
|
|
code, _ := c.GetPostForm("s_code")
|
|
|
name, _ := c.GetPostForm("s_name")
|
|
|
rid, _ := c.GetPostForm("rid")
|
|
|
- projectset, _ := c.GetPostForm("projectset")
|
|
|
resultcoll, _ := c.GetPostForm("resultcoll")
|
|
|
- extinfo := checkClearScript(code, name, resultcoll, rid, projectset, luascript)
|
|
|
- c.JSON(200, gin.H{"rep": extinfo})
|
|
|
+ if rid == "" || resultcoll == "" {
|
|
|
+ c.JSON(200, gin.H{"rep": nil})
|
|
|
+ } else {
|
|
|
+ extinfo := checkClearScript(code, name, resultcoll, rid, luascript)
|
|
|
+ c.JSON(200, gin.H{"rep": extinfo})
|
|
|
+ }
|
|
|
+
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -334,7 +338,7 @@ func checkCoreScript(code, name, infoid, script string) interface{} {
|
|
|
}
|
|
|
|
|
|
//lua清理脚本测试
|
|
|
-func checkClearScript(code, name, resultcoll, _id, projectset, script string) interface{} {
|
|
|
+func checkClearScript(code, name, resultcoll, _id, script string) interface{} {
|
|
|
doc, _ := Mgo.FindById(resultcoll, _id, extract.Fields2)
|
|
|
data := elastic.Get(qu.ObjToString(ju.Config["mergetablealias"]), qu.ObjToString(ju.Config["mergetable"]), `{"query":{"term":{"list.infoid":"`+_id+`"}}}`)
|
|
|
kvMap := make(map[string][]map[string]interface{})
|