Пример #1
0
  @Transactional(readOnly = true)
  public Result renderImage(long contestId, long contestProblemId, String imageFilename)
      throws ContestNotFoundException, ContestProblemNotFoundException {
    Contest contest = contestService.findContestById(contestId);
    ContestProblem contestProblem = contestProblemService.findContestProblemById(contestProblemId);
    if (!contest.getJid().equals(contestProblem.getContestJid())) {
      return notFound();
    }

    String imageUrl =
        sandalphonClientAPI.getProblemStatementMediaRenderAPIEndpoint(
            contestProblem.getProblemJid(), imageFilename);

    return redirect(imageUrl);
  }