|
|
|
@ -1,4 +1,4 @@
@@ -1,4 +1,4 @@
|
|
|
|
|
package httpopera |
|
|
|
|
package api |
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
|
"encoding/json" |
|
|
|
@ -338,14 +338,14 @@ func (s *Server) handleReset(w http.ResponseWriter, r *http.Request) {
@@ -338,14 +338,14 @@ func (s *Server) handleReset(w http.ResponseWriter, r *http.Request) {
|
|
|
|
|
|
|
|
|
|
if err := r.ParseForm(); err != nil { |
|
|
|
|
res.Status = 400 |
|
|
|
|
res.Data = "url: /control/reset?room=ROOM_NAME" |
|
|
|
|
res.Data = "url: /control/reset?room=<ROOM_NAME>" |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
room := r.Form.Get("room") |
|
|
|
|
|
|
|
|
|
if len(room) == 0 { |
|
|
|
|
res.Status = 400 |
|
|
|
|
res.Data = "url: /control/get?room=ROOM_NAME" |
|
|
|
|
res.Data = "url: /control/get?room=<ROOM_NAME>" |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -370,7 +370,7 @@ func (s *Server) handleGet(w http.ResponseWriter, r *http.Request) {
@@ -370,7 +370,7 @@ func (s *Server) handleGet(w http.ResponseWriter, r *http.Request) {
|
|
|
|
|
|
|
|
|
|
if err := r.ParseForm(); err != nil { |
|
|
|
|
res.Status = 400 |
|
|
|
|
res.Data = "url: /control/get?room=ROOM_NAME" |
|
|
|
|
res.Data = "url: /control/get?room=<ROOM_NAME>" |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -378,7 +378,7 @@ func (s *Server) handleGet(w http.ResponseWriter, r *http.Request) {
@@ -378,7 +378,7 @@ func (s *Server) handleGet(w http.ResponseWriter, r *http.Request) {
|
|
|
|
|
|
|
|
|
|
if len(room) == 0 { |
|
|
|
|
res.Status = 400 |
|
|
|
|
res.Data = "url: /control/get?room=ROOM_NAME" |
|
|
|
|
res.Data = "url: /control/get?room=<ROOM_NAME>" |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -401,7 +401,7 @@ func (s *Server) handleDelete(w http.ResponseWriter, r *http.Request) {
@@ -401,7 +401,7 @@ func (s *Server) handleDelete(w http.ResponseWriter, r *http.Request) {
|
|
|
|
|
|
|
|
|
|
if err := r.ParseForm(); err != nil { |
|
|
|
|
res.Status = 400 |
|
|
|
|
res.Data = "url: /control/delete?room=ROOM_NAME" |
|
|
|
|
res.Data = "url: /control/delete?room=<ROOM_NAME>" |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -409,7 +409,7 @@ func (s *Server) handleDelete(w http.ResponseWriter, r *http.Request) {
@@ -409,7 +409,7 @@ func (s *Server) handleDelete(w http.ResponseWriter, r *http.Request) {
|
|
|
|
|
|
|
|
|
|
if len(room) == 0 { |
|
|
|
|
res.Status = 400 |
|
|
|
|
res.Data = "url: /control/get?room=ROOM_NAME" |
|
|
|
|
res.Data = "url: /control/get?room=<ROOM_NAME>" |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -418,5 +418,5 @@ func (s *Server) handleDelete(w http.ResponseWriter, r *http.Request) {
@@ -418,5 +418,5 @@ func (s *Server) handleDelete(w http.ResponseWriter, r *http.Request) {
|
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
res.Status = 404 |
|
|
|
|
res.Data = "Room not found" |
|
|
|
|
res.Data = "room not found" |
|
|
|
|
} |