Added a weather api

This commit is contained in:
LukePulverenti Luke Pulverenti luke pulverenti
2012-09-02 01:30:25 -04:00
parent bcd1a1ca7a
commit a7b0dd1534
25 changed files with 364 additions and 14 deletions

View File

@@ -56,6 +56,9 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Entities\User.cs" />
<Compile Include="Entities\UserItemData.cs" />
<Compile Include="Weather\WeatherForecast.cs" />
<Compile Include="Weather\WeatherInfo.cs" />
<Compile Include="Weather\WeatherStatus.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="protobuf-net">

View File

@@ -0,0 +1,30 @@
using System;
using ProtoBuf;
namespace MediaBrowser.Model.Weather
{
/// <summary>
/// Represents a weather forecase for a specific date
/// </summary>
[ProtoContract]
public class WeatherForecast
{
[ProtoMember(1)]
public DateTime Date { get; set; }
[ProtoMember(2)]
public int HighTemperatureFahrenheit { get; set; }
[ProtoMember(3)]
public int LowTemperatureFahrenheit { get; set; }
[ProtoMember(4)]
public int HighTemperatureCelsius { get; set; }
[ProtoMember(5)]
public int LowTemperatureCelsius { get; set; }
[ProtoMember(6)]
public WeatherConditions Condition { get; set; }
}
}

View File

@@ -0,0 +1,14 @@
using ProtoBuf;
namespace MediaBrowser.Model.Weather
{
[ProtoContract]
public class WeatherInfo
{
[ProtoMember(1)]
public WeatherStatus CurrentWeather { get; set; }
[ProtoMember(2)]
public WeatherForecast[] Forecasts { get; set; }
}
}

View File

@@ -0,0 +1,38 @@
using ProtoBuf;
namespace MediaBrowser.Model.Weather
{
/// <summary>
/// Represents the current weather status
/// </summary>
[ProtoContract]
public class WeatherStatus
{
[ProtoMember(1)]
public int TemperatureFahrenheit { get; set; }
[ProtoMember(2)]
public int TemperatureCelsius { get; set; }
[ProtoMember(3)]
public int Humidity { get; set; }
[ProtoMember(4)]
public WeatherConditions Condition { get; set; }
}
public enum WeatherConditions
{
Sunny,
PartlyCloudy,
Cloudy,
Overcast,
Mist,
Snow,
Rain,
Sleet,
Fog,
Blizzard,
Thunderstorm
}
}