Skip to content

implementare REST API #4

@Helias

Description

@Helias

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions