🏗️ Change notebook.go to use new interface

This commit is contained in:
Florian Beisel 2024-01-21 16:19:42 +01:00
parent b681395287
commit 600fb0e997
Signed by: florian
GPG Key ID: 79ECA2E54996FF4D
1 changed files with 9 additions and 5 deletions

View File

@ -75,8 +75,11 @@ func (nr *NotebookRule) Generate(params map[string]interface{}) (string, []byte,
// @Param body body NotebookRuleInput true "Input data to generate hostname" // @Param body body NotebookRuleInput true "Input data to generate hostname"
// @Success 200 {object} models.SimpleHostnameResponse "Hostname" // @Success 200 {object} models.SimpleHostnameResponse "Hostname"
// @Router /api/notebook [post] // @Router /api/notebook [post]
func (nr *NotebookRule) Insert(category string, hostname string, paramsJSON []byte) error { // @Security Bearer
return nr.baseInsert(category, hostname, paramsJSON) 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" // @Summary Update hostname for category "notebook"
@ -84,10 +87,11 @@ func (nr *NotebookRule) Insert(category string, hostname string, paramsJSON []by
// @ID update-notebook-hostname // @ID update-notebook-hostname
// @Accept json // @Accept json
// @Produce json // @Produce json
// @Tags Generating Hostnames // @Tags Manipulate existing Hostnames
// @Param body body NotebookRuleInput true "Input data to generate hostname" // @Param body body NotebookRuleInput true "Input data to generate hostname"
// @Success 200 {object} models.SimpleHostnameResponse "Hostname" // @Success 200 {object} models.SimpleHostnameResponse "Hostname"
// @Router /api/notebook [put] // @Router /api/notebook [put]
func (nr *NotebookRule) Update(category string, oldhostname string, hostname string, paramsJSON []byte) error { // @Security Bearer
return nr.baseUpdate(category, oldhostname, hostname, paramsJSON) func (nr *NotebookRule) Update(category string, oldhostname string, params map[string]interface{}) (string, error) {
return nr.baseUpdate(nr, category, oldhostname, params)
} }