Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implementare REST API #4

Open
Helias opened this issue Jan 10, 2024 · 0 comments
Open

implementare REST API #4

Helias opened this issue Jan 10, 2024 · 0 comments

Comments

@Helias
Copy link
Member

Helias commented Jan 10, 2024

Coprire tutti gli end-point esistenti (iniziare dalle GET)

	apiGroup := router.Group("/api")
	apiGroup.GET("/robot/position", func(context *gin.Context) { getRobotPosition(context) })
	apiGroup.POST("/robot/position", func(context *gin.Context) { setRobotPosition(context) })

	apiGroup.GET("/robot/speed", func(context *gin.Context) { getRobotSpeed(context) })
	apiGroup.POST("/robot/speed", func(context *gin.Context) { setRobotSpeed(context) })

	apiGroup.POST("/robot/move/distance", func(context *gin.Context) { robotForwardDistance(context) })
	apiGroup.POST("/robot/move/point", func(context *gin.Context) { robotForwardPoint(context) })

	apiGroup.POST("/robot/rotate/relative", func(context *gin.Context) { robotRelativeRotation(context) })
	apiGroup.POST("/robot/rotate/absolute", func(context *gin.Context) { robotAbsoluteRotation(context) })

	apiGroup.POST("/robot/motors/stop", func(context *gin.Context) { sendStop(context) })
	apiGroup.POST("/robot/st/align", func(context *gin.Context) { robotAlign(context) })
	apiGroup.POST("/robot/st/starter", func(context *gin.Context) { robotStarterToggle(context) })

	apiGroup.GET("/robot/battery", func(context *gin.Context) { getRobotBattery(context) })
	apiGroup.GET("/robot/reset", func(context *gin.Context) { resetRobotcontext(context) })

Questa issue dipende da #3 ma nel frattempo si potrebbero stampare dei valori hard-coded con la stessa struttura delle API di go-robot-controller (valori mock)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant