1.0.0-preview

This commit is contained in:
masnn committed 2020-05-13 12:25:18 +08:00
1 parent 90b06d6aa7
commit 8cd84f29e8
18 files changed
+152 -401

No files matched your search

+8 -1
View File
@@ -160,7 +160,13 @@ async function setTestdata(_id, readStream) {
return await edit(_id, { data: f.id }); // eslint-disable-line no-return-await
}
module.exports = {
async function getData(pid) {
const pdoc = await get(pid);
if (!pdoc.data) return null;
return gridfs.openDownloadStream(pdoc.data);
}
global.Hydro.model.problem = module.exports = {
add,
inc,
get,
@@ -175,4 +181,5 @@ module.exports = {
getMultiStatus,
setTestdata,
updateStatus,
getData,
};