Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.3.2^2
zouap 3 years ago
parent
commit
0eb327a82d
1 changed files with 8 additions and 4 deletions
  1. +8
    -4
      routers/search.go

+ 8
- 4
routers/search.go View File

@@ -455,10 +455,14 @@ func makeIssueResult(sRes *elastic.SearchResult, Key string) *SearchRes {
record["id"] = recordSource["id"]
record["repo_id"] = recordSource["repo_id"]
log.Info("recordSource[\"repo_id\"]=" + fmt.Sprint(recordSource["repo_id"]))
repo, errRepo := models.GetRepositoryByID(recordSource["repo_id"].(int64))
if errRepo == nil {
record["repoUrl"] = repo.FullName()
record["avatar"] = repo.RelAvatarLink()
repoIdstr := recordSource["repo_id"].(string)
repoId, cerr := strconv.ParseInt(repoIdstr, 10, 64)
if cerr == nil {
repo, errRepo := models.GetRepositoryByID(repoId)
if errRepo == nil {
record["repoUrl"] = repo.FullName()
record["avatar"] = repo.RelAvatarLink()
}
}
record["name"] = recordSource["name"]
desc := recordSource["content"].(string)


Loading…
Cancel
Save