http api broker call 변경
This commit is contained in:
13
server.go
13
server.go
@ -772,7 +772,18 @@ func (hc *HttpApiBroker) AddHandler(receiver HttpApiHandler) {
|
||||
}
|
||||
}
|
||||
|
||||
func (hc *HttpApiBroker) Call(funcname string, w http.ResponseWriter, r *http.Request) {
|
||||
func (hc *HttpApiBroker) Call(w http.ResponseWriter, r *http.Request) {
|
||||
funcname := r.URL.Query().Get("call")
|
||||
if len(funcname) == 0 {
|
||||
logger.Println("query param 'call' is missing")
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
return
|
||||
|
||||
}
|
||||
hc.call(funcname, w, r)
|
||||
}
|
||||
|
||||
func (hc *HttpApiBroker) call(funcname string, w http.ResponseWriter, r *http.Request) {
|
||||
if found := hc.methods[funcname]; found != nil {
|
||||
found(w, r)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user