|
|
|
@@ -535,10 +535,18 @@ func recommendFromPromote(ctx *context.Context, url string) { |
|
|
|
|
|
|
|
allLineStr := string(bytes) |
|
|
|
lines := strings.Split(allLineStr, "\n") |
|
|
|
result := make([]string, len(lines)) |
|
|
|
for i, line := range lines { |
|
|
|
log.Info("i=" + fmt.Sprint(i) + " line=" + line) |
|
|
|
|
|
|
|
tmpIndex := strings.Index(line, ".") |
|
|
|
log.Info("i=" + fmt.Sprint(i) + " line=" + line + " tmpIndex=" + fmt.Sprint(tmpIndex)) |
|
|
|
if tmpIndex == -1 { |
|
|
|
continue |
|
|
|
} else { |
|
|
|
result[i] = strings.Trim(line[tmpIndex:], " ") |
|
|
|
} |
|
|
|
} |
|
|
|
ctx.JSON(http.StatusOK, lines) |
|
|
|
ctx.JSON(http.StatusOK, result) |
|
|
|
} |
|
|
|
|
|
|
|
func RecommendRepoFromPromote(ctx *context.Context) { |
|
|
|
|