wp-go/middleware/searchlimit.go

16 lines
227 B
Go
Raw Normal View History

2022-10-14 09:15:43 +00:00
package middleware
import "github.com/gin-gonic/gin"
func SearchLimit(num int64) func(ctx *gin.Context) {
fn := IpLimit(num)
return func(c *gin.Context) {
2022-10-17 12:04:29 +00:00
if c.Query("s") != "" {
2022-10-14 09:15:43 +00:00
fn(c)
} else {
c.Next()
}
}
}