diff --git a/backend/docs/docs.go b/backend/docs/docs.go index 2d065751..71993078 100644 --- a/backend/docs/docs.go +++ b/backend/docs/docs.go @@ -4877,6 +4877,14 @@ const docTemplate = `{ } ] }, + "web_app_landing_settings": { + "description": "WebAppLandingSettings", + "allOf": [ + { + "$ref": "#/definitions/domain.WebAppLandingSettings" + } + ] + }, "wechat_app_agent_id": { "type": "string" }, @@ -5097,6 +5105,14 @@ const docTemplate = `{ } ] }, + "web_app_landing_settings": { + "description": "WebApp Landing Settings", + "allOf": [ + { + "$ref": "#/definitions/domain.WebAppLandingSettings" + } + ] + }, "wechat_app_agent_id": { "type": "string" }, @@ -7144,6 +7160,167 @@ const docTemplate = `{ } } }, + "domain.WebAppLandingSettings": { + "type": "object", + "properties": { + "banner_config": { + "type": "object", + "properties": { + "bg_url": { + "type": "string" + }, + "btns": { + "type": "array", + "items": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "id": { + "type": "string" + }, + "text": { + "type": "string" + }, + "type": { + "type": "string" + } + } + } + }, + "hot_search": { + "type": "array", + "items": { + "type": "string" + } + }, + "placeholder": { + "type": "string" + }, + "sub_title": { + "type": "string" + }, + "subtitle_color": { + "type": "string" + }, + "subtitle_font_size": { + "type": "integer" + }, + "title": { + "type": "string" + }, + "title_color": { + "type": "string" + }, + "title_font_size": { + "type": "integer" + } + } + }, + "basic_doc_config": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "type": "string" + } + }, + "title": { + "type": "string" + } + } + }, + "carousel_config": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "url": { + "type": "string" + } + } + } + }, + "title": { + "type": "string" + } + } + }, + "com_config_order": { + "type": "array", + "items": { + "type": "string" + } + }, + "dir_doc_config": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "type": "string" + } + }, + "title": { + "type": "string" + } + } + }, + "faq_config": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "link": { + "type": "string" + }, + "question": { + "type": "string" + } + } + } + }, + "title": { + "type": "string" + } + } + }, + "simple_doc_config": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "type": "string" + } + }, + "title": { + "type": "string" + } + } + } + } + }, "domain.WidgetBotSettings": { "type": "object", "properties": { diff --git a/backend/docs/swagger.json b/backend/docs/swagger.json index 09c09620..88d36864 100644 --- a/backend/docs/swagger.json +++ b/backend/docs/swagger.json @@ -4870,6 +4870,14 @@ } ] }, + "web_app_landing_settings": { + "description": "WebAppLandingSettings", + "allOf": [ + { + "$ref": "#/definitions/domain.WebAppLandingSettings" + } + ] + }, "wechat_app_agent_id": { "type": "string" }, @@ -5090,6 +5098,14 @@ } ] }, + "web_app_landing_settings": { + "description": "WebApp Landing Settings", + "allOf": [ + { + "$ref": "#/definitions/domain.WebAppLandingSettings" + } + ] + }, "wechat_app_agent_id": { "type": "string" }, @@ -7137,6 +7153,167 @@ } } }, + "domain.WebAppLandingSettings": { + "type": "object", + "properties": { + "banner_config": { + "type": "object", + "properties": { + "bg_url": { + "type": "string" + }, + "btns": { + "type": "array", + "items": { + "type": "object", + "properties": { + "href": { + "type": "string" + }, + "id": { + "type": "string" + }, + "text": { + "type": "string" + }, + "type": { + "type": "string" + } + } + } + }, + "hot_search": { + "type": "array", + "items": { + "type": "string" + } + }, + "placeholder": { + "type": "string" + }, + "sub_title": { + "type": "string" + }, + "subtitle_color": { + "type": "string" + }, + "subtitle_font_size": { + "type": "integer" + }, + "title": { + "type": "string" + }, + "title_color": { + "type": "string" + }, + "title_font_size": { + "type": "integer" + } + } + }, + "basic_doc_config": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "type": "string" + } + }, + "title": { + "type": "string" + } + } + }, + "carousel_config": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "type": "object", + "properties": { + "desc": { + "type": "string" + }, + "id": { + "type": "string" + }, + "title": { + "type": "string" + }, + "url": { + "type": "string" + } + } + } + }, + "title": { + "type": "string" + } + } + }, + "com_config_order": { + "type": "array", + "items": { + "type": "string" + } + }, + "dir_doc_config": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "type": "string" + } + }, + "title": { + "type": "string" + } + } + }, + "faq_config": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "link": { + "type": "string" + }, + "question": { + "type": "string" + } + } + } + }, + "title": { + "type": "string" + } + } + }, + "simple_doc_config": { + "type": "object", + "properties": { + "list": { + "type": "array", + "items": { + "type": "string" + } + }, + "title": { + "type": "string" + } + } + } + } + }, "domain.WidgetBotSettings": { "type": "object", "properties": { diff --git a/backend/docs/swagger.yaml b/backend/docs/swagger.yaml index 8bc69579..7701b8d3 100644 --- a/backend/docs/swagger.yaml +++ b/backend/docs/swagger.yaml @@ -389,6 +389,10 @@ definitions: allOf: - $ref: '#/definitions/domain.WebAppCustomSettings' description: WebAppCustomStyle + web_app_landing_settings: + allOf: + - $ref: '#/definitions/domain.WebAppLandingSettings' + description: WebAppLandingSettings wechat_app_agent_id: type: string wechat_app_corpid: @@ -529,6 +533,10 @@ definitions: allOf: - $ref: '#/definitions/domain.WebAppCustomSettings' description: WebAppCustomStyle + web_app_landing_settings: + allOf: + - $ref: '#/definitions/domain.WebAppLandingSettings' + description: WebApp Landing Settings wechat_app_agent_id: type: string wechat_app_corpid: @@ -1869,6 +1877,110 @@ definitions: $ref: '#/definitions/domain.SocialMediaAccount' type: array type: object + domain.WebAppLandingSettings: + properties: + banner_config: + properties: + bg_url: + type: string + btns: + items: + properties: + href: + type: string + id: + type: string + text: + type: string + type: + type: string + type: object + type: array + hot_search: + items: + type: string + type: array + placeholder: + type: string + sub_title: + type: string + subtitle_color: + type: string + subtitle_font_size: + type: integer + title: + type: string + title_color: + type: string + title_font_size: + type: integer + type: object + basic_doc_config: + properties: + list: + items: + type: string + type: array + title: + type: string + type: object + carousel_config: + properties: + list: + items: + properties: + desc: + type: string + id: + type: string + title: + type: string + url: + type: string + type: object + type: array + title: + type: string + type: object + com_config_order: + items: + type: string + type: array + dir_doc_config: + properties: + list: + items: + type: string + type: array + title: + type: string + type: object + faq_config: + properties: + list: + items: + properties: + id: + type: string + link: + type: string + question: + type: string + type: object + type: array + title: + type: string + type: object + simple_doc_config: + properties: + list: + items: + type: string + type: array + title: + type: string + type: object + type: object domain.WidgetBotSettings: properties: btn_logo: diff --git a/backend/domain/app.go b/backend/domain/app.go index 21cb3586..6ad16719 100644 --- a/backend/domain/app.go +++ b/backend/domain/app.go @@ -143,6 +143,8 @@ type AppSettings struct { OpenAIAPIBotSettings OpenAIAPIBotSettings `json:"openai_api_bot_settings"` // Disclaimer Settings DisclaimerSettings DisclaimerSettings `json:"disclaimer_settings"` + // WebAppLandingSettings + WebAppLandingSettings *WebAppLandingSettings `json:"web_app_landing_settings,omitempty"` WatermarkContent string `json:"watermark_content"` WatermarkSetting consts.WatermarkSetting `json:"watermark_setting" validate:"omitempty,oneof='' hidden visible"` @@ -150,6 +152,56 @@ type AppSettings struct { ContributeSettings ContributeSettings `json:"contribute_settings"` } +type WebAppLandingSettings struct { + BannerConfig struct { + Title string `json:"title"` + TitleColor string `json:"title_color"` + TitleFontSize int `json:"title_font_size"` + Subtitle string `json:"sub_title"` + Placeholder string `json:"placeholder"` + SubtitleColor string `json:"subtitle_color"` + SubtitleFontSize int `json:"subtitle_font_size"` + BgURL string `json:"bg_url"` + HotSearch []string `json:"hot_search"` + Btns []struct { + ID string `json:"id"` + Text string `json:"text"` + Type string `json:"type"` + Href string `json:"href"` + } `json:"btns"` + } `json:"banner_config"` + BasicDocConfig struct { + Title string `json:"title"` + List []string `json:"list"` + } `json:"basic_doc_config"` + DirDocConfig struct { + Title string `json:"title"` + List []string `json:"list"` + } `json:"dir_doc_config"` + SimpleDocConfig struct { + Title string `json:"title"` + List []string `json:"list"` + } `json:"simple_doc_config"` + CarouselConfig struct { + Title string `json:"title"` + List []struct { + ID string `json:"id"` + Title string `json:"title"` + URL string `json:"url"` + Desc string `json:"desc"` + } `json:"list"` + } `json:"carousel_config"` + FaqConfig struct { + Title string `json:"title"` + List []struct { + ID string `json:"id"` + Question string `json:"question"` + Link string `json:"link"` + } `json:"list"` + } `json:"faq_config"` + ComConfigOrder []string `json:"com_config_order"` +} + type DisclaimerSettings struct { Content *string `json:"content"` } @@ -326,6 +378,8 @@ type AppSettingsResp struct { OpenAIAPIBotSettings OpenAIAPIBotSettings `json:"openai_api_bot_settings"` // Disclaimer Settings DisclaimerSettings DisclaimerSettings `json:"disclaimer_settings"` + // WebApp Landing Settings + WebAppLandingSettings *WebAppLandingSettings `json:"web_app_landing_settings,omitempty"` } func (s *AppSettingsResp) Scan(value any) error { diff --git a/backend/usecase/app.go b/backend/usecase/app.go index f202f40f..54d172eb 100644 --- a/backend/usecase/app.go +++ b/backend/usecase/app.go @@ -394,6 +394,8 @@ func (u *AppUsecase) GetAppDetailByKBIDAndAppType(ctx context.Context, kbID stri OpenAIAPIBotSettings: app.Settings.OpenAIAPIBotSettings, // disclaimer settings DisclaimerSettings: app.Settings.DisclaimerSettings, + // webapp landing settings + WebAppLandingSettings: app.Settings.WebAppLandingSettings, WatermarkContent: app.Settings.WatermarkContent, WatermarkSetting: app.Settings.WatermarkSetting, @@ -456,6 +458,8 @@ func (u *AppUsecase) GetWebAppInfo(ctx context.Context, kbID string) (*domain.Ap WebAppCustomSettings: app.Settings.WebAppCustomSettings, // Disclaimer Settings DisclaimerSettings: app.Settings.DisclaimerSettings, + // WebApp Landing Settings + WebAppLandingSettings: app.Settings.WebAppLandingSettings, WatermarkContent: app.Settings.WatermarkContent, WatermarkSetting: app.Settings.WatermarkSetting,