package handler // nonNilSlice 保证 JSON 序列化为 [] 而非 null(Go nil slice 会编成 null)。 func nonNilSlice[T any](s []T) []T { if s == nil { return []T{} } return s }