Initial commit
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
namespace RobotNet10.RobotApp.Motion;
|
||||
|
||||
public static class MotionApiEndpoints
|
||||
{
|
||||
public static IEndpointRouteBuilder MapMotionApiEndpoints(this IEndpointRouteBuilder app)
|
||||
{
|
||||
app.MapGet("/api/motion/ps5/status", (PS5ControllerService svc) =>
|
||||
{
|
||||
return Results.Json(new { state = svc.State.ToString() });
|
||||
});
|
||||
|
||||
app.MapPost("/api/motion/ps5/enable", async (PS5ControllerService svc) =>
|
||||
{
|
||||
svc.Enable();
|
||||
return Results.Ok("PS5 controller enabled");
|
||||
});
|
||||
|
||||
app.MapPost("/api/motion/ps5/disable", (PS5ControllerService svc) =>
|
||||
{
|
||||
svc.Disable();
|
||||
return Results.Ok("PS5 controller disabled");
|
||||
});
|
||||
|
||||
return app;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user