Move classes in to files
This commit is contained in:
parent
5588c88726
commit
11e0271989
3 changed files with 45 additions and 45 deletions
|
@ -1,5 +1,3 @@
|
|||
using System.Text.Json.Serialization;
|
||||
|
||||
var builder = WebApplication.CreateBuilder(args);
|
||||
|
||||
// Add services to the container.
|
||||
|
@ -38,46 +36,4 @@ app.MapGet("/light", (int startHour, int endHour) =>
|
|||
})
|
||||
.WithOpenApi();
|
||||
|
||||
app.Run();
|
||||
|
||||
public class SunriseSunsetOrgMock
|
||||
{
|
||||
[JsonPropertyName("results")]
|
||||
public Results Results { get; set; }
|
||||
|
||||
[JsonPropertyName("status")]
|
||||
public string Status { get; set; }
|
||||
}
|
||||
|
||||
public class Results
|
||||
{
|
||||
[JsonPropertyName("sunrise")]
|
||||
public DateTimeOffset Sunrise { get; set; }
|
||||
|
||||
[JsonPropertyName("sunset")]
|
||||
public DateTimeOffset Sunset { get; set; }
|
||||
|
||||
[JsonPropertyName("solar_noon")]
|
||||
public DateTimeOffset? SolarNoon { get; set; }
|
||||
|
||||
[JsonPropertyName("day_length")]
|
||||
public long? DayLength { get; set; }
|
||||
|
||||
[JsonPropertyName("civil_twilight_begin")]
|
||||
public DateTimeOffset? CivilTwilightBegin { get; set; }
|
||||
|
||||
[JsonPropertyName("civil_twilight_end")]
|
||||
public DateTimeOffset? CivilTwilightEnd { get; set; }
|
||||
|
||||
[JsonPropertyName("nautical_twilight_begin")]
|
||||
public DateTimeOffset? NauticalTwilightBegin { get; set; }
|
||||
|
||||
[JsonPropertyName("nautical_twilight_end")]
|
||||
public DateTimeOffset? NauticalTwilightEnd { get; set; }
|
||||
|
||||
[JsonPropertyName("astronomical_twilight_begin")]
|
||||
public DateTimeOffset AstronomicalTwilightBegin { get; set; }
|
||||
|
||||
[JsonPropertyName("astronomical_twilight_end")]
|
||||
public DateTimeOffset AstronomicalTwilightEnd { get; set; }
|
||||
}
|
||||
app.Run();
|
34
FishTankApi/Results.cs
Normal file
34
FishTankApi/Results.cs
Normal file
|
@ -0,0 +1,34 @@
|
|||
using System.Text.Json.Serialization;
|
||||
|
||||
public class Results
|
||||
{
|
||||
[JsonPropertyName("sunrise")]
|
||||
public DateTimeOffset Sunrise { get; set; }
|
||||
|
||||
[JsonPropertyName("sunset")]
|
||||
public DateTimeOffset Sunset { get; set; }
|
||||
|
||||
[JsonPropertyName("solar_noon")]
|
||||
public DateTimeOffset? SolarNoon { get; set; }
|
||||
|
||||
[JsonPropertyName("day_length")]
|
||||
public long? DayLength { get; set; }
|
||||
|
||||
[JsonPropertyName("civil_twilight_begin")]
|
||||
public DateTimeOffset? CivilTwilightBegin { get; set; }
|
||||
|
||||
[JsonPropertyName("civil_twilight_end")]
|
||||
public DateTimeOffset? CivilTwilightEnd { get; set; }
|
||||
|
||||
[JsonPropertyName("nautical_twilight_begin")]
|
||||
public DateTimeOffset? NauticalTwilightBegin { get; set; }
|
||||
|
||||
[JsonPropertyName("nautical_twilight_end")]
|
||||
public DateTimeOffset? NauticalTwilightEnd { get; set; }
|
||||
|
||||
[JsonPropertyName("astronomical_twilight_begin")]
|
||||
public DateTimeOffset AstronomicalTwilightBegin { get; set; }
|
||||
|
||||
[JsonPropertyName("astronomical_twilight_end")]
|
||||
public DateTimeOffset AstronomicalTwilightEnd { get; set; }
|
||||
}
|
10
FishTankApi/SunriseSunsetOrgMock.cs
Normal file
10
FishTankApi/SunriseSunsetOrgMock.cs
Normal file
|
@ -0,0 +1,10 @@
|
|||
using System.Text.Json.Serialization;
|
||||
|
||||
public class SunriseSunsetOrgMock
|
||||
{
|
||||
[JsonPropertyName("results")]
|
||||
public Results Results { get; set; }
|
||||
|
||||
[JsonPropertyName("status")]
|
||||
public string Status { get; set; }
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue