feat: 完成源晶权限与经验系统并优化 me/admin 交互
这个提交包含在:
@@ -42,9 +42,15 @@ void LeaderboardController::global(
|
||||
if (!limit_str.empty()) {
|
||||
limit = std::max(1, std::min(500, std::stoi(limit_str)));
|
||||
}
|
||||
std::string scope = req->getParameter("scope");
|
||||
if (scope.empty()) scope = "all";
|
||||
if (scope != "all" && scope != "week" && scope != "today") {
|
||||
cb(JsonError(drogon::k400BadRequest, "invalid scope"));
|
||||
return;
|
||||
}
|
||||
|
||||
services::UserService users(csp::AppState::Instance().db());
|
||||
const auto rows = users.GlobalLeaderboard(limit);
|
||||
const auto rows = users.GlobalLeaderboard(limit, scope);
|
||||
|
||||
Json::Value arr(Json::arrayValue);
|
||||
for (const auto& r : rows) arr.append(domain::ToJson(r));
|
||||
|
||||
在新工单中引用
屏蔽一个用户