Besucher werden in den Datenbank gespeichert
This commit is contained in:
@@ -8,27 +8,32 @@ import (
|
||||
|
||||
"git.cosysda.de/HuskyTeufel/Hochzeit/planner"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/jinzhu/gorm"
|
||||
)
|
||||
|
||||
func GetBesucherListHandler(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, planner.Get())
|
||||
type EnvHandler struct {
|
||||
DB *gorm.DB
|
||||
}
|
||||
|
||||
func AddBesucherHandler(c *gin.Context) {
|
||||
func (e *EnvHandler) GetBesucherListHandler(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, planner.Get(e.DB))
|
||||
}
|
||||
|
||||
func (e *EnvHandler) AddBesucherHandler(c *gin.Context) {
|
||||
besucherItem, statusCode, err := convertHTTPBodyToBesucher(c.Request.Body)
|
||||
if err != nil {
|
||||
c.JSON(statusCode, err)
|
||||
return
|
||||
}
|
||||
|
||||
c.JSON(statusCode, gin.H{"id": planner.Add(besucherItem)})
|
||||
c.JSON(statusCode, gin.H{"id": planner.Add(e.DB, besucherItem)})
|
||||
}
|
||||
|
||||
func DeleteBesucherHandler(c *gin.Context) {
|
||||
func (e *EnvHandler) DeleteBesucherHandler(c *gin.Context) {
|
||||
|
||||
}
|
||||
|
||||
func ComeBesucherHandler(c *gin.Context) {
|
||||
func (e *EnvHandler) ComeBesucherHandler(c *gin.Context) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user