🚧 Begin implementing the Models
This commit is contained in:
		@@ -6,6 +6,7 @@ import (
 | 
			
		||||
	"strings"
 | 
			
		||||
 | 
			
		||||
	"git.beisel.it/florian/hostname-service/db"
 | 
			
		||||
	"git.beisel.it/florian/hostname-service/models"
 | 
			
		||||
	"git.beisel.it/florian/hostname-service/rules"
 | 
			
		||||
	"github.com/gin-gonic/gin"
 | 
			
		||||
)
 | 
			
		||||
@@ -65,7 +66,8 @@ func CreateOrUpdateHostname(c *gin.Context, isUpdate bool) {
 | 
			
		||||
		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
 | 
			
		||||
@@ -87,7 +89,8 @@ func DeleteHostname(c *gin.Context) {
 | 
			
		||||
		c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()})
 | 
			
		||||
		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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user