GPSInfoWebModel.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. namespace Azylee.YeahWeb.BaiDuWebAPI.GPSAPI
  6. {
  7. public class GPSInfoWebModel
  8. {
  9. public int status { get; set; }
  10. public BaiduGPSInfoWebResult result { get; set; }
  11. public GPSInfoModel ToGPSInfoModel()
  12. {
  13. GPSInfoModel model = null;
  14. if (result != null && result .addressComponent!= null)
  15. {
  16. model = new GPSInfoModel();
  17. model.Country = result.addressComponent.country;
  18. model.Province = result.addressComponent.province;
  19. model.City = result.addressComponent.city;
  20. model.District = result.addressComponent.district;
  21. model.Street = result.addressComponent.street;
  22. model.Address = result.formatted_address;
  23. }
  24. return model;
  25. }
  26. }
  27. public class BaiduGPSInfoWebResult
  28. {
  29. public Location location { get; set; }
  30. public string formatted_address { get; set; }
  31. public string business { get; set; }
  32. public AddressComponent addressComponent { get; set; }
  33. public IList<object> pois { get; set; }
  34. public IList<object> roads { get; set; }
  35. public IList<object> poiRegions { get; set; }
  36. public string sematic_description { get; set; }
  37. public int cityCode { get; set; }
  38. }
  39. public class Location
  40. {
  41. public double lng { get; set; }
  42. public double lat { get; set; }
  43. }
  44. public class AddressComponent
  45. {
  46. public string country { get; set; }
  47. public int country_code { get; set; }
  48. public string country_code_iso { get; set; }
  49. public string country_code_iso2 { get; set; }
  50. public string province { get; set; }
  51. public string city { get; set; }
  52. public int city_level { get; set; }
  53. public string district { get; set; }
  54. public string town { get; set; }
  55. public string adcode { get; set; }
  56. public string street { get; set; }
  57. public string street_number { get; set; }
  58. public string direction { get; set; }
  59. public string distance { get; set; }
  60. }
  61. }