Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat widget setting
  • Loading branch information
coltea committed Nov 5, 2025
commit 0aeda02985b892488029fc8d381a3dd6581fa49a
12 changes: 12 additions & 0 deletions backend/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -7444,6 +7444,18 @@ const docTemplate = `{
"is_open": {
"type": "boolean"
},
"recommend_node_ids": {
"type": "array",
"items": {
"type": "string"
}
},
"recommend_questions": {
"type": "array",
"items": {
"type": "string"
}
},
"theme_mode": {
"type": "string"
}
Expand Down
12 changes: 12 additions & 0 deletions backend/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -7437,6 +7437,18 @@
"is_open": {
"type": "boolean"
},
"recommend_node_ids": {
"type": "array",
"items": {
"type": "string"
}
},
"recommend_questions": {
"type": "array",
"items": {
"type": "string"
}
},
"theme_mode": {
"type": "string"
}
Expand Down
8 changes: 8 additions & 0 deletions backend/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2449,6 +2449,14 @@ definitions:
type: string
is_open:
type: boolean
recommend_node_ids:
items:
type: string
type: array
recommend_questions:
items:
type: string
type: array
theme_mode:
type: string
type: object
Expand Down
10 changes: 6 additions & 4 deletions backend/domain/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -399,10 +399,12 @@ type FooterSettings struct {
}

type WidgetBotSettings struct {
IsOpen bool `json:"is_open,omitempty"`
ThemeMode string `json:"theme_mode,omitempty"`
BtnText string `json:"btn_text,omitempty"`
BtnLogo string `json:"btn_logo,omitempty"`
IsOpen bool `json:"is_open,omitempty"`
ThemeMode string `json:"theme_mode,omitempty"`
BtnText string `json:"btn_text,omitempty"`
BtnLogo string `json:"btn_logo,omitempty"`
RecommendQuestions []string `json:"recommend_questions,omitempty"`
RecommendNodeIDs []string `json:"recommend_node_ids,omitempty"`
}

type BrandGroup struct {
Expand Down
6 changes: 3 additions & 3 deletions backend/usecase/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -646,14 +646,14 @@ func (u *AppUsecase) GetWidgetAppInfo(ctx context.Context, kbID string) (*domain
Icon: webApp.Settings.Icon,
WelcomeStr: webApp.Settings.WelcomeStr,
SearchPlaceholder: webApp.Settings.SearchPlaceholder,
RecommendQuestions: webApp.Settings.RecommendQuestions,
RecommendQuestions: widgetApp.Settings.WidgetBotSettings.RecommendQuestions,
WidgetBotSettings: widgetApp.Settings.WidgetBotSettings,
},
}
if len(webApp.Settings.RecommendNodeIDs) > 0 {
if len(widgetApp.Settings.WidgetBotSettings.RecommendNodeIDs) > 0 {
nodes, err := u.nodeUsecase.GetRecommendNodeList(ctx, &domain.GetRecommendNodeListReq{
KBID: kbID,
NodeIDs: webApp.Settings.RecommendNodeIDs,
NodeIDs: widgetApp.Settings.WidgetBotSettings.RecommendNodeIDs,
})
if err != nil {
return nil, err
Expand Down