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

38 lines
573 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. Platform string
  11. Openid string
  12. Openname string
  13. Unionid string
  14. Avatar string
  15. }
  16. type Res struct {
  17. Errcode string
  18. Errmsg string
  19. }
  20. func rpc_server_conn(url ...string) (*UserServiceClient, error) {
  21. var user_rpc_url string = "127.0.0.1:7976"
  22. if len(url) > 0 && url[0] != "" {
  23. user_rpc_url = url[0]
  24. }
  25. conn, _, err := DialUserService("tcp", user_rpc_url)
  26. if err != nil {
  27. return nil, err
  28. }
  29. return conn, nil
  30. }