From ba664c06923ecca2b39691cb1f4644e434886e95 Mon Sep 17 00:00:00 2001
From: looper3339 <736321739@qq.com>
Date: 星期五, 21 二月 2020 15:45:20 +0800
Subject: [PATCH] add fileStack api
---
fileAnalysis.go | 21 ++++++++++++++++++++-
1 files changed, 20 insertions(+), 1 deletions(-)
diff --git a/fileAnalysis.go b/fileAnalysis.go
index b19e329..cfe4e44 100644
--- a/fileAnalysis.go
+++ b/fileAnalysis.go
@@ -25,6 +25,22 @@
return "http://"+api.Ip+":"+strconv.Itoa(api.Port)
}
+func (api FileAnalysisApi) Save(paramBody map[string]interface{}) bool {
+ url := api.getBasicUrl() + DATA_URL_PREFIX + "/fileAnalysis/save"
+ client := NewClient()
+ body,err := client.DoPostRequest(url,CONTENT_TYPE_JSON, paramBody,nil,nil)
+ if err != nil {
+ return false
+ }
+
+ var res Result
+ if err = json.Unmarshal(body, &res); err != nil {
+ return false
+ }
+
+ return res.Success
+}
+
func (api FileAnalysisApi) Show(id string) (bool,interface{}) {
url := api.getBasicUrl() + DATA_URL_PREFIX + "/fileAnalysis/show/"+id
client := NewClient()
@@ -41,11 +57,14 @@
return res.Success, res.Data
}
-func (api FileAnalysisApi) FindAllFile(fileName string) (bool,interface{}){
+func (api FileAnalysisApi) FindAllFile(fileName string,fType int, page int, size int) (bool,interface{}){
url := api.getBasicUrl() + DATA_URL_PREFIX + "/fileAnalysis/findAllFile"
client := NewClient()
paramQuery := map[string]string {
"fileName": fileName,
+ "type": strconv.Itoa(fType),
+ "page": strconv.Itoa(page),
+ "size": strconv.Itoa(size),
}
body, err := client.DoGetRequest(url, paramQuery, nil)
if err != nil {
--
Gitblit v1.8.0