mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-31 13:58:49 +01:00
♻️ Refactor av
This commit is contained in:
parent
d80bed7b85
commit
9fd0565a61
6 changed files with 31 additions and 19 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue