Skip to content

Conversation

xiaomakuaiz
Copy link
Collaborator

No description provided.

@Copilot Copilot AI review requested due to automatic review settings September 26, 2025 10:55
Copy link

@Copilot Copilot AI left a 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.

Comment on lines +155 to +202
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"`
Copy link
Preview

Copilot AI Sep 26, 2025

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.

Suggested change
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant