18 lines
454 B
Go
18 lines
454 B
Go
|
package handlers
|
||
|
|
||
|
import (
|
||
|
"net/http"
|
||
|
|
||
|
"git.espin.casa/albert/cml04-falcon-system/handset/eventer"
|
||
|
"github.com/julienschmidt/httprouter"
|
||
|
)
|
||
|
|
||
|
func BarCodeHandler(eventer eventer.Eventer) httprouter.Handle {
|
||
|
return func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||
|
barcode := ps.ByName("barcode")
|
||
|
if err := eventer.BarCode(r.Context(), barcode); err != nil {
|
||
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||
|
}
|
||
|
}
|
||
|
}
|