diff --git a/client.go b/client.go index 79dbd3f..ded483c 100644 --- a/client.go +++ b/client.go @@ -23,6 +23,7 @@ type SiteConfigItemReqArg struct { type SiteConfigItemRes struct { Type string Value string + Exist bool } /** @@ -32,6 +33,20 @@ type SiteConfigItemRes struct { * GZ */ func GetConfigItem(site_id, dbname, key string, url ...string) (*SiteConfigItemRes, error) { + ret, err := getconfig(site_id, dbname, key, url...) + if err != nil { + return ret, err + } + if ret.Exist == false { + return ret, errors.New("no data") + } + return ret, err +} +func GetConfig(site_id, dbname, key string, url ...string) (*SiteConfigItemRes, error) { + return getconfig(site_id, dbname, key, url...) +} + +func getconfig(site_id, dbname, key string, url ...string) (*SiteConfigItemRes, error) { var site_rpc_url string = "127.0.0.1:7971" if len(url) > 0 && url[0] != "" {