init push
This commit is contained in:
29
backend/domain/setting.go
Normal file
29
backend/domain/setting.go
Normal file
@@ -0,0 +1,29 @@
|
||||
package domain
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
SettingKeySystemPrompt = "system_prompt"
|
||||
SettingBlockWords = "block_words"
|
||||
SettingCopyrightInfo = "本网站由 PandaWiki 提供技术支持"
|
||||
)
|
||||
|
||||
// table: settings
|
||||
type Setting struct {
|
||||
ID int `json:"id" gorm:"primary_key"`
|
||||
KBID string `json:"kb_id"`
|
||||
Key string `json:"key"`
|
||||
Value []byte `json:"value" gorm:"type:jsonb"` // JSON string
|
||||
Description string `json:"description"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
type SettingRepo interface {
|
||||
CreateOrUpdateSetting(ctx context.Context, setting *Setting) error
|
||||
GetSetting(ctx context.Context, kbID, key string) (*Setting, error)
|
||||
UpdateSetting(ctx context.Context, kbID, key, value string) error
|
||||
}
|
||||
Reference in New Issue
Block a user