gomvn/routes/utils.go
2024-03-04 13:11:06 +00:00

14 lines
257 B
Go

package routes
import (
"github.com/julienschmidt/httprouter"
"strconv"
)
func getQueryUserId(params httprouter.Params) (int64, bool) {
if val, err := strconv.ParseInt(params.ByName("id"), 10, 64); err == nil {
return val, true
}
return 0, false
}