From 600fb0e997feb3118dcc58f8ceb3882fb51bb676 Mon Sep 17 00:00:00 2001 From: Florian Beisel Date: Sun, 21 Jan 2024 16:19:42 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=97=EF=B8=8F=20Change=20notebook.go=20?= =?UTF-8?q?to=20use=20new=20interface?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rules/notebook.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/rules/notebook.go b/rules/notebook.go index a145c8b..939e5be 100644 --- a/rules/notebook.go +++ b/rules/notebook.go @@ -75,8 +75,11 @@ func (nr *NotebookRule) Generate(params map[string]interface{}) (string, []byte, // @Param body body NotebookRuleInput true "Input data to generate hostname" // @Success 200 {object} models.SimpleHostnameResponse "Hostname" // @Router /api/notebook [post] -func (nr *NotebookRule) Insert(category string, hostname string, paramsJSON []byte) error { - return nr.baseInsert(category, hostname, paramsJSON) +// @Security Bearer +func (nr *NotebookRule) Insert(category string, params map[string]interface{}) (string, error) { + // Generate the hostname + + return nr.baseInsert(nr, category, params) } // @Summary Update hostname for category "notebook" @@ -84,10 +87,11 @@ func (nr *NotebookRule) Insert(category string, hostname string, paramsJSON []by // @ID update-notebook-hostname // @Accept json // @Produce json -// @Tags Generating Hostnames +// @Tags Manipulate existing Hostnames // @Param body body NotebookRuleInput true "Input data to generate hostname" // @Success 200 {object} models.SimpleHostnameResponse "Hostname" // @Router /api/notebook [put] -func (nr *NotebookRule) Update(category string, oldhostname string, hostname string, paramsJSON []byte) error { - return nr.baseUpdate(category, oldhostname, hostname, paramsJSON) +// @Security Bearer +func (nr *NotebookRule) Update(category string, oldhostname string, params map[string]interface{}) (string, error) { + return nr.baseUpdate(nr, category, oldhostname, params) }