mirror of
https://github.com/luscis/openlan.git
synced 2025-10-21 16:10:05 +08:00
fix: review API interface.
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/luscis/openlan/pkg/cache"
|
||||
"github.com/luscis/openlan/pkg/models"
|
||||
"github.com/luscis/openlan/pkg/schema"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type Route struct {
|
||||
@@ -38,7 +39,7 @@ func (rt Route) Add(w http.ResponseWriter, r *http.Request) {
|
||||
vars := mux.Vars(r)
|
||||
id := vars["id"]
|
||||
|
||||
worker := GetWorker(id)
|
||||
worker := Call.GetWorker(id)
|
||||
if worker == nil {
|
||||
http.Error(w, "Network not found", http.StatusInternalServerError)
|
||||
return
|
||||
@@ -63,7 +64,7 @@ func (rt Route) Del(w http.ResponseWriter, r *http.Request) {
|
||||
vars := mux.Vars(r)
|
||||
id := vars["id"]
|
||||
|
||||
worker := GetWorker(id)
|
||||
worker := Call.GetWorker(id)
|
||||
if worker == nil {
|
||||
http.Error(w, "Network not found", http.StatusInternalServerError)
|
||||
return
|
||||
@@ -88,7 +89,7 @@ func (rt Route) Save(w http.ResponseWriter, r *http.Request) {
|
||||
vars := mux.Vars(r)
|
||||
id := vars["id"]
|
||||
|
||||
worker := GetWorker(id)
|
||||
worker := Call.GetWorker(id)
|
||||
if worker == nil {
|
||||
http.Error(w, "Network not found", http.StatusInternalServerError)
|
||||
return
|
||||
|
Reference in New Issue
Block a user