From 22e87004cb7c469b586d24aa65e04b31307ccacf Mon Sep 17 00:00:00 2001 From: Ognjen Cirkovic Date: Tue, 8 Nov 2022 14:09:25 +0100 Subject: Dodati upiti sa clienta ka backend-u za dodavanje lokacije i objave. Omoguceno uplodovanje slike sa clienta. --- Backend/Api/Api/Models/Location.cs | 9 ++++----- Backend/Api/Api/Services/LocationService.cs | 1 + 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'Backend') 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 add(Location loc) { IEnumerable
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); -- cgit v1.2.3