함수 이름을 인자로 받음
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) {
|
||||
lastSlash := strings.LastIndex(r.URL.Path, "/")
|
||||
fname := r.URL.Path[lastSlash:]
|
||||
if found := hc.methods[fname]; found != nil {
|
||||
func (hc *HttpApiHandlerContainer) Call(funcname string, w http.ResponseWriter, r *http.Request) {
|
||||
if found := hc.methods[funcname]; found != nil {
|
||||
found(w, r)
|
||||
} else {
|
||||
logger.Println("api is not found :", fname)
|
||||
logger.Println("api is not found :", funcname)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user