package model

import (
	"context"
	"yx-dataset-server/app/schema"
)

// IDatasetRelation DatasetRelation 存储接口
type IDatasetRelation interface {
	// 查询数据
	Query(ctx context.Context, params schema.DatasetRelationQueryParam, opts ...schema.DatasetRelationQueryOptions) (*schema.DatasetRelationQueryResult, error)
	// 查询指定数据
	Get(ctx context.Context, recordID string, opts ...schema.DatasetRelationQueryOptions) (*schema.DatasetRelation, error)
	// 创建数据
	Create(ctx context.Context, item schema.DatasetRelation) error
	// 更新数据
	Update(ctx context.Context, recordID string, item schema.DatasetRelation) error
	// 删除数据
	Delete(ctx context.Context, recordID string) error
	// DeleteByBizId 按业务id删除（用户id或组织id）
	DeleteByBizId(ctx context.Context, bizId string) error
	// DeleteByBizIdAndType 按业务id+类型删除
	DeleteByBizIdAndType(ctx context.Context, bizId string, t int) error
	// DeleteByDatasetId 按知识库id删除
	DeleteByDatasetId(ctx context.Context, datasetId string) error
}
