| | |
| | | return files, err |
| | | } |
| | | |
| | | 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 { |
| | | "stackId": stackId, |
| | | "type": strconv.Itoa(typ), |
| | | "name": name, |
| | | "page": strconv.Itoa(page), |
| | | "size": strconv.Itoa(size), |
| | | } |
| | | body, err := client.DoGetRequest(url, paramBody, nil) |
| | | if err != nil { |
| | | logPrint("err:",err) |
| | | return false,nil |
| | | } |
| | | |
| | | var res Result |
| | | if err = json.Unmarshal(body, &res); err != nil { |
| | | logPrint("unmarshal res err:",err) |
| | | return false,nil |
| | | } |
| | | |
| | | return res.Success,res.Data |
| | | } |
| | | |
| | | func (api FileAnalysisApi) GetFileAnalysisSet() (set protomsg.FileAnalysisSetting,err error) { |
| | | url := api.getBasicUrl() + DATA_URL_PREFIX + "/fileSetting/show" |
| | | client := NewClient() |
| | |
| | | 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) |