|
|
|
@@ -7,7 +7,6 @@ package routers |
|
|
|
|
|
|
|
import ( |
|
|
|
"bytes" |
|
|
|
"fmt" |
|
|
|
"net/http" |
|
|
|
"strconv" |
|
|
|
"strings" |
|
|
|
@@ -758,15 +757,6 @@ func GetRankUser(index string) ([]map[string]interface{}, error) { |
|
|
|
return resultOrg, nil |
|
|
|
} |
|
|
|
|
|
|
|
// func GetImageInfoFromPromote(ctx *context.Context) { |
|
|
|
// imageInfo, err := GetImageInfo() |
|
|
|
// if err != nil { |
|
|
|
// ctx.ServerError("500", err) |
|
|
|
// return |
|
|
|
// } |
|
|
|
// ctx.JSON(200, imageInfo) |
|
|
|
// } |
|
|
|
|
|
|
|
func GetUserRankFromPromote(ctx *context.Context) { |
|
|
|
index := ctx.Params("index") |
|
|
|
resultUserRank, err := GetRankUser(index) |
|
|
|
@@ -790,27 +780,15 @@ func RecommendHomeInfo(ctx *context.Context) { |
|
|
|
if err != nil { |
|
|
|
log.Info("error." + err.Error()) |
|
|
|
} |
|
|
|
resultCloudBrain, err := getCloudbrainNums() |
|
|
|
if err != nil { |
|
|
|
log.Info("error." + err.Error()) |
|
|
|
} |
|
|
|
|
|
|
|
mapInterface := make(map[string]interface{}) |
|
|
|
mapInterface["org"] = resultOrg |
|
|
|
mapInterface["repo"] = resultRepo |
|
|
|
mapInterface["image"] = resultImage |
|
|
|
mapInterface["cloudbrain"] = resultCloudBrain |
|
|
|
//mapInterface["cloudbrain"] = resultCloudBrain |
|
|
|
ctx.JSON(http.StatusOK, mapInterface) |
|
|
|
} |
|
|
|
|
|
|
|
func getCloudbrainNums() (map[string]string, error) { |
|
|
|
result := make(map[string]string) |
|
|
|
cloudStatusMap := models.GetAllStatusCloudBrain() |
|
|
|
result["completed_task"] = fmt.Sprint(cloudStatusMap["COMPLETED"]) |
|
|
|
result["running_task"] = fmt.Sprint(cloudStatusMap["RUNNING"]) |
|
|
|
result["wait_task"] = fmt.Sprint(cloudStatusMap["WAITING"]) |
|
|
|
return result, nil |
|
|
|
} |
|
|
|
|
|
|
|
// func RecommendOrgFromPromote(ctx *context.Context) { |
|
|
|
// resultOrg, err := GetRecommendOrg() |
|
|
|
// if err != nil { |
|
|
|
|