blog_backend_api/controller/helper/helper.go

20 lines
309 B
Go

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
}