mirror of
https://git.rwth-aachen.de/acs/public/villas/web-backend-go/
synced 2025-03-30 00:00:12 +01:00
Adds unimplemented endpoints for users API
This commit is contained in:
parent
d5fb904772
commit
61ea3406b3
1 changed files with 54 additions and 0 deletions
54
common/userEndpoints.go
Normal file
54
common/userEndpoints.go
Normal file
|
@ -0,0 +1,54 @@
|
||||||
|
package common
|
||||||
|
|
||||||
|
import (
|
||||||
|
"gopkg.in/gin-gonic/gin.v1"
|
||||||
|
"net/http"
|
||||||
|
)
|
||||||
|
|
||||||
|
func UsersRegister(r *gin.RouterGroup) {
|
||||||
|
r.GET("/", usersReadEp)
|
||||||
|
r.POST("/", userRegistrationEp)
|
||||||
|
r.PUT("/:userID", userUpdateEp)
|
||||||
|
r.GET("/:userID", userReadEp)
|
||||||
|
r.DELETE("/:userID", userDeleteEp)
|
||||||
|
//r.GET("/me", userSelfEp) // TODO: this conflicts with GET /:userID
|
||||||
|
}
|
||||||
|
|
||||||
|
func usersReadEp(c *gin.Context) {
|
||||||
|
c.JSON(http.StatusOK, gin.H{
|
||||||
|
"message": "NOT implemented",
|
||||||
|
})
|
||||||
|
// TODO: get all allUsers
|
||||||
|
//serializer := UsersSerializer{c, allUsers}
|
||||||
|
//c.JSON(http.StatusOK, gin.H{"users", serializer.Response()})
|
||||||
|
}
|
||||||
|
|
||||||
|
func userRegistrationEp(c *gin.Context) {
|
||||||
|
c.JSON(http.StatusOK, gin.H{
|
||||||
|
"message": "NOT implemented",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func userUpdateEp(c *gin.Context) {
|
||||||
|
c.JSON(http.StatusOK, gin.H{
|
||||||
|
"message": "NOT implemented",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func userReadEp(c *gin.Context) {
|
||||||
|
c.JSON(http.StatusOK, gin.H{
|
||||||
|
"message": "NOT implemented",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func userDeleteEp(c *gin.Context) {
|
||||||
|
c.JSON(http.StatusOK, gin.H{
|
||||||
|
"message": "NOT implemented",
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func userSelfEp(c *gin.Context) {
|
||||||
|
c.JSON(http.StatusOK, gin.H{
|
||||||
|
"message": "NOT implemented",
|
||||||
|
})
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue