gomvn/routes/utils.go

14 lines
257 B
Go
Raw Normal View History

2024-03-04 13:11:06 +00:00
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
}