1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
| 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
| }
|
|