Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

feat(search): add link for search desc

LinkinStars545342db50d1
diff --git a/internal/controller/search_controller.go b/internal/controller/search_controller.go
index 354c3423..82674195 100644
--- a/internal/controller/search_controller.go
+++ b/internal/controller/search_controller.go
@@ -90,6 +90,7 @@ func (sc *SearchController) SearchDesc(ctx *gin.Context) {
if finder != nil {
resp.Name = finder.Info().Name.Translate(ctx)
resp.Icon = finder.Description().Icon
+ resp.Link = finder.Description().Link
}
handler.HandleResponse(ctx, nil, resp)
}
diff --git a/internal/schema/search_schema.go b/internal/schema/search_schema.go
index aaf0c8ae..e30e6997 100644
--- a/internal/schema/search_schema.go
+++ b/internal/schema/search_schema.go
@@ -131,4 +131,5 @@ type SearchResp struct {
type SearchDescResp struct {
Name string `json:"name"`
Icon string `json:"icon"`
+ Link string `json:"link"`
}
diff --git a/plugin/search.go b/plugin/search.go
index 37a64f4e..37587ced 100644
--- a/plugin/search.go
+++ b/plugin/search.go
@@ -93,8 +93,10 @@ type Search interface {
}
type SearchDesc struct {
- // A svg icon it wil be display in search result page
+ // A svg icon it wil be display in search result page. optional
Icon string `json:"icon"`
+ // The link address of the search engine. optional
+ Link string `json:"link"`
}
type SearchSyncer interface {