mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 17:46:28 +08:00
core&ui: drop graphql apis
This commit is contained in:
1 parent
0f7961d675
commit
6e16d03f67
52 files changed
+485
-583
No files matched your search
@@ -742,33 +742,6 @@ export async function apply(ctx: Context) {
|
||||
}
|
||||
await Promise.all(tasks);
|
||||
});
|
||||
ctx.inject(['api'], ({ api }) => {
|
||||
api.value('Contest', [
|
||||
['_id', 'ObjectID!'],
|
||||
['domainId', 'String!'],
|
||||
['docId', 'ObjectID!'],
|
||||
['owner', 'Int!'],
|
||||
['beginAt', 'Date!'],
|
||||
['title', 'String!'],
|
||||
['content', 'String!'],
|
||||
['beginAt', 'Date!'],
|
||||
['endAt', 'Date!'],
|
||||
['attend', 'Int!'],
|
||||
['pids', '[Int]!'],
|
||||
['rated', 'Boolean!'],
|
||||
]);
|
||||
api.resolver(
|
||||
'Query', 'contest(id: ObjectID!)', 'Contest',
|
||||
async (arg, c) => {
|
||||
c.checkPerm(PERM.PERM_VIEW);
|
||||
arg.id = new ObjectId(arg.id);
|
||||
c.tdoc = await contest.get(c.args.domainId, new ObjectId(arg.id));
|
||||
if (!c.tdoc) throw new ContestNotFoundError(c.args.domainId, arg.id);
|
||||
return c.tdoc;
|
||||
},
|
||||
'Get a contest by ID',
|
||||
);
|
||||
});
|
||||
ctx.plugin(ScoreboardService);
|
||||
ctx.inject(['scoreboard'], ({ Route, scoreboard }) => {
|
||||
Route('contest_scoreboard', '/contest/:tid/scoreboard', ContestScoreboardHandler, PERM.PERM_VIEW_CONTEST_SCOREBOARD);
|
||||
|
||||
Reference in new issue
Block a user