|
|
@@ -14,6 +14,45 @@ import ( |
|
|
|
"github.com/360EntSecGroup-Skylar/excelize/v2" |
|
|
|
) |
|
|
|
|
|
|
|
func GetFilterInfo(ctx *context.APIContext) { |
|
|
|
filterType := ctx.QueryInt("type") |
|
|
|
limit := ctx.QueryInt("limit") |
|
|
|
if filterType == 0 { |
|
|
|
projectTypes := models.GetProjectTypes() |
|
|
|
allInstitutions := models.GetAllInstitutions() |
|
|
|
applyYears, executeYears := models.GetApplyExecuteYears() |
|
|
|
ctx.JSON(http.StatusOK, map[string]interface{}{ |
|
|
|
"type_name": projectTypes, |
|
|
|
"institution_name": allInstitutions, |
|
|
|
"execute_year": executeYears, |
|
|
|
"apply_year": applyYears, |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
if filterType == 1 { |
|
|
|
projectNames := models.GetProjectNames() |
|
|
|
topics := models.GetTechRepoTopics(limit) |
|
|
|
allInstitutions := models.GetAllInstitutions() |
|
|
|
ctx.JSON(http.StatusOK, map[string]interface{}{ |
|
|
|
"topic": topics, |
|
|
|
"institution_name": allInstitutions, |
|
|
|
"project_name": projectNames, |
|
|
|
}) |
|
|
|
return |
|
|
|
|
|
|
|
} |
|
|
|
ctx.Error(http.StatusBadRequest, "parameter error", "") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
func SearchRepoInfo(ctx *context.APIContext) { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
func SearchTechProjectInfo(ctx *context.APIContext) { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
func ImportBasicInfo(ctx *context.APIContext) { |
|
|
|
file, _, err := ctx.GetFile("file") |
|
|
|
if err != nil { |
|
|
|