Version 3.0.347

This commit is contained in:
ohauff 2022-10-26 20:53:18 +02:00
parent a018f21fea
commit 7f49fb0ac5
41 changed files with 292 additions and 187 deletions

View file

@ -212,14 +212,10 @@ namespace TINK.Model.Services.CopriApi
}
public async Task<ReservationBookingResponse> DoReserveAsync(string bikeId, Uri operatorUri)
{
return await HttpsServer.DoReserveAsync(bikeId, operatorUri);
}
=> await HttpsServer.DoReserveAsync(bikeId, operatorUri);
public async Task<ReservationCancelReturnResponse> DoCancelReservationAsync(string bikeId, Uri operatorUri)
{
return await HttpsServer.DoCancelReservationAsync(bikeId, operatorUri);
}
=> await HttpsServer.DoCancelReservationAsync(bikeId, operatorUri);
public async Task<ReservationBookingResponse> CalculateAuthKeysAsync(string bikeId, Uri operatorUri)
{

View file

@ -6,6 +6,7 @@ using TINK.Model.Device;
using TINK.Repository;
using TINK.Repository.Request;
using TINK.Repository.Response;
using TINK.Services.CopriApi.Exception;
namespace TINK.Model.Services.CopriApi
{
@ -35,13 +36,13 @@ namespace TINK.Model.Services.CopriApi
public string MerchantId => monkeyStore.MerchantId;
public Task<ReservationBookingResponse> DoReserveAsync(string bikeId, Uri operatorUri)
=> throw new NotSupportedException($"{nameof(DoReserveAsync)} is not cachable.");
=> throw new RequestNotCachableException(nameof(DoReserveAsync));
public Task<ReservationCancelReturnResponse> DoCancelReservationAsync(string bikeId, Uri operatorUri)
=> throw new NotSupportedException($"{nameof(DoCancelReservationAsync)} is not cachable.");
=> throw new RequestNotCachableException(nameof(DoCancelReservationAsync));
public Task<ReservationBookingResponse> CalculateAuthKeysAsync(string bikeId, Uri operatorUri)
=> throw new NotSupportedException($"{nameof(CalculateAuthKeysAsync)} is not cachable.");
=> throw new RequestNotCachableException(nameof(CalculateAuthKeysAsync));
public async Task<ResponseBase> StartReturningBike(
string bikeId,
@ -65,9 +66,7 @@ namespace TINK.Model.Services.CopriApi
versionInfo);
public async Task<ReservationBookingResponse> DoBookAsync(string bikeId, Guid guid, double batteryPercentage, Uri operatorUri)
{
return await monkeyStore.DoBookAsync(bikeId, guid, batteryPercentage, operatorUri);
}
=> await monkeyStore.DoBookAsync(bikeId, guid, batteryPercentage, operatorUri);
public async Task<ReservationBookingResponse> BookAvailableAndStartOpeningAsync(
string bikeId,
@ -93,37 +92,26 @@ namespace TINK.Model.Services.CopriApi
=> await monkeyStore.ReturnAndStartClosingAsync(bikeId, smartDevice, operatorUri);
public Task<SubmitFeedbackResponse> DoSubmitFeedback(string bikeId, int? currentChargeBars, string messge, bool bIsBikeBroke, Uri operatorUri)
=> throw new NotImplementedException();
=> throw new RequestNotCachableException(nameof(DoSubmitFeedback));
/// <summary> Submits mini survey to copri server. </summary>
/// <param name="answers">Collection of answers.</param>
public Task<ResponseBase> DoSubmitMiniSurvey(IDictionary<string, string> answers)
=> throw new NotSupportedException();
=> throw new RequestNotCachableException(nameof(DoSubmitMiniSurvey));
public async Task<AuthorizationResponse> DoAuthorizationAsync(string p_strMailAddress, string p_strPassword, string p_strDeviceId)
{
return await monkeyStore.DoAuthorizationAsync(p_strMailAddress, p_strPassword, p_strDeviceId);
}
=> await monkeyStore.DoAuthorizationAsync(p_strMailAddress, p_strPassword, p_strDeviceId);
public async Task<AuthorizationoutResponse> DoAuthoutAsync()
{
return await monkeyStore.DoAuthoutAsync();
}
=> await monkeyStore.DoAuthoutAsync();
public async Task<BikesAvailableResponse> GetBikesAvailableAsync()
{
return await monkeyStore.GetBikesAvailableAsync();
}
=> await monkeyStore.GetBikesAvailableAsync();
public async Task<BikesReservedOccupiedResponse> GetBikesOccupiedAsync()
{
return await monkeyStore.GetBikesOccupiedAsync();
}
=> await monkeyStore.GetBikesOccupiedAsync();
public async Task<StationsAvailableResponse> GetStationsAsync()
{
return await monkeyStore.GetStationsAsync();
}
=> await monkeyStore.GetStationsAsync();
}
}

View file

@ -0,0 +1,12 @@
using TINK.MultilingualResources;
namespace TINK.Services.CopriApi.Exception
{
public class RequestNotCachableException : System.Exception
{
public RequestNotCachableException(string nameOfAction) : base(AppResources.ErrorNotConnectedToNetwork, new System.Exception($"{nameOfAction} is not cacheable."))
{
}
}
}