mirror of https://gitee.com/answerdev/answer.git
feat(search): add link for search desc
This commit is contained in:
parent
9d96dda29b
commit
545342db50
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -131,4 +131,5 @@ type SearchResp struct {
|
|||
type SearchDescResp struct {
|
||||
Name string `json:"name"`
|
||||
Icon string `json:"icon"`
|
||||
Link string `json:"link"`
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue