Skip to content

Commit

Permalink
perf: 修复多答案情况
Browse files Browse the repository at this point in the history
  • Loading branch information
DokiDoki1103 committed Oct 26, 2024
1 parent 4d68593 commit 41e68af
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/search/wanneng.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,16 @@ func (in *WannengClient) SearchAnswer(req model.SearchRequest) (answer [][]strin
for _, ans := range res.Result.Answers {
var innerArray []string
for _, val := range ans.([]interface{}) {
if len(innerArray) > 0 {
innerArray = append(innerArray, val.(string))
s := val.(string)
if len(s) > 0 {
innerArray = append(innerArray, s)
}
}

if len(innerArray) > 0 {
answer = append(answer, innerArray)
}
}
fmt.Println(res.Result.Answers)
return answer, nil
}

0 comments on commit 41e68af

Please sign in to comment.