Skip to content

Commit

Permalink
Move to STJ #1837 - added missing json properties, date converter, re…
Browse files Browse the repository at this point in the history
…moved unused files.
  • Loading branch information
HarelM committed Feb 13, 2023
1 parent eec368c commit ff5c60a
Show file tree
Hide file tree
Showing 14 changed files with 35 additions and 63 deletions.
9 changes: 8 additions & 1 deletion IsraelHiking.Common/Category.cs
@@ -1,10 +1,13 @@
using System.Collections.Generic;
using System.Text.Json.Serialization;

namespace IsraelHiking.Common
{
public class IconAndTags
{
[JsonPropertyName("iconColorCategory")]
public IconColorCategory IconColorCategory { get; }
[JsonPropertyName("tags")]
public List<KeyValuePair<string, string>> Tags { get; }

public IconAndTags(IconColorCategory iconColorCategory)
Expand All @@ -31,10 +34,14 @@ public IconAndTags(IconColorCategory iconColorCategory, List<KeyValuePair<string

public class Category
{
[JsonPropertyName("name")]
public string Name { get; set; }
[JsonPropertyName("icon")]
public string Icon { get; set; }
[JsonPropertyName("color")]
public string Color { get; set; }


[JsonPropertyName("items")]
public List<IconAndTags> Items { get; set; }

public Category()
Expand Down
1 change: 0 additions & 1 deletion IsraelHiking.Common/DataContainer/RouteSegmentData.cs
Expand Up @@ -7,7 +7,6 @@ public static class RoutingType
{
public const string HIKE = "Hike";
public const string BIKE = "Bike";
public const string CAR = "Car";
public const string FOUR_WHEEL_DRIVE = "4WD";
public const string NONE = "None";
}
Expand Down
3 changes: 3 additions & 0 deletions IsraelHiking.Common/Extensions/GeoJsonExtensions.cs
Expand Up @@ -228,6 +228,9 @@ public static List<string> GetStringListFromAttributeValue(object value)
case object[] objectArray:
titles.AddRange(objectArray.Select(o => o.ToString()).ToList());
break;
case IList<object> objectsIList:
titles.AddRange(objectsIList.Select(o => o.ToString()).ToList());
break;
}
return titles;
}
Expand Down
8 changes: 0 additions & 8 deletions IsraelHiking.Common/FeatureProperties.cs

This file was deleted.

16 changes: 0 additions & 16 deletions IsraelHiking.Common/FileExplorer/FileExplorerViewModel.cs

This file was deleted.

9 changes: 0 additions & 9 deletions IsraelHiking.Common/FileExplorer/FileFormatViewModel.cs

This file was deleted.

12 changes: 0 additions & 12 deletions IsraelHiking.Common/FileExplorer/FileSystemEntry.cs

This file was deleted.

8 changes: 7 additions & 1 deletion IsraelHiking.Common/IconColorCategory.cs
@@ -1,10 +1,16 @@
namespace IsraelHiking.Common
using System.Text.Json.Serialization;

namespace IsraelHiking.Common
{
public class IconColorCategory
{
[JsonPropertyName("icon")]
public string Icon { get; set; }
[JsonPropertyName("category")]
public string Category { get; set; }
[JsonPropertyName("color")]
public string Color { get; set; }
[JsonPropertyName("label")]
public string Label { get; set; }

public IconColorCategory() : this(string.Empty)
Expand Down
11 changes: 0 additions & 11 deletions IsraelHiking.Common/Poi/Contribution.cs

This file was deleted.

6 changes: 5 additions & 1 deletion IsraelHiking.Common/Poi/NorthEast.cs
@@ -1,4 +1,6 @@
namespace IsraelHiking.Common.Poi
using System.Text.Json.Serialization;

namespace IsraelHiking.Common.Poi
{
/// <summary>
/// Return value for elevation request
Expand All @@ -8,10 +10,12 @@ public class NorthEast
/// <summary>
/// North coordinates in meters
/// </summary>
[JsonPropertyName("north")]
public int North { get; set; }
/// <summary>
/// East coordinates in meters
/// </summary>
[JsonPropertyName("east")]
public int East { get; set; }
}
}
6 changes: 5 additions & 1 deletion IsraelHiking.Common/Poi/Reference.cs
@@ -1,8 +1,12 @@
namespace IsraelHiking.Common.Poi
using System.Text.Json.Serialization;

namespace IsraelHiking.Common.Poi
{
public class Reference
{
[JsonPropertyName("url")]
public string Url { get; set; }
[JsonPropertyName("sourceImageUrl")]
public string SourceImageUrl { get; set; }
}
}
1 change: 0 additions & 1 deletion IsraelHiking.Common/Poi/SearchResultsPointOfInterest.cs
Expand Up @@ -5,7 +5,6 @@ public class SearchResultsPointOfInterest
public string Id { get; set; }
public string Source { get; set; }
public string Title { get; set; }
public string Description { get; set; }
public string DisplayName { get; set; }
public string Icon { get; set; }
public string IconColor { get; set; }
Expand Down
5 changes: 5 additions & 0 deletions IsraelHiking.Common/RebuildContext.cs
@@ -1,13 +1,18 @@
using IsraelHiking.Common.Api;
using System;
using System.Text.Json.Serialization;

namespace IsraelHiking.Common
{
public class RebuildContext
{
[JsonPropertyName("request")]
public UpdateRequest Request { get; set; }
[JsonPropertyName("startTime")]
public DateTime StartTime { get; set; }
[JsonPropertyName("succeeded")]
public bool Succeeded { get; set; }
[JsonPropertyName("errorMessage")]
public string ErrorMessage { get; set; }
}
}
3 changes: 2 additions & 1 deletion IsraelHiking.DataAccess/ElasticSearchGateway.cs
Expand Up @@ -169,7 +169,8 @@ public class SystemTextJsonSerializer : IElasticsearchSerializer
private IList<JsonConverter> BakedInConverters { get; } = new List<JsonConverter>
{
{new ExceptionConverter()},
{new DynamicDictionaryConverter()}
{new DynamicDictionaryConverter()},
{new DateTimeConverter()}
};

public SystemTextJsonSerializer(JsonConverterFactory factory)
Expand Down

0 comments on commit ff5c60a

Please sign in to comment.