|
|
@ -5,7 +5,6 @@ import (
|
|
|
|
"online_code/core"
|
|
|
|
"online_code/core"
|
|
|
|
"online_code/models/param"
|
|
|
|
"online_code/models/param"
|
|
|
|
"online_code/repository"
|
|
|
|
"online_code/repository"
|
|
|
|
"online_code/utils"
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
type problemApi struct{}
|
|
|
|
type problemApi struct{}
|
|
|
@ -26,8 +25,7 @@ func (problemApi) GetProbleList(ctx *gin.Context) {
|
|
|
|
core.R(ctx).FailWithMessage("获取题目列表失败: " + err.Error())
|
|
|
|
core.R(ctx).FailWithMessage("获取题目列表失败: " + err.Error())
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 计算总页码
|
|
|
|
|
|
|
|
totalPage := utils.GenTotalPage(count, p.Size)
|
|
|
|
|
|
|
|
// 返回结果
|
|
|
|
// 返回结果
|
|
|
|
core.R(ctx).OkWithData(core.PageData{Current: p.Current, Size: p.Size, Total: count, TotalPage: totalPage, Records: records})
|
|
|
|
core.R(ctx).OkDataPage(count, core.PageData{Current: p.Current, Size: p.Size, Total: count, Records: records})
|
|
|
|
}
|
|
|
|
}
|
|
|
|