mirror of
https://git.rwth-aachen.de/acs/public/villas/web-backend-go/
synced 2025-03-30 00:00:12 +01:00
46 lines
942 B
Go
46 lines
942 B
Go
package project
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
"net/http"
|
|
)
|
|
|
|
func ProjectsRegister(r *gin.RouterGroup) {
|
|
r.GET("/", projectsReadEp)
|
|
r.POST("/", projectRegistrationEp)
|
|
r.PUT("/:ProjectID", projectUpdateEp)
|
|
r.GET("/:ProjectID", projectReadEp)
|
|
r.DELETE("/:ProjectID", projectDeleteEp)
|
|
}
|
|
|
|
func projectsReadEp(c *gin.Context) {
|
|
allProjects, _, _ := FindAllProjects()
|
|
serializer := ProjectsSerializerNoAssoc{c, allProjects}
|
|
c.JSON(http.StatusOK, gin.H{
|
|
"projects": serializer.Response(),
|
|
})
|
|
}
|
|
|
|
func projectRegistrationEp(c *gin.Context) {
|
|
c.JSON(http.StatusOK, gin.H{
|
|
"message": "NOT implemented",
|
|
})
|
|
}
|
|
|
|
func projectUpdateEp(c *gin.Context) {
|
|
c.JSON(http.StatusOK, gin.H{
|
|
"message": "NOT implemented",
|
|
})
|
|
}
|
|
|
|
func projectReadEp(c *gin.Context) {
|
|
c.JSON(http.StatusOK, gin.H{
|
|
"message": "NOT implemented",
|
|
})
|
|
}
|
|
|
|
func projectDeleteEp(c *gin.Context) {
|
|
c.JSON(http.StatusOK, gin.H{
|
|
"message": "NOT implemented",
|
|
})
|
|
}
|