Search in sources :

Example 26 with Problem

use of cn.edu.zjnu.acm.judge.domain.Problem in project judge by zjnu-acm.

the class MockDataService method problem.

@Nonnull
public Problem problem(Function<Problem.Builder, Problem.Builder> function, boolean create) {
    Objects.requireNonNull(function);
    Problem problem = function.apply(Problem.builder().title("").description("").input("").output("").sampleInput("").sampleOutput("").hint("").source("").timeLimit(1000L).memoryLimit(65536 * 1024L).contests(new long[] { 0 })).build();
    if (create) {
        problemService.save(problem);
    }
    return problem;
}
Also used : Problem(cn.edu.zjnu.acm.judge.domain.Problem) Nonnull(javax.annotation.Nonnull)

Aggregations

Problem (cn.edu.zjnu.acm.judge.domain.Problem)26 Contest (cn.edu.zjnu.acm.judge.domain.Contest)10 BusinessException (cn.edu.zjnu.acm.judge.exception.BusinessException)10 Nonnull (javax.annotation.Nonnull)7 Submission (cn.edu.zjnu.acm.judge.domain.Submission)6 GetMapping (org.springframework.web.bind.annotation.GetMapping)6 ArrayList (java.util.ArrayList)5 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)5 ScoreCount (cn.edu.zjnu.acm.judge.data.dto.ScoreCount)4 Test (org.junit.jupiter.api.Test)4 BusinessCode (cn.edu.zjnu.acm.judge.exception.BusinessCode)3 IOException (java.io.IOException)3 Transactional (org.springframework.transaction.annotation.Transactional)3 BestSubmissionForm (cn.edu.zjnu.acm.judge.data.form.BestSubmissionForm)2 ContestForm (cn.edu.zjnu.acm.judge.data.form.ContestForm)2 ContestStatus (cn.edu.zjnu.acm.judge.data.form.ContestStatus)2 ContestMapper (cn.edu.zjnu.acm.judge.mapper.ContestMapper)2 SubmissionMapper (cn.edu.zjnu.acm.judge.mapper.SubmissionMapper)2 EnumUtils (cn.edu.zjnu.acm.judge.util.EnumUtils)2 SpecialCall (cn.edu.zjnu.acm.judge.util.SpecialCall)2