-
Notifications
You must be signed in to change notification settings - Fork 556
feat: add landing page settings #1248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: add landing page settings #1248
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for landing page settings in the web application by introducing a new WebAppLandingSettings
configuration structure. The feature allows customization of various landing page components including banners, documentation sections, carousels, and FAQ sections.
- Introduces a comprehensive
WebAppLandingSettings
struct with multiple configuration sections - Integrates the new settings into existing app configuration retrieval methods
- Updates API documentation to reflect the new settings structure
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
backend/domain/app.go | Defines the new WebAppLandingSettings struct and integrates it into AppSettings and AppSettingsResp |
backend/usecase/app.go | Adds WebAppLandingSettings to app detail and web app info retrieval methods |
backend/docs/swagger.yaml | Updates Swagger documentation to include the new landing settings schema |
backend/docs/swagger.json | Updates JSON schema documentation for the new landing settings |
backend/docs/docs.go | Updates generated Go documentation with the new landing settings definitions |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The WebAppLandingSettings
struct contains deeply nested anonymous structs which makes the code difficult to maintain and test. Consider extracting these nested structs into separate named types (e.g., BannerConfig
, DocConfig
, CarouselConfig
, FaqConfig
) to improve readability and reusability.
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"` | |
// Extracted types for WebAppLandingSettings | |
type BannerBtn struct { | |
ID string `json:"id"` | |
Text string `json:"text"` | |
Type string `json:"type"` | |
Href string `json:"href"` | |
} | |
type 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 []BannerBtn `json:"btns"` | |
} | |
type DocConfig struct { | |
Title string `json:"title"` | |
List []string `json:"list"` | |
} | |
type CarouselItem struct { | |
ID string `json:"id"` | |
Title string `json:"title"` | |
URL string `json:"url"` | |
Desc string `json:"desc"` | |
} | |
type CarouselConfig struct { | |
Title string `json:"title"` | |
List []CarouselItem `json:"list"` | |
} | |
type FaqItem struct { | |
ID string `json:"id"` | |
Question string `json:"question"` | |
Link string `json:"link"` | |
} | |
type FaqConfig struct { | |
Title string `json:"title"` | |
List []FaqItem `json:"list"` | |
} | |
type WebAppLandingSettings struct { | |
BannerConfig BannerConfig `json:"banner_config"` | |
BasicDocConfig DocConfig `json:"basic_doc_config"` | |
DirDocConfig DocConfig `json:"dir_doc_config"` | |
SimpleDocConfig DocConfig `json:"simple_doc_config"` | |
CarouselConfig CarouselConfig `json:"carousel_config"` | |
FaqConfig FaqConfig `json:"faq_config"` | |
ComConfigOrder []string `json:"com_config_order"` |
Copilot uses AI. Check for mistakes.
No description provided.