| | |
| | | import ( |
| | | "basic.com/pubsub/protomsg.git" |
| | | "encoding/json" |
| | | "errors" |
| | | "strconv" |
| | | ) |
| | | |
| | |
| | | func (api FileAnalysisApi) Save(paramBody map[string]interface{}) bool { |
| | | url := DATA_URL_PREFIX + "/fileAnalysis/save" |
| | | netNode := getNetNode(url2Topic(Topic_Stack_Service, url)) |
| | | if netNode == nil { |
| | | return false |
| | | } |
| | | client := NewClient(WithNodes(netNode)) |
| | | body,err := client.DoPostRequest(url,CONTENT_TYPE_JSON, paramBody,nil,nil) |
| | | if err != nil { |
| | |
| | | func (api FileAnalysisApi) Show(id string) (bool,interface{}) { |
| | | url := DATA_URL_PREFIX + "/fileAnalysis/show" |
| | | netNode := getNetNode(url2Topic(Topic_Stack_Service, url)) |
| | | if netNode == nil { |
| | | return false,nil |
| | | } |
| | | client := NewClient(WithNodes(netNode)) |
| | | paramQuery := map[string]string { |
| | | "id":id, |
| | |
| | | func (api FileAnalysisApi) FindAllFile(fileName string,fType int, page int, size int) (bool,interface{}){ |
| | | url := DATA_URL_PREFIX + "/fileAnalysis/findAllFile" |
| | | netNode := getNetNode(url2Topic(Topic_Stack_Service, url)) |
| | | if netNode == nil { |
| | | return false,nil |
| | | } |
| | | client := NewClient(WithNodes(netNode)) |
| | | paramQuery := map[string]string { |
| | | "fileName": fileName, |
| | |
| | | func (api FileAnalysisApi) GetAnalysisFiles() (files []protomsg.FileAnalysis,err error){ |
| | | url := DATA_URL_PREFIX + "/fileAnalysis/getAnalysisFiles" |
| | | netNode := getNetNode(url2Topic(Topic_Stack_Service, url)) |
| | | if netNode == nil { |
| | | return nil,errors.New("stack-service proc not found") |
| | | } |
| | | client := NewClient(WithNodes(netNode)) |
| | | |
| | | body, err := client.DoGetRequest(url, nil, nil) |
| | |
| | | func (api FileAnalysisApi) FindByStackId(stackId string, typ int,name string, page int, size int) (bool,interface{}) { |
| | | url := DATA_URL_PREFIX + "/fileAnalysis/findByStackId" |
| | | netNode := getNetNode(url2Topic(Topic_Stack_Service, url)) |
| | | if netNode == nil { |
| | | return false,nil |
| | | } |
| | | client := NewClient(WithNodes(netNode)) |
| | | paramBody := map[string]string { |
| | | "stackId": stackId, |
| | |
| | | func (api FileAnalysisApi) GetFileAnalysisSet() (set protomsg.FileAnalysisSetting,err error) { |
| | | url := DATA_URL_PREFIX + "/fileSetting/show" |
| | | netNode := getNetNode(url2Topic(Topic_Stack_Service, url)) |
| | | if netNode == nil { |
| | | return set,errors.New("stack-service proc not found") |
| | | } |
| | | client := NewClient(WithNodes(netNode)) |
| | | |
| | | body, err := client.DoGetRequest(url, nil, nil) |
| | |
| | | func (api FileAnalysisApi) UpdateProgress(ids []string, progress int) bool { |
| | | url := DATA_URL_PREFIX + "/fileAnalysis/updateProgress" |
| | | netNode := getNetNode(url2Topic(Topic_Stack_Service, url)) |
| | | if netNode == nil { |
| | | return false |
| | | } |
| | | client := NewClient(WithNodes(netNode)) |
| | | paramBody := map[string]interface{} { |
| | | "ids":ids, |
| | |
| | | func (api FileAnalysisApi) ChangeEnable(enable bool) bool { |
| | | url := DATA_URL_PREFIX + "/fileSetting/changeEnable" |
| | | netNode := getNetNode(url2Topic(Topic_Stack_Service, url)) |
| | | if netNode == nil { |
| | | return false |
| | | } |
| | | client := NewClient(WithNodes(netNode)) |
| | | paramBody := map[string]interface{} { |
| | | "enable":enable, |
| | |
| | | func (api FileAnalysisApi) UpdateStatus(idArr []string, status int) bool { |
| | | url := DATA_URL_PREFIX + "/fileAnalysis/updateStatus" |
| | | netNode := getNetNode(url2Topic(Topic_Stack_Service, url)) |
| | | if netNode == nil { |
| | | return false |
| | | } |
| | | client := NewClient(WithNodes(netNode)) |
| | | paramBody := map[string]interface{} { |
| | | "ids":idArr, |
| | |
| | | func (api FileAnalysisApi) Delete(idArr []string) bool { |
| | | url := DATA_URL_PREFIX + "/fileAnalysis/delete" |
| | | netNode := getNetNode(url2Topic(Topic_Stack_Service, url)) |
| | | if netNode == nil { |
| | | return false |
| | | } |
| | | client := NewClient(WithNodes(netNode)) |
| | | paramBody := map[string]interface{} { |
| | | "ids":idArr, |
| | |
| | | func (api FileAnalysisApi) SortFile(id string,direct int) bool { |
| | | url := DATA_URL_PREFIX + "/fileAnalysis/sortFile" |
| | | netNode := getNetNode(url2Topic(Topic_Stack_Service, url)) |
| | | if netNode == nil { |
| | | return false |
| | | } |
| | | client := NewClient(WithNodes(netNode)) |
| | | paramBody := map[string]interface{} { |
| | | "id": id, |
| | |
| | | func (api FileAnalysisApi) Rename(id string,name string) bool { |
| | | url := DATA_URL_PREFIX + "/fileAnalysis/rename" |
| | | netNode := getNetNode(url2Topic(Topic_Stack_Service, url)) |
| | | if netNode == nil { |
| | | return false |
| | | } |
| | | client := NewClient(WithNodes(netNode)) |
| | | paramBody := map[string]interface{} { |
| | | "id": id, |
| | |
| | | func (api FileAnalysisApi) Move(id string,stackId string) bool { |
| | | url := DATA_URL_PREFIX + "/fileAnalysis/move" |
| | | netNode := getNetNode(url2Topic(Topic_Stack_Service, url)) |
| | | if netNode == nil { |
| | | return false |
| | | } |
| | | client := NewClient(WithNodes(netNode)) |
| | | paramBody := map[string]interface{} { |
| | | "id": id, |
| | |
| | | func (api FileAnalysisApi) Copy(id string,stackIds []string) bool { |
| | | url := DATA_URL_PREFIX + "/fileAnalysis/copy" |
| | | netNode := getNetNode(url2Topic(Topic_Stack_Service, url)) |
| | | if netNode == nil { |
| | | return false |
| | | } |
| | | client := NewClient(WithNodes(netNode)) |
| | | paramBody := map[string]interface{} { |
| | | "id": id, |