Skip to content

Commit

Permalink
Disabled all endpoints except ping
Browse files Browse the repository at this point in the history
  • Loading branch information
tschissler committed Oct 4, 2023
1 parent 8517a0f commit d2a4309
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions ChargingService/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,36 +21,36 @@
app.UseSwaggerUI();
}

var chargingController = new ChargingController();

app.MapGet("/readdata", string () =>
{
lock (chargingController.lockobject)
{
return JsonConvert.SerializeObject(chargingController.GetDataPoints());
}
})
.WithName("ReadData");

app.MapGet("/readchargingsettings", string () =>
{
return JsonConvert.SerializeObject(chargingController.GetChargingSettings());
})
.WithName("ReadChargingSettings");

app.MapPost("/setchargingcurrency", bool ([FromBody] double chargingCurrency) =>
{
chargingController.SetChargingCurrency(chargingCurrency);
return true;
})
.WithName("SetChargingCurrency");

app.MapPost("/applychargingsettings", bool ([FromBody] ChargingSettingsData chargingSettingsData) =>
{
chargingController.ApplyChargingSettings(chargingSettingsData);
return true;
})
.WithName("ApplyChargingSettings");
//var chargingController = new ChargingController();

//app.MapGet("/readdata", string () =>
//{
// lock (chargingController.lockobject)
// {
// return JsonConvert.SerializeObject(chargingController.GetDataPoints());
// }
//})
//.WithName("ReadData");

//app.MapGet("/readchargingsettings", string () =>
//{
// return JsonConvert.SerializeObject(chargingController.GetChargingSettings());
//})
//.WithName("ReadChargingSettings");

//app.MapPost("/setchargingcurrency", bool ([FromBody] double chargingCurrency) =>
//{
// chargingController.SetChargingCurrency(chargingCurrency);
// return true;
//})
//.WithName("SetChargingCurrency");

//app.MapPost("/applychargingsettings", bool ([FromBody] ChargingSettingsData chargingSettingsData) =>
//{
// chargingController.ApplyChargingSettings(chargingSettingsData);
// return true;
//})
//.WithName("ApplyChargingSettings");

app.MapGet("/ping", string () =>
{
Expand Down

0 comments on commit d2a4309

Please sign in to comment.