diff --git a/kernel/av/attribute_view.go b/kernel/av/av.go similarity index 98% rename from kernel/av/attribute_view.go rename to kernel/av/av.go index 7b85ffcca..5ef3560d8 100644 --- a/kernel/av/attribute_view.go +++ b/kernel/av/av.go @@ -14,7 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see . -// Package av 是属性视图相关的实现。 +// Package av 包含了属性视图(Attribute View)相关的实现。 package av import ( diff --git a/kernel/av/column.go b/kernel/av/column.go index 3eb5b47a1..08b9fd37b 100644 --- a/kernel/av/column.go +++ b/kernel/av/column.go @@ -47,3 +47,10 @@ func (c *BaseColumn) Name() string { func (c *BaseColumn) Type() string { return c.BaseType } + +// ColumnValueResolver 描述了属性视图的列值解析器。 +type ColumnValueResolver interface { + + // Resolve 用于解析列值。 + Resolve() string +} diff --git a/kernel/av/column_relation.go b/kernel/av/column_relation.go index d7696c42d..73c076085 100644 --- a/kernel/av/column_relation.go +++ b/kernel/av/column_relation.go @@ -20,8 +20,3 @@ type ColumnRelation struct { *BaseColumn AttributeViewID string `json:"attributeViewId"` // 关联的属性视图 ID } - -type AttributeViewColumnRollup struct { - *BaseColumn - RelationID string `json:"relationId"` // 目标关联列 ID -} diff --git a/kernel/av/column_rollup.go b/kernel/av/column_rollup.go new file mode 100644 index 000000000..a2eac26b2 --- /dev/null +++ b/kernel/av/column_rollup.go @@ -0,0 +1,22 @@ +// SiYuan - Build Your Eternal Digital Garden +// Copyright (c) 2020-present, b3log.org +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +package av + +type ColumnRollup struct { + *BaseColumn + RelationColumnID string `json:"relationColumnId"` // 目标关联列 ID +}