Example #1
0
        public List<RetornoLocalizacaoTotem> GetLocTotemSvc(string end)
        {
            List<RetornoLocalizacaoTotem> lstRetorno = new List<RetornoLocalizacaoTotem>();

            string[] lstend = end.Split(';');
            foreach (string loc in lstend)
            {
                string[] separador = loc.Split('_');
                string endereco = separador[0];
                string titulo = separador[1];
                string codigo = separador[2];

                GeoRequest request = new GeoRequest(endereco + ", São Paulo");
                GeoResponse response = request.GetResponse();
                foreach (GeoResult item in response.Results)
                {
                    RetornoLocalizacaoTotem local = new RetornoLocalizacaoTotem();
                    GeoLocation location = item.Geometry.Location;

                    local.CodigoNo = codigo;
                    local.Endereco = titulo;
                    local.Latitude = location.Latitude;
                    local.Longitude = location.Longitude;
                    local.EnderecoCompleto = item.FormattedAddress;
                    lstRetorno.Add(local);
                }
            }

            return lstRetorno;
        }
Example #2
0
        public IActionResult ASN(GeoRequest request)
        {
            if (!ModelState.IsValid)
            {
                return(ApiResponse <string> .ValidationError(request.IP));
            }

            var asn = maxmindService.ASN(request.IP);

            return(new ApiResponse <AsnResponse>()
            {
                Payload = asn
            });
        }
Example #3
0
        public IActionResult Country(GeoRequest request)
        {
            if (!ModelState.IsValid)
            {
                return(ApiResponse <string> .ValidationError(request.IP));
            }

            var country = maxmindService.Country(request.IP);

            return(new ApiResponse <CountryResponse>()
            {
                Payload = country
            });
        }
Example #4
0
        public static void Main(string[] args)
        {
            var y = new GeoRequest(address);

            y.Ge
        }
Example #5
0
 public static void Main(string[] args)
 {
     var y = new GeoRequest(address);
     y.Ge
 }