用户接口远程调用
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

66 lines
938 B

package userrpc
const DES_KEY = "usersrpc"
type Req struct {
SiteId string
Dbname string
}
type Third struct {
Userid string
Platform string
Openid string
Openname string
Unionid string
Avatar string
Mobile string
}
type BindThirdReq struct {
Req
Third
}
type GetThirdReq struct {
Req
Userid string
Platform string
}
type GetBusinessReq struct {
Req
BusinessId string
}
type Res struct {
Errcode int
Errmsg string
}
type Business struct {
Type string
BusinessId string
CustomerId string
Name string
CompanyId string
Contact string
Mobile string
HandingFee string
IsOpen string
}
func rpc_server_conn(url ...string) (*UserServiceClient, error) {
var user_rpc_url string = "127.0.0.1:7976"
if len(url) > 0 && url[0] != "" {
user_rpc_url = url[0]
}
conn, _, err := DialUserService("tcp", user_rpc_url)
if err != nil {
return nil, err
}
return conn, nil
}