admin only route is working

This commit is contained in:
2023-03-29 19:52:46 +11:00
parent 1654ff87ed
commit cc4a890064
7 changed files with 127 additions and 10 deletions

View File

@@ -0,0 +1,20 @@
package controllers
import (
"net/http"
"github.com/gin-gonic/gin"
)
type RetrieveInput struct {
DeviceName string `json:"deviceName" binding:"required"`
}
func Retrieve(c *gin.Context) {
var input RetrieveInput
if err := c.ShouldBindJSON(&input); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
return
}
}