diff options
author | Ognjen Cirkovic <ciraboxkg@gmail.com> | 2022-11-08 14:09:25 +0100 |
---|---|---|
committer | Ognjen Cirkovic <ciraboxkg@gmail.com> | 2022-11-08 14:09:25 +0100 |
commit | 22e87004cb7c469b586d24aa65e04b31307ccacf (patch) | |
tree | 4b4ecb0057e9c23eee0b60ad522ac604d5b18237 /Backend/Api | |
parent | ad27410f15fda54861e5391f7673b7461053b530 (diff) |
Dodati upiti sa clienta ka backend-u za dodavanje lokacije i objave. Omoguceno uplodovanje slike sa clienta.
Diffstat (limited to 'Backend/Api')
-rw-r--r-- | Backend/Api/Api/Models/Location.cs | 9 | ||||
-rw-r--r-- | Backend/Api/Api/Services/LocationService.cs | 1 |
2 files changed, 5 insertions, 5 deletions
diff --git a/Backend/Api/Api/Models/Location.cs b/Backend/Api/Api/Models/Location.cs index 8cc4377..7c1a0bf 100644 --- a/Backend/Api/Api/Models/Location.cs +++ b/Backend/Api/Api/Models/Location.cs @@ -14,16 +14,15 @@ namespace Api.Models public String address { get; set; } public double latitude { get; set; } public double longitude { get; set; } - public LocationType type { get; set; } + //public LocationType type { get; set; } } public enum LocationType { - Plaza, - Grad, - Zgrada, - Itd + GRAD,ULICA,JEZERO,REKA,PLAZA,OKEAN, MORE, MOREUZ, MOST,BANJA, + PLANINA, VISORAVAN, PIRAMIDA, LIVADA, SELO, OSTRVO, POLUOSTRVO, KLISURA, ARHIPELAG, + ADA, DELTA, FJORD, GEJZIR, IZVOR, KOTLINA, MINERALNI_IZVOR, PECINA ,SUMA, VODOPAD,VULKAN } } diff --git a/Backend/Api/Api/Services/LocationService.cs b/Backend/Api/Api/Services/LocationService.cs index 292fc0e..e244ed6 100644 --- a/Backend/Api/Api/Services/LocationService.cs +++ b/Backend/Api/Api/Services/LocationService.cs @@ -28,6 +28,7 @@ namespace Api.Services public async Task<Location> add(Location loc) { IEnumerable<Address> adresses = await _geocoder.GeocodeAsync(loc.name+" "+loc.address+" "+loc.city+" "+loc.country); + loc.country = loc.name; loc.latitude = adresses.First().Coordinates.Latitude; loc.longitude=adresses.First().Coordinates.Longitude; await _locations.InsertOneAsync(loc); |