🚧 Begin implementing the Models
This commit is contained in:
parent
607682884c
commit
ce4d469466
|
@ -6,6 +6,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"git.beisel.it/florian/hostname-service/db"
|
"git.beisel.it/florian/hostname-service/db"
|
||||||
|
"git.beisel.it/florian/hostname-service/models"
|
||||||
"git.beisel.it/florian/hostname-service/rules"
|
"git.beisel.it/florian/hostname-service/rules"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
@ -65,7 +66,8 @@ func CreateOrUpdateHostname(c *gin.Context, isUpdate bool) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
c.JSON(http.StatusOK, gin.H{"hostname": hostname})
|
response := models.SimpleHostnameResponse{Hostname: hostname}
|
||||||
|
c.JSON(http.StatusOK, response)
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Summary Delete a hostname from the database
|
// @Summary Delete a hostname from the database
|
||||||
|
@ -87,7 +89,8 @@ func DeleteHostname(c *gin.Context) {
|
||||||
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
c.JSON(http.StatusOK, gin.H{"hostname": hostname})
|
response := models.SimpleHostnameResponse{Hostname: hostname}
|
||||||
|
c.JSON(http.StatusOK, response)
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Summary Return a list of hosts and their details filtered by category
|
// @Summary Return a list of hosts and their details filtered by category
|
||||||
|
|
Loading…
Reference in New Issue