chat_dataset_document_mapping.go
1.5 KB
package domain
import (
"context"
"gitlab.fjmaimaimai.com/allied-creation/su-micro/pkg/transaction"
)
type ChatDatasetDocumentMapping struct {
Id int64 // 唯一标识
DatasetId int64
DocumentId int64
CreatedAt int64 `json:",omitempty"`
UpdatedAt int64 `json:",omitempty"`
DeletedAt int64 `json:",omitempty"`
Version int `json:",omitempty"`
}
type ChatDatasetDocumentMappingRepository interface {
Insert(ctx context.Context, conn transaction.Conn, dm *ChatDatasetDocumentMapping) (*ChatDatasetDocumentMapping, error)
Update(ctx context.Context, conn transaction.Conn, dm *ChatDatasetDocumentMapping) (*ChatDatasetDocumentMapping, error)
UpdateWithVersion(ctx context.Context, conn transaction.Conn, dm *ChatDatasetDocumentMapping) (*ChatDatasetDocumentMapping, error)
Delete(ctx context.Context, conn transaction.Conn, dm *ChatDatasetDocumentMapping) (*ChatDatasetDocumentMapping, error)
FindOne(ctx context.Context, conn transaction.Conn, id int64) (*ChatDatasetDocumentMapping, error)
FindOneUnscoped(ctx context.Context, conn transaction.Conn, id int64) (*ChatDatasetDocumentMapping, error)
Find(ctx context.Context, conn transaction.Conn, queryOptions map[string]interface{}) (int64, []*ChatDatasetDocumentMapping, error)
FindByDataset(ctx context.Context, conn transaction.Conn, datasetId ...int64) (int64, []*ChatDatasetDocumentMapping, error)
DeleteByDataset(ctx context.Context, conn transaction.Conn, datasetId int64) error
DeleteByDocument(ctx context.Context, conn transaction.Conn, documentId int64) error
}