| | |
| | | return files, err |
| | | } |
| | | |
| | | func (api FileAnalysisApi) FindByStackId(stackId string, typ int,name string, page int, size int) (list []protomsg.FileAnalysis,err error) { |
| | | func (api FileAnalysisApi) FindByStackId(stackId string, typ int,name string, page int, size int) (bool,interface{}) { |
| | | url := api.getBasicUrl() + DATA_URL_PREFIX + "/fileAnalysis/findByStackId" |
| | | client := NewClient() |
| | | paramBody := map[string]string { |
| | |
| | | body, err := client.DoGetRequest(url, paramBody, nil) |
| | | if err != nil { |
| | | logPrint("err:",err) |
| | | return nil,err |
| | | return false,nil |
| | | } |
| | | |
| | | var res Result |
| | | if err = json.Unmarshal(body, &res); err != nil { |
| | | logPrint("unmarshal res err:",err) |
| | | return nil,err |
| | | return false,nil |
| | | } |
| | | |
| | | bytes, _ := json.Marshal(res.Data) |
| | | err = json.Unmarshal(bytes, &list) |
| | | if err != nil { |
| | | logPrint("unmarshal m err:",err) |
| | | return nil,err |
| | | } |
| | | |
| | | return list,nil |
| | | return res.Success,res.Data |
| | | } |
| | | |
| | | func (api FileAnalysisApi) GetFileAnalysisSet() (set protomsg.FileAnalysisSetting,err error) { |
| | |
| | | return set, err |
| | | } |
| | | |
| | | func (api FileAnalysisApi) UpdateProgress(id string, progress int) bool { |
| | | func (api FileAnalysisApi) UpdateProgress(ids []string, progress int) bool { |
| | | url := api.getBasicUrl() + DATA_URL_PREFIX + "/fileAnalysis/updateProgress" |
| | | client := NewClient() |
| | | paramBody := map[string]interface{} { |
| | | "id":id, |
| | | "ids":ids, |
| | | "progress": progress, |
| | | } |
| | | body,err := client.DoPostRequest(url,CONTENT_TYPE_JSON, paramBody,nil,nil) |