重构框架,增加比赛功能

This commit is contained in:
masnn committed 2020-04-11 20:37:47 +08:00
1 parent 0e590ebe0d
commit 9bf3343a64
54 files changed
+1196 -868

No files matched your search

+5 -1
View File
@@ -63,6 +63,9 @@ async function getById(_id) {
async function getMany(query, sort, page, limit) {
return await coll.find(query).sort(sort).skip((page - 1) * limit).limit(limit).toArray();
}
function getMulti(query) {
return coll.find(query);
}
async function edit(_id, $set) {
if ($set.title) validator.checkTitle($set.title);
if ($set.content) validator.checkContent($set.content);
@@ -90,5 +93,6 @@ module.exports = {
edit,
count,
random,
getById
getById,
getMulti
};