🏗️ Change notebook.go to use new interface
This commit is contained in:
parent
b681395287
commit
600fb0e997
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue