|
@ -23,6 +23,7 @@ type SiteConfigItemReqArg struct { |
|
|
type SiteConfigItemRes struct { |
|
|
type SiteConfigItemRes struct { |
|
|
Type string |
|
|
Type string |
|
|
Value string |
|
|
Value string |
|
|
|
|
|
Exist bool |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -32,6 +33,20 @@ type SiteConfigItemRes struct { |
|
|
* GZ |
|
|
* GZ |
|
|
*/ |
|
|
*/ |
|
|
func GetConfigItem(site_id, dbname, key string, url ...string) (*SiteConfigItemRes, error) { |
|
|
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" |
|
|
var site_rpc_url string = "127.0.0.1:7971" |
|
|
if len(url) > 0 && url[0] != "" { |
|
|
if len(url) > 0 && url[0] != "" { |
|
|