함수 이름을 인자로 받음
This commit is contained in:
@ -682,12 +682,10 @@ func (hc *HttpApiHandlerContainer) RegistReceiver(receiver HttpApiReceiver) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (hc *HttpApiHandlerContainer) Call(w http.ResponseWriter, r *http.Request) {
|
func (hc *HttpApiHandlerContainer) Call(funcname string, w http.ResponseWriter, r *http.Request) {
|
||||||
lastSlash := strings.LastIndex(r.URL.Path, "/")
|
if found := hc.methods[funcname]; found != nil {
|
||||||
fname := r.URL.Path[lastSlash:]
|
|
||||||
if found := hc.methods[fname]; found != nil {
|
|
||||||
found(w, r)
|
found(w, r)
|
||||||
} else {
|
} else {
|
||||||
logger.Println("api is not found :", fname)
|
logger.Println("api is not found :", funcname)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user