Documentation ¶
Index ¶
- func NewDatabase(config *configs.Config) *ent.Client
- func WithTx[T any](db *ent.Client, exe func(tx *ent.Tx) (*T, error)) (*T, error)
- type Dao
- func (d *Dao) CreateOpenAIToken(token string) error
- func (d *Dao) DeleteOpenAIToken(token string) error
- func (d *Dao) DeleteOpenAITokenById(id int) error
- func (d *Dao) FinaAllActiveOpenAIToken() ([]*ent.OpenAIToken, error)
- func (d *Dao) FindChatHistoryByChatId(chatId int64) (*ent.ChatHistory, error)
- func (d *Dao) UpdateChatHistory(chatId int64, content string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Dao ¶
func (*Dao) CreateOpenAIToken ¶
func (*Dao) DeleteOpenAIToken ¶
func (*Dao) DeleteOpenAITokenById ¶
func (*Dao) FinaAllActiveOpenAIToken ¶
func (d *Dao) FinaAllActiveOpenAIToken() ([]*ent.OpenAIToken, error)
func (*Dao) FindChatHistoryByChatId ¶
func (d *Dao) FindChatHistoryByChatId(chatId int64) (*ent.ChatHistory, error)
Click to show internal directories.
Click to hide internal directories.