Merge pull request #433 from xiaomakuaiz/feat-bg

feat: add style config for web app
This commit is contained in:
xiaomakuaiz 2025-06-30 18:46:51 +08:00 committed by GitHub
commit fc4bb6c5af
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 49 additions and 4 deletions

View File

@ -2018,6 +2018,9 @@ const docTemplate = `{
"search_placeholder": {
"type": "string"
},
"theme_and_style": {
"$ref": "#/definitions/domain.ThemeAndStyle"
},
"theme_mode": {
"description": "theme",
"type": "string"
@ -2123,6 +2126,9 @@ const docTemplate = `{
"search_placeholder": {
"type": "string"
},
"theme_and_style": {
"$ref": "#/definitions/domain.ThemeAndStyle"
},
"theme_mode": {
"description": "theme",
"type": "string"
@ -3330,6 +3336,14 @@ const docTemplate = `{
}
}
},
"domain.ThemeAndStyle": {
"type": "object",
"properties": {
"bg_image": {
"type": "string"
}
}
},
"domain.UpdateAppReq": {
"type": "object",
"properties": {

View File

@ -2007,6 +2007,9 @@
"search_placeholder": {
"type": "string"
},
"theme_and_style": {
"$ref": "#/definitions/domain.ThemeAndStyle"
},
"theme_mode": {
"description": "theme",
"type": "string"
@ -2112,6 +2115,9 @@
"search_placeholder": {
"type": "string"
},
"theme_and_style": {
"$ref": "#/definitions/domain.ThemeAndStyle"
},
"theme_mode": {
"description": "theme",
"type": "string"
@ -3319,6 +3325,14 @@
}
}
},
"domain.ThemeAndStyle": {
"type": "object",
"properties": {
"bg_image": {
"type": "string"
}
}
},
"domain.UpdateAppReq": {
"type": "object",
"properties": {

View File

@ -88,6 +88,8 @@ definitions:
type: array
search_placeholder:
type: string
theme_and_style:
$ref: '#/definitions/domain.ThemeAndStyle'
theme_mode:
description: theme
type: string
@ -158,6 +160,8 @@ definitions:
type: array
search_placeholder:
type: string
theme_and_style:
$ref: '#/definitions/domain.ThemeAndStyle'
theme_mode:
description: theme
type: string
@ -968,6 +972,11 @@ definitions:
required:
- text
type: object
domain.ThemeAndStyle:
properties:
bg_image:
type: string
type: object
domain.UpdateAppReq:
properties:
name:

View File

@ -70,13 +70,18 @@ type AppSettings struct {
WeChatAppAgentID string `json:"wechat_app_agent_id,omitempty"`
// theme
ThemeMode string `json:"theme_mode,omitempty"`
ThemeMode string `json:"theme_mode,omitempty"`
ThemeAndStyle ThemeAndStyle `json:"theme_and_style"`
// catalog settings
CatalogSettings CatalogSettings `json:"catalog_settings"`
// footer settings
FooterSettings FooterSettings `json:"footer_settings"`
}
type ThemeAndStyle struct {
BGImage string `json:"bg_image,omitempty"`
}
type CatalogSettings struct {
CatalogFolder int `json:"catalog_folder,omitempty"` // 1: 展开, 2: 折叠, default: 1
CatalogWidth int `json:"catalog_width,omitempty"` // 200 - 300, default: 260
@ -160,7 +165,8 @@ type AppSettingsResp struct {
WeChatAppAgentID string `json:"wechat_app_agent_id,omitempty"`
// theme
ThemeMode string `json:"theme_mode,omitempty"`
ThemeMode string `json:"theme_mode,omitempty"`
ThemeAndStyle ThemeAndStyle `json:"theme_and_style"`
// catalog settings
CatalogSettings CatalogSettings `json:"catalog_settings"`
// footer settings

View File

@ -264,7 +264,8 @@ func (u *AppUsecase) GetAppDetailByKBIDAndAppType(ctx context.Context, kbID stri
WeChatAppAgentID: app.Settings.WeChatAppAgentID,
// theme
ThemeMode: app.Settings.ThemeMode,
ThemeMode: app.Settings.ThemeMode,
ThemeAndStyle: app.Settings.ThemeAndStyle,
// catalog settings
CatalogSettings: app.Settings.CatalogSettings,
// footer settings
@ -304,7 +305,8 @@ func (u *AppUsecase) GetWebAppInfo(ctx context.Context, kbID string) (*domain.Ap
HeadCode: app.Settings.HeadCode,
BodyCode: app.Settings.BodyCode,
// theme
ThemeMode: app.Settings.ThemeMode,
ThemeMode: app.Settings.ThemeMode,
ThemeAndStyle: app.Settings.ThemeAndStyle,
// catalog settings
CatalogSettings: app.Settings.CatalogSettings,
// footer settings