| | |
| | | |
| | | import ( |
| | | "basic.com/pubsub/protomsg.git" |
| | | "encoding/json" |
| | | json "github.com/json-iterator/go" |
| | | ) |
| | | |
| | | type SdkApi struct{ |
| | |
| | | } |
| | | return res.Success |
| | | } |
| | | |
| | | func (api SdkApi) Delete(sdkId string) (bool, interface{}) { |
| | | url := DATA_URL_PREFIX + "/sdk/delete" |
| | | netNode := getNetNode(url2Topic(Topic_AppCenter_Service, url)) |
| | | client := NewClient(WithNodes(netNode)) |
| | | paramBody := map[string]interface{}{ |
| | | "sdkId": sdkId, |
| | | } |
| | | respBody,err := client.DoPostRequest(url, CONTENT_TYPE_JSON, paramBody, nil, nil) |
| | | if err !=nil { |
| | | return false, err.Error() |
| | | } |
| | | var res Result |
| | | if err = json.Unmarshal(respBody, &res);err !=nil { |
| | | return false, err.Error() |
| | | } |
| | | return res.Success, res.Data |
| | | } |