|
|
|
@@ -736,23 +736,11 @@ func getImageInfo(filename string) ([]map[string]string, error) { |
|
|
|
func GetMapInfo(ctx *context.Context) { |
|
|
|
filename := ctx.Query("filename") |
|
|
|
url := setting.RecommentRepoAddr + filename |
|
|
|
result, err := repository.RecommendFromPromote(url) |
|
|
|
imageInfo := make(map[string]string, 0) |
|
|
|
result, err := repository.RecommendContentFromPromote(url) |
|
|
|
if err != nil { |
|
|
|
ctx.JSON(http.StatusOK, imageInfo) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
for i := 0; i < len(result); i++ { |
|
|
|
strLine := result[i] |
|
|
|
tmpIndex := strings.Index(strLine, "=") |
|
|
|
if tmpIndex != -1 { |
|
|
|
key := strLine[0:tmpIndex] |
|
|
|
value := strLine[tmpIndex+1:] |
|
|
|
imageInfo[key] = value |
|
|
|
} |
|
|
|
log.Info("get file error:" + err.Error()) |
|
|
|
} |
|
|
|
ctx.JSON(http.StatusOK, imageInfo) |
|
|
|
ctx.JSON(http.StatusOK, result) |
|
|
|
} |
|
|
|
|
|
|
|
func GetRankUser(index string) ([]map[string]interface{}, error) { |
|
|
|
|