package dbapi import ( "encoding/json" "fmt" ) type DicApi struct { } func (api DicApi) FindByType(dicType string) (bool,interface{}) { url := BASIC_URL + DATA_URL_PREFIX + "/dictionary/findByType" client := NewClient() paramMap := make(map[string]string) paramMap["type"] = dicType respBody, err := client.DoGetRequest(url, paramMap, nil) if err !=nil { return false,nil } var res Result if err = json.Unmarshal(respBody, &res); err != nil { fmt.Println(err) return false,nil } return res.Success,res.Data }