Implement unified API controller pattern
This commit is contained in:
12
EstusShots.Shared/Interfaces/IApiParameter.cs
Normal file
12
EstusShots.Shared/Interfaces/IApiParameter.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace EstusShots.Shared.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// Marks a class that can be used as a parameter for API requests
|
||||
/// </summary>
|
||||
public interface IApiParameter { }
|
||||
|
||||
/// <summary>
|
||||
/// Marks a class as response type that is returned from API requests
|
||||
/// </summary>
|
||||
public interface IApiResponse { }
|
||||
}
|
||||
23
EstusShots.Shared/Interfaces/ISeasonsController.cs
Normal file
23
EstusShots.Shared/Interfaces/ISeasonsController.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System.Threading.Tasks;
|
||||
using EstusShots.Shared.Models;
|
||||
using EstusShots.Shared.Models.Parameters;
|
||||
|
||||
namespace EstusShots.Shared.Interfaces
|
||||
{
|
||||
/// <summary>
|
||||
/// Access many seasons with one request
|
||||
/// </summary>
|
||||
public interface ISeasonsController
|
||||
{
|
||||
/// <summary>
|
||||
/// Get a list of all seasons in the system
|
||||
/// </summary>
|
||||
/// <param name="parameter"></param>
|
||||
/// <returns></returns>
|
||||
Task<ApiResponse<GetSeasonsResponse>> GetSeasons(GetSeasonsParameter parameter);
|
||||
|
||||
Task<ApiResponse<GetSeasonResponse>> GetSeason(GetSeasonParameter parameter);
|
||||
|
||||
Task<ApiResponse<SaveSeasonResponse>> SaveSeason(SaveSeasonParameter parameter);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user