blog_backend_api/controller/helper/helper.go

20 lines
309 B
Go
Raw Normal View History

2020-08-23 18:08:26 +00:00
package helper
import (
"background/controller/params"
"github.com/gin-gonic/gin"
)
func GetPageParam(c *gin.Context) (int, int) {
var limit, offset int
var ok bool
limit, ok = c.Keys[params.K_OFFSET].(int)
if !ok {
}
offset, ok = c.Keys[params.K_OFFSET].(int)
if !ok {
}
return limit, offset
}