|
@@ -250,7 +250,6 @@ func (r *Rule) ExportEs() {
|
|
|
//file, err := os.OpenFile("./es.json", os.O_RDWR|os.O_CREATE, 0666)
|
|
|
defer file.Close()
|
|
|
if err != nil {
|
|
|
- fmt.Println("Open File Err:", err)
|
|
|
r.ServeJson(map[string]interface{}{
|
|
|
"rep": false,
|
|
|
})
|
|
@@ -277,16 +276,13 @@ func createEsJosn(es string) {
|
|
|
return
|
|
|
}
|
|
|
fp, err := os.Create("./es.json")
|
|
|
- //fp, err := os.OpenFile("./download/es.json", os.O_RDWR|os.O_CREATE, 0755)
|
|
|
if err != nil {
|
|
|
- fmt.Println("Create File Err:", err)
|
|
|
return
|
|
|
}
|
|
|
defer fp.Close()
|
|
|
j, _ := json.Marshal(jmap)
|
|
|
_, err = fp.Write(j)
|
|
|
if err != nil {
|
|
|
- fmt.Println("Write File Err:", err)
|
|
|
return
|
|
|
}
|
|
|
}
|
|
@@ -344,7 +340,6 @@ func (r *Rule) ProductData() {
|
|
|
if r.Method() == "POST" {
|
|
|
rep := false
|
|
|
id := r.GetString("id")
|
|
|
- fmt.Println(id)
|
|
|
tag, _ := Mgo.FindById("tags", id, `{}`)
|
|
|
err, count := UtilEsFind(*tag)
|
|
|
if err == nil {
|
|
@@ -360,7 +355,7 @@ func (r *Rule) DownloadData() {
|
|
|
defer qu.Catch()
|
|
|
dataId := r.GetString("s_dataid")
|
|
|
if path := ResponseXlsx(dataId); path == "" {
|
|
|
- r.ServeJson("内部错误")
|
|
|
+ r.ServeJson("没有数据")
|
|
|
} else {
|
|
|
r.ServeFile(path)
|
|
|
}
|