mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 17:46:28 +08:00
template: problem_detail
This commit is contained in:
1 parent
2e23d05a59
commit
ffa193b5dd
43 files changed
+265
-242
No files matched your search
@@ -1,5 +1,5 @@
|
||||
const
|
||||
{ CONTEXT } = require('../service/server'),
|
||||
{ GET, POST } = require('../service/server'),
|
||||
queue = require('../service/queue'),
|
||||
record = require('../model/record'),
|
||||
{ requirePerm } = require('./tools'),
|
||||
@@ -7,12 +7,10 @@ const
|
||||
|
||||
queue.assert('judge');
|
||||
|
||||
const { MIDDLEWARE, GET, POST } = CONTEXT();
|
||||
MIDDLEWARE(requirePerm(PERM_JUDGE));
|
||||
GET('/judge/noop', async ctx => {
|
||||
GET('/judge/noop', requirePerm(PERM_JUDGE), async ctx => {
|
||||
ctx.body = {};
|
||||
});
|
||||
GET('/judge/fetch', async ctx => {
|
||||
GET('/judge/fetch', requirePerm(PERM_JUDGE), async ctx => {
|
||||
let rid = await queue.get('judge', false);
|
||||
if (rid) {
|
||||
let rdoc = await record.get(rid);
|
||||
@@ -27,9 +25,9 @@ GET('/judge/fetch', async ctx => {
|
||||
ctx.body = data;
|
||||
}
|
||||
});
|
||||
POST('/judge/next', async ctx => {
|
||||
POST('/judge/next', requirePerm(PERM_JUDGE), async ctx => {
|
||||
console.log(ctx.request.body);
|
||||
});
|
||||
POST('/judge/end', async ctx => {
|
||||
POST('/judge/end', requirePerm(PERM_JUDGE), async ctx => {
|
||||
console.log(ctx.request.body);
|
||||
});
|
||||
Reference in new issue
Block a user