|
|
|
@@ -10,6 +10,7 @@ import ( |
|
|
|
"code.gitea.io/gitea/modules/context" |
|
|
|
"code.gitea.io/gitea/modules/log" |
|
|
|
"code.gitea.io/gitea/modules/setting" |
|
|
|
"code.gitea.io/gitea/modules/timeutil" |
|
|
|
"github.com/olivere/elastic/v7" |
|
|
|
) |
|
|
|
|
|
|
|
@@ -642,6 +643,7 @@ func makeUserOrOrgResult(sRes *elastic.SearchResult, Key string, ctx *context.Co |
|
|
|
record["avatar"] = strings.TrimRight(setting.AppSubURL, "/") + "/user/avatar/" + recordSource["name"].(string) + "/" + strconv.Itoa(-1) |
|
|
|
record["updated_unix"] = recordSource["updated_unix"] |
|
|
|
record["created_unix"] = recordSource["created_unix"] |
|
|
|
record["add_time"] = getAddTime(recordSource["created_unix"].(int64)) |
|
|
|
result = append(result, record) |
|
|
|
} else { |
|
|
|
log.Info("deal user source error," + err.Error()) |
|
|
|
@@ -658,6 +660,11 @@ func makeUserOrOrgResult(sRes *elastic.SearchResult, Key string, ctx *context.Co |
|
|
|
return returnObj |
|
|
|
} |
|
|
|
|
|
|
|
func getAddTime(time int64) string { |
|
|
|
t := timeutil.TimeStamp(time) |
|
|
|
return t.FormatShort() |
|
|
|
} |
|
|
|
|
|
|
|
func searchDataSet(ctx *context.Context, TableName string, Key string, Page int, PageSize int, OnlyReturnNum bool) { |
|
|
|
/* |
|
|
|
数据集,ES名称:dataset-es-index |
|
|
|
|