Browse Source

提交代码。

Signed-off-by: zouap <zouap@pcl.ac.cn>
tags/v1.22.5.1^2
zouap 4 years ago
parent
commit
367bcec7d4
2 changed files with 5 additions and 4 deletions
  1. +4
    -3
      routers/home.go
  2. +1
    -1
      routers/routes/routes.go

+ 4
- 3
routers/home.go View File

@@ -642,8 +642,8 @@ func GetRecommendOrg() ([]map[string]interface{}, error) {
return resultOrg, nil
}

func GetRankUser() ([]map[string]interface{}, error) {
url := setting.RecommentRepoAddr + "user_rank"
func GetRankUser(index string) ([]map[string]interface{}, error) {
url := setting.RecommentRepoAddr + "user_rank_" + index
result, err := repository.RecommendFromPromote(url)

if err != nil {
@@ -681,7 +681,8 @@ func GetRankUser() ([]map[string]interface{}, error) {
}

func GetUserRankFromPromote(ctx *context.Context) {
resultUserRank, err := GetRankUser()
index := ctx.Params("index")
resultUserRank, err := GetRankUser(index)
if err != nil {
ctx.ServerError("500", err)
return


+ 1
- 1
routers/routes/routes.go View File

@@ -325,7 +325,7 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Get("/action/notification", routers.ActionNotification)
m.Get("/recommend/org", routers.RecommendOrgFromPromote)
m.Get("/recommend/repo", routers.RecommendRepoFromPromote)
m.Get("/recommend/userrank", routers.GetUserRankFromPromote)
m.Get("/recommend/userrank/:index", routers.GetUserRankFromPromote)
m.Post("/all/search/", routers.Search)
m.Get("/all/search/", routers.EmptySearch)
m.Get("/all/dosearch/", routers.SearchApi)


Loading…
Cancel
Save