@@ -2,6 +2,7 @@ interface JobConstructorOpts {
22 id : number
33 source : string
44 lang : string
5+ scenario : "run" | "submit"
56 timelimit ?: number
67}
78interface RunJobConstructorOpts extends JobConstructorOpts {
@@ -20,30 +21,32 @@ export class Job {
2021 id : number
2122 source : string
2223 lang : string
24+ scenario : string
2325 timelimit ?: number
2426
25- constructor ( { id, source, lang, timelimit = 5 } : JobConstructorOpts ) {
27+ constructor ( { id, source, lang, timelimit = 5 , scenario } : JobConstructorOpts ) {
2628 this . id = id
2729 this . source = source
2830 this . lang = lang
2931 this . timelimit = timelimit
32+ this . scenario = scenario
3033 }
3134}
3235
3336export class RunJob extends Job {
3437 stdin : string
3538
36- constructor ( { id, source, lang, timelimit, stdin } : RunJobConstructorOpts ) {
37- super ( { id, source, lang, timelimit} )
39+ constructor ( { id, source, lang, timelimit, scenario , stdin } : RunJobConstructorOpts ) {
40+ super ( { id, source, lang, timelimit, scenario } )
3841 this . stdin = stdin
3942 }
4043}
4144
4245export class SubmitJob extends Job {
4346 testcases : Array < TestcaseOpts >
4447
45- constructor ( { id, source, lang, timelimit, testcases } : SubmitJobConstructorOpts ) {
46- super ( { id, source, lang, timelimit} )
48+ constructor ( { id, source, lang, timelimit, scenario , testcases } : SubmitJobConstructorOpts ) {
49+ super ( { id, source, lang, timelimit, scenario } )
4750 this . testcases = testcases
4851 }
4952}
0 commit comments