| | |
| | | return files, err |
| | | } |
| | | |
| | | func (api FileAnalysisApi) FindByStackId(stackId string, typ int, page int, size int) (list []protomsg.FileAnalysis,err error) { |
| | | url := api.getBasicUrl() + DATA_URL_PREFIX + "/fileAnalysis/findByStackId" |
| | | client := NewClient() |
| | | paramBody := map[string]string { |
| | | "stackId": stackId, |
| | | "type": strconv.Itoa(typ), |
| | | "page": strconv.Itoa(page), |
| | | "size": strconv.Itoa(size), |
| | | } |
| | | body, err := client.DoGetRequest(url, paramBody, nil) |
| | | if err != nil { |
| | | logPrint("err:",err) |
| | | return nil,err |
| | | } |
| | | |
| | | var res Result |
| | | if err = json.Unmarshal(body, &res); err != nil { |
| | | logPrint("unmarshal res err:",err) |
| | | return nil,err |
| | | } |
| | | |
| | | bytes, _ := json.Marshal(res.Data) |
| | | err = json.Unmarshal(bytes, &list) |
| | | if err != nil { |
| | | logPrint("unmarshal m err:",err) |
| | | return nil,err |
| | | } |
| | | |
| | | return list,nil |
| | | } |
| | | |
| | | func (api FileAnalysisApi) GetFileAnalysisSet() (set protomsg.FileAnalysisSetting,err error) { |
| | | url := api.getBasicUrl() + DATA_URL_PREFIX + "/fileSetting/show" |
| | | client := NewClient() |