|
@ -6,6 +6,7 @@ import ( |
|
|
"strconv" |
|
|
"strconv" |
|
|
"time" |
|
|
"time" |
|
|
|
|
|
|
|
|
|
|
|
"git.tetele.net/tgo/conf" |
|
|
"git.tetele.net/tgo/crypter" |
|
|
"git.tetele.net/tgo/crypter" |
|
|
|
|
|
|
|
|
"github.com/golang/protobuf/proto" |
|
|
"github.com/golang/protobuf/proto" |
|
@ -30,6 +31,15 @@ type SiteInfoRes struct { |
|
|
*/ |
|
|
*/ |
|
|
func GetSiteInfoByHost(host string, params ...string) (*SiteInfoRes, error) { |
|
|
func GetSiteInfoByHost(host string, params ...string) (*SiteInfoRes, error) { |
|
|
|
|
|
|
|
|
|
|
|
var res_arr SiteInfoRes |
|
|
|
|
|
|
|
|
|
|
|
if conf.IS_PRIVATE { |
|
|
|
|
|
res_arr.Dbname = conf.DBNAME |
|
|
|
|
|
res_arr.SiteId = conf.SITE_ID |
|
|
|
|
|
res_arr.Domainname = conf.DOMAIN |
|
|
|
|
|
return &res_arr, nil |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
var url string = "" |
|
|
var url string = "" |
|
|
var master string = "" |
|
|
var master string = "" |
|
|
if len(params) > 1 { |
|
|
if len(params) > 1 { |
|
@ -75,7 +85,6 @@ func GetSiteInfoByHost(host string, params ...string) (*SiteInfoRes, error) { |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
return nil, err |
|
|
return nil, err |
|
|
} |
|
|
} |
|
|
var res_arr SiteInfoRes |
|
|
|
|
|
|
|
|
|
|
|
err = json.Unmarshal([]byte(res_data), &res_arr) |
|
|
err = json.Unmarshal([]byte(res_data), &res_arr) |
|
|
|
|
|
|
|
|