init push

This commit is contained in:
2026-05-21 19:52:45 +08:00
commit e3f75311ab
1280 changed files with 179173 additions and 0 deletions

29
backend/domain/setting.go Normal file
View 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
}