Documentation
¶
Index ¶
- Constants
- Variables
- type RTagToObject
- func (mdl *RTagToObject) GetForeignKey() string
- func (mdl *RTagToObject) GetForeignValue() string
- func (mdl *RTagToObject) GetJoinKey() string
- func (mdl *RTagToObject) GetJoinValue() string
- func (mdl *RTagToObject) GetOwnerKey() string
- func (mdl *RTagToObject) GetOwnerValue() string
- func (mdl *RTagToObject) GetPivotComposedUniqueID() string
- func (mdl *RTagToObject) GetPivots(db *gorm.DB) ([]*RTagToObject, error)
- func (mdl *RTagToObject) GetTableName(needFull bool) string
- func (mdl *RTagToObject) MakePivotsFromObjectAndTags(obj database.ModelInterface, tags []*Tag) ([]database.PivotInterface, error)
- func (mdl *RTagToObject) SetTableFullName(tableName string)
- func (mdl *RTagToObject) TableName() string
- type Tag
- func (mdl *Tag) ClearAssociations(db *gorm.DB) (err error)
- func (mdl *Tag) GetComposedUniqueID() string
- func (mdl *Tag) GetForeignKey() string
- func (mdl *Tag) GetTableName(needFull bool) string
- func (mdl *Tag) GetTagUniqueIDsFromTags(tags []*Tag) []string
- func (mdl *Tag) SetTableFullName(tableName string)
- func (mdl *Tag) TableName() string
- func (mdl *Tag) WhereTagName(uuidOrName string) func(db *gorm.DB) *gorm.DB
- type TagGroup
- type TagObjectInterface
Constants ¶
View Source
const DEFAULT_GROUP_NAME = "默认组"
View Source
const DEFAULT_OWNER_TYPE = "default"
View Source
const R_TAG_TO_OJECT_FOREIGN_KEY = "taggable_object_id"
View Source
const R_TAG_TO_OJECT_JOIN_KEY = "tag_id"
View Source
const R_TAG_TO_OJECT_OWNER_KEY = "taggable_owner_type"
View Source
const R_TAG_TO_OJECT_UNIQUE_ID = "index_tag_to_object_id"
View Source
const TABLE_NAME_R_TAG_TO_OBJECT = "r_tag_to_object"
View Source
const TABLE_NAME_TAG = "tags"
View Source
const TABLE_NAME_TAG_GROUP = "tag_groups"
View Source
const TAG_GROUP_UNIQUE_ID = "index_tag_group_id"
View Source
const TAG_TYPE_NORMAL int8 = 1
View Source
const TAG_TYPE_STAGE int8 = 2
View Source
const TAG_UNIQUE_ID = "index_tag_id"
Variables ¶
View Source
var TABLE_FULL_NAME_R_TAG_TO_OBJECT string = "public.ac_" + TABLE_NAME_R_TAG_TO_OBJECT
View Source
var TABLE_FULL_NAME_TAG string = "public.ac_" + TABLE_NAME_TAG
View Source
var TABLE_FULL_NAME_TAG_GROUP = "public.ac_" + TABLE_NAME_TAG_GROUP
Functions ¶
This section is empty.
Types ¶
type RTagToObject ¶
type RTagToObject struct {
*database.PowerPivot
//common fields
UniqueID object.NullString `gorm:"index:index_taggable_object_id;index:index_taggable_id;index;column:index_tag_to_object_id;unique"`
TaggableOwnerType object.NullString `gorm:"column:taggable_owner_type;not null" json:"taggableOwnerType"`
TaggableObjectID object.NullString `gorm:"column:taggable_object_id;not null;index:index_taggable_object_id" json:"taggableObjectID"`
TaggableID object.NullString `gorm:"column:tag_id;not null;index:index_taggable_id" json:"taggableID"`
}
r_tag_to_object 数据表结构
func (*RTagToObject) GetForeignKey ¶
func (mdl *RTagToObject) GetForeignKey() string
func (*RTagToObject) GetForeignValue ¶
func (mdl *RTagToObject) GetForeignValue() string
func (*RTagToObject) GetJoinKey ¶
func (mdl *RTagToObject) GetJoinKey() string
func (*RTagToObject) GetJoinValue ¶
func (mdl *RTagToObject) GetJoinValue() string
func (*RTagToObject) GetOwnerKey ¶
func (mdl *RTagToObject) GetOwnerKey() string
func (*RTagToObject) GetOwnerValue ¶
func (mdl *RTagToObject) GetOwnerValue() string
func (*RTagToObject) GetPivotComposedUniqueID ¶
func (mdl *RTagToObject) GetPivotComposedUniqueID() string
func (*RTagToObject) GetPivots ¶
func (mdl *RTagToObject) GetPivots(db *gorm.DB) ([]*RTagToObject, error)
func (*RTagToObject) GetTableName ¶
func (mdl *RTagToObject) GetTableName(needFull bool) string
func (*RTagToObject) MakePivotsFromObjectAndTags ¶
func (mdl *RTagToObject) MakePivotsFromObjectAndTags(obj database.ModelInterface, tags []*Tag) ([]database.PivotInterface, error)
func (*RTagToObject) SetTableFullName ¶
func (mdl *RTagToObject) SetTableFullName(tableName string)
func (*RTagToObject) TableName ¶
func (mdl *RTagToObject) TableName() string
TableName overrides the table name used by RTagToObject to `profiles`
type Tag ¶
type Tag struct {
*database.PowerCompactModel
TagGroup *TagGroup `gorm:"foreignKey:GroupID;references:UniqueID" json:"tagGroup"`
UniqueID string `gorm:"column:index_tag_id;index:,unique" json:"tagID"`
Name string `gorm:"column:name;" json:"name"`
GroupID string `gorm:"column:group_id" json:"groupID"`
Type int8 `gorm:"column:type" json:"type"`
}
Tag 数据表结构
func NewTag ¶
func NewTag(mapObject *object.Collection) *Tag
func (*Tag) GetComposedUniqueID ¶
func (*Tag) GetForeignKey ¶
func (*Tag) GetTagUniqueIDsFromTags ¶
func (*Tag) SetTableFullName ¶
type TagGroup ¶
type TagGroup struct {
*database.PowerCompactModel
Tags []*Tag `gorm:"foreignKey:GroupID;references:UniqueID" json:"tags"`
UniqueID string `gorm:"column:index_tag_group_id;index:,unique" json:"tagGroupID"`
GroupName string `gorm:"column:group_name;index:index_group_name" json:"groupName"`
OwnerType string `gorm:"column:owner_type;index:index_owner_type" json:"ownerType"`
}
func GetDefaultTagGroup ¶
func NewTagGroup ¶
func NewTagGroup(mapObject *object.Collection) *TagGroup
func (*TagGroup) CheckTagGroupNameAvailable ¶
func (*TagGroup) GetComposedUniqueID ¶
func (*TagGroup) GetTableName ¶
获取当前 Model 的数据库表名称
func (*TagGroup) SetTableFullName ¶
type TagObjectInterface ¶
Click to show internal directories.
Click to hide internal directories.