dao

package
v0.0.0-...-b336c4c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDatabase

func NewDatabase(config *configs.Config) *ent.Client

func WithTx

func WithTx[T any](db *ent.Client, exe func(tx *ent.Tx) (*T, error)) (*T, error)

Types

type Dao

type Dao struct {
	DB *ent.Client
}

func NewDao

func NewDao(client *ent.Client) *Dao

func (*Dao) CreateOpenAIToken

func (d *Dao) CreateOpenAIToken(token string) error

func (*Dao) DeleteOpenAIToken

func (d *Dao) DeleteOpenAIToken(token string) error

func (*Dao) DeleteOpenAITokenById

func (d *Dao) DeleteOpenAITokenById(id int) error

func (*Dao) FinaAllActiveOpenAIToken

func (d *Dao) FinaAllActiveOpenAIToken() ([]*ent.OpenAIToken, error)

func (*Dao) FindChatHistoryByChatId

func (d *Dao) FindChatHistoryByChatId(chatId int64) (*ent.ChatHistory, error)

func (*Dao) UpdateChatHistory

func (d *Dao) UpdateChatHistory(chatId int64, content string) error

Directories

Path Synopsis
ent

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL