Beispiel #1
0
 @PermitAll
 @GET
 @Path("/submission")
 @Produces("application/json")
 public List<Submission> listSubmissions() {
   SubmissionDAO submissionDao = new SubmissionDAO();
   try {
     return submissionDao.getAll();
   } catch (ForCodeDataException fde) {
     logger.warn(fde.getMessage());
     return null;
   }
 }
Beispiel #2
0
  @PermitAll
  @POST
  @Path("/submissionsbycontest")
  @Consumes("application/json")
  @Produces("application/json")
  public List<Submission> listSubmissions(Contest contest) {
    SubmissionDAO submissionDao = new SubmissionDAO();

    if (contest == null) return new ArrayList<Submission>();
    try {
      return submissionDao.getSubmissionsByContest(contest);
    } catch (ForCodeDataException fde) {
      logger.warn(fde.getMessage());
      return new ArrayList<Submission>();
    }
  }