chat_dataset.go 1.2 KB
package domain

import (
	"context"
	"gitlab.fjmaimaimai.com/allied-creation/su-micro/pkg/transaction"
)

type ChatDataset struct {
	Id        int64 // 唯一标识
	CompanyId int64
	UserId    int64
	Name      string // 知识库名称
	Desc      string // 描述
	Status    int    // 1:启用 2:禁用
	CreatedAt int64  `json:",omitempty"`
	UpdatedAt int64  `json:",omitempty"`
	DeletedAt int64  `json:",omitempty"`
	Version   int    `json:",omitempty"`
}

func ChatDatasetId(m *ChatDataset) int64 {
	return m.Id
}

type ChatDatasetRepository interface {
	Insert(ctx context.Context, conn transaction.Conn, dm *ChatDataset) (*ChatDataset, error)
	Update(ctx context.Context, conn transaction.Conn, dm *ChatDataset) (*ChatDataset, error)
	UpdateWithVersion(ctx context.Context, conn transaction.Conn, dm *ChatDataset) (*ChatDataset, error)
	Delete(ctx context.Context, conn transaction.Conn, dm *ChatDataset) (*ChatDataset, error)
	FindOne(ctx context.Context, conn transaction.Conn, id int64) (*ChatDataset, error)
	FindOneUnscoped(ctx context.Context, conn transaction.Conn, id int64) (*ChatDataset, error)
	Find(ctx context.Context, conn transaction.Conn, queryOptions map[string]interface{}) (int64, []*ChatDataset, error)
}