feat(search): add link for search desc

This commit is contained in:
LinkinStars 2023-09-27 16:43:31 +08:00
parent 9d96dda29b
commit 545342db50
3 changed files with 5 additions and 1 deletions

View File

@ -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)
}

View File

@ -131,4 +131,5 @@ type SearchResp struct {
type SearchDescResp struct {
Name string `json:"name"`
Icon string `json:"icon"`
Link string `json:"link"`
}

View File

@ -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 {