This commit is contained in:
Mr. Lan
2020-07-15 01:40:56 +08:00
parent 1f5c67832b
commit ad740914d9
40 changed files with 3278 additions and 124 deletions

32
pkg/pagination/params.go Normal file
View File

@@ -0,0 +1,32 @@
package pagination
import (
"github.com/RichardKnop/machinery/v1/log"
"github.com/gin-gonic/gin"
)
/*
@Author : lanyulei
*/
func RequestParams(c *gin.Context) map[string]interface{} {
params := make(map[string]interface{}, 10)
if c.Request.Form == nil {
if err := c.Request.ParseMultipartForm(32 << 20); err != nil {
log.ERROR.Println(err)
}
}
if len(c.Request.Form) > 0 {
for key, value := range c.Request.Form {
if key == "page" || key == "per_page" || key == "sort" {
continue
}
params[key] = value[0]
}
}
return params
}