Add bookmark in persistence layer

This commit is contained in:
Deluan 2020-07-31 15:32:08 -04:00 committed by Deluan Quintão
parent 3d4f4b4e2b
commit 2d3ed85311
7 changed files with 172 additions and 25 deletions

View file

@ -51,6 +51,18 @@ func ParamInt(r *http.Request, param string, def int) int {
return int(value)
}
func ParamInt64(r *http.Request, param string, def int64) int64 {
v := ParamString(r, param)
if v == "" {
return def
}
value, err := strconv.ParseInt(v, 10, 64)
if err != nil {
return def
}
return value
}
func ParamInts(r *http.Request, param string) []int {
pStr := ParamStrings(r, param)
ints := make([]int, 0, len(pStr))