update
This commit is contained in:
@ -45,10 +45,8 @@ func queryInt(c *gin.Context, key string, def int) int {
|
||||
// queryBool 读取布尔查询参数。
|
||||
//
|
||||
// def 为该参数缺失时的取值:
|
||||
// - def=true(如 only_with_articles):只有显式传 0 / false 才关闭;
|
||||
// - def=true(如某开关默认开启):只有显式传 0 / false 才关闭;
|
||||
// - def=false(如 featured):只有显式传 1 / true 才开启。
|
||||
//
|
||||
// 这两种语义都来自原项目,必须保持,否则前端 A-Z 索引的数据量会突变。
|
||||
func queryBool(c *gin.Context, key string, def bool) bool {
|
||||
v := strings.ToLower(strings.TrimSpace(c.Query(key)))
|
||||
if v == "" {
|
||||
|
||||
Reference in New Issue
Block a user