|
|
|
@@ -672,9 +672,14 @@ func getRecommendOrg() ([]map[string]interface{}, error) { |
|
|
|
if err != nil { |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
resultOrg := make([]map[string]interface{}, 0) |
|
|
|
names := make([]string, 0) |
|
|
|
for _, userName := range result { |
|
|
|
user, err := models.GetUserByName(userName) |
|
|
|
names = append(names, userName) |
|
|
|
} |
|
|
|
users, _ := models.GetUsersByNames(names) |
|
|
|
resultOrg := make([]map[string]interface{}, 0) |
|
|
|
for i, _ := range result { |
|
|
|
user := users[i] |
|
|
|
if err == nil { |
|
|
|
userMap := make(map[string]interface{}) |
|
|
|
userMap["Name"] = user.Name |
|
|
|
@@ -789,24 +794,6 @@ func RecommendHomeInfo(ctx *context.Context) { |
|
|
|
ctx.JSON(http.StatusOK, mapInterface) |
|
|
|
} |
|
|
|
|
|
|
|
// func RecommendOrgFromPromote(ctx *context.Context) { |
|
|
|
// resultOrg, err := GetRecommendOrg() |
|
|
|
// if err != nil { |
|
|
|
// ctx.ServerError("500", err) |
|
|
|
// return |
|
|
|
// } |
|
|
|
// ctx.JSON(200, resultOrg) |
|
|
|
// } |
|
|
|
|
|
|
|
func RecommendRepoFromPromote(ctx *context.Context) { |
|
|
|
result, err := repository.GetRecommendRepoFromPromote("projects") |
|
|
|
if err != nil { |
|
|
|
ctx.ServerError("500", err) |
|
|
|
} else { |
|
|
|
ctx.JSON(200, result) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
func HomeTerm(ctx *context.Context) { |
|
|
|
ctx.HTML(200, tplHomeTerm) |
|
|
|
} |