♻️ Refactor av

This commit is contained in:
Daniel 2025-06-08 12:08:31 +08:00
parent d80bed7b85
commit 9fd0565a61
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
6 changed files with 31 additions and 19 deletions

View file

@ -24,16 +24,20 @@ import (
"github.com/siyuan-note/siyuan/kernel/util"
)
// Filterable 接口定义了可过滤的视图类型。
type Filterable interface {
FilterRows(attrView *AttributeView)
// Filter 根据视图中设置的过滤器进行过滤。
Filter(attrView *AttributeView)
}
// ViewFilter 描述了视图过滤器的结构。
type ViewFilter struct {
Column string `json:"column"`
Operator FilterOperator `json:"operator"`
Value *Value `json:"value"`
RelativeDate *RelativeDate `json:"relativeDate"`
RelativeDate2 *RelativeDate `json:"relativeDate2"`
Column string `json:"column"` // 列字段ID
Operator FilterOperator `json:"operator"` // 过滤操作符
Value *Value `json:"value"` // 过滤值
RelativeDate *RelativeDate `json:"relativeDate"` // 相对时间
RelativeDate2 *RelativeDate `json:"relativeDate2"` // 第二个相对时间,用于某些操作符,比如 FilterOperatorIsBetween
}
type RelativeDateUnit int