Initial commit

This commit is contained in:
2026-07-03 16:31:37 +07:00
commit 899c7c637d
1939 changed files with 641750 additions and 0 deletions

View File

@@ -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;
}
}