This commit is contained in:
toom1996
2026-08-30 10:45:34 +08:00
parent a6724265ad
commit 9c3403a903
23 changed files with 284 additions and 508 deletions

View File

@ -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 == "" {