用户接口远程调用
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.

36 lines
551 B

  1. package userrpc
  2. const DES_KEY = "usersrpc"
  3. type Req struct {
  4. SiteId string
  5. Dbname string
  6. }
  7. type BindThirdReq struct {
  8. Req
  9. Userid string
  10. Type string
  11. Openid string
  12. Unionid string
  13. }
  14. type Res struct {
  15. Errcode string
  16. Errmsg string
  17. }
  18. func rpc_server_conn(url ...string) (*UserServiceClient, error) {
  19. var user_rpc_url string = "127.0.0.1:7976"
  20. if len(url) > 0 && url[0] != "" {
  21. user_rpc_url = url[0]
  22. }
  23. conn, _, err := DialUserService("tcp", user_rpc_url)
  24. if err != nil {
  25. return map[string]string{}, err
  26. }
  27. return conn, nil
  28. }