|
|
@ -10,15 +10,21 @@ const ( |
|
|
|
RPCHostCode = 1 |
|
|
|
) |
|
|
|
|
|
|
|
func NewReq(method string, ipr ...string) (*hbtp.Request, error) { |
|
|
|
func NewReq(method string, ipr string) (*hbtp.Request, error) { |
|
|
|
host := fmt.Sprintf("%v", gocloud.CloudConf.Custom["sysHbtpHost"]) |
|
|
|
return hbtp.NewDoReq(host, RPCHostCode, method, nil, ipr...) |
|
|
|
return hbtp.NewDoRPCReq(host, RPCHostCode, method, ipr, nil) |
|
|
|
} |
|
|
|
func DoJson(method string, in, out interface{}, hd ...map[string]interface{}) error { |
|
|
|
host := fmt.Sprintf("%v", gocloud.CloudConf.Custom["sysHbtpHost"]) |
|
|
|
return hbtp.DoRPCJson(host, RPCHostCode, method, nil, in, out, hd...) |
|
|
|
req, err := NewReq(method, "") |
|
|
|
if err != nil { |
|
|
|
return err |
|
|
|
} |
|
|
|
return hbtp.DoJson(req, in, out, hd...) |
|
|
|
} |
|
|
|
func DoString(method string, in interface{}, hd ...hbtp.Mp) (int, []byte, error) { |
|
|
|
host := fmt.Sprintf("%v", gocloud.CloudConf.Custom["sysHbtpHost"]) |
|
|
|
return hbtp.DoRPCString(host, RPCHostCode, method, nil, in, hd...) |
|
|
|
req, err := NewReq(method, "") |
|
|
|
if err != nil { |
|
|
|
return 0, nil, err |
|
|
|
} |
|
|
|
return hbtp.DoString(req, in, hd...) |
|
|
|
} |