major refactoring of the api
This commit is contained in:
1 parent
d4f7dc57fc
commit
f0628e4682
38 files changed
+821
-367
No files matched your search
@@ -0,0 +1,21 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
func GetAllDoormen(w http.ResponseWriter, request *http.Request) {
|
||||
fmt.Fprint(w, `{"doormen" :[`)
|
||||
doormenIds := conn.GetAllDoormen()
|
||||
buff := <-doormenIds
|
||||
if buff == nil {
|
||||
fmt.Fprint(w, "]}")
|
||||
return
|
||||
}
|
||||
for doormanId := range doormenIds {
|
||||
fmt.Fprint(w, getDoormenIdsAsJson(buff)+`,`)
|
||||
buff = doormanId
|
||||
}
|
||||
fmt.Fprint(w, getDoormenIdsAsJson(buff), "]}")
|
||||
}
|
||||
Reference in new issue
Block a user