This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
Commit 4fcd4368 authored by Michael Breu's avatar Michael Breu
Browse files

Minor cleaUp

parent 34e166de
Branches
1 merge request!105Preparing März Release
package at.ac.uibk.gitsearch.repository.search;
import at.ac.uibk.gitsearch.domain.Authority;
import at.ac.uibk.gitsearch.service.dto.AutoCompleteEntry;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import java.io.IOException;
import java.time.Instant;
import java.util.ArrayList;
......@@ -21,14 +14,15 @@ import java.util.StringTokenizer;
import java.util.Timer;
import java.util.TimerTask;
import java.util.TreeMap;
import java.util.concurrent.CancellationException;
import java.util.function.Consumer;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.annotation.PostConstruct;
import javax.ws.rs.NotFoundException;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
......@@ -58,6 +52,15 @@ import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.User;
import org.springframework.stereotype.Repository;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import at.ac.uibk.gitsearch.domain.Authority;
import at.ac.uibk.gitsearch.service.dto.AutoCompleteEntry;
@Repository
public class MetaDataRepository {
......
package at.ac.uibk.gitsearch.web.rest;
import at.ac.uibk.gitsearch.es.model.ArtemisExerciseInfo;
import at.ac.uibk.gitsearch.security.SecurityUtils;
import at.ac.uibk.gitsearch.service.ArtemisImportError;
import at.ac.uibk.gitsearch.service.ExerciseService;
import at.ac.uibk.gitsearch.service.GitlabService;
import at.ac.uibk.gitsearch.service.SearchService;
import at.ac.uibk.gitsearch.service.SearchService.ExtractionDepth;
import at.ac.uibk.gitsearch.service.StatisticsService;
import at.ac.uibk.gitsearch.service.dto.StatisticsDTO;
import at.ac.uibk.gitsearch.web.rest.utils.RestUtils;
import at.ac.uibk.gitsearch.web.util.HeaderUtil;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
......@@ -23,8 +12,10 @@ import java.net.URL;
import java.nio.file.Files;
import java.text.ParseException;
import java.util.Optional;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.core.Response;
import org.apache.commons.lang3.StringUtils;
import org.codeability.sharing.plugins.api.search.SearchResultDTO;
import org.codeability.sharing.plugins.api.search.util.ExerciseId;
......@@ -39,7 +30,6 @@ import org.springframework.core.io.Resource;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.util.AntPathMatcher;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
......@@ -49,6 +39,18 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.HandlerMapping;
import at.ac.uibk.gitsearch.es.model.ArtemisExerciseInfo;
import at.ac.uibk.gitsearch.security.SecurityUtils;
import at.ac.uibk.gitsearch.service.ArtemisImportError;
import at.ac.uibk.gitsearch.service.ExerciseService;
import at.ac.uibk.gitsearch.service.GitlabService;
import at.ac.uibk.gitsearch.service.SearchService;
import at.ac.uibk.gitsearch.service.SearchService.ExtractionDepth;
import at.ac.uibk.gitsearch.service.StatisticsService;
import at.ac.uibk.gitsearch.service.dto.StatisticsDTO;
import at.ac.uibk.gitsearch.web.rest.utils.RestUtils;
import at.ac.uibk.gitsearch.web.util.HeaderUtil;
/**
* this resource should give access to various aspects of an exercise or course
* @author Michael Breu
......
package at.ac.uibk.gitsearch.web.rest;
import at.ac.uibk.gitsearch.domain.Likes;
import at.ac.uibk.gitsearch.service.LikesQueryService;
import at.ac.uibk.gitsearch.service.LikesService;
import at.ac.uibk.gitsearch.service.SearchService;
import at.ac.uibk.gitsearch.service.UserService;
import at.ac.uibk.gitsearch.service.dto.LikesCriteria;
import at.ac.uibk.gitsearch.web.rest.errors.BadRequestAlertException;
import at.ac.uibk.gitsearch.web.rest.utils.RestUtils;
import java.net.URI;
import java.net.URISyntaxException;
import java.time.LocalDate;
import java.util.List;
import java.util.Optional;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.util.AntPathMatcher;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
......@@ -30,6 +23,15 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.HandlerMapping;
import at.ac.uibk.gitsearch.domain.Likes;
import at.ac.uibk.gitsearch.service.LikesQueryService;
import at.ac.uibk.gitsearch.service.LikesService;
import at.ac.uibk.gitsearch.service.SearchService;
import at.ac.uibk.gitsearch.service.UserService;
import at.ac.uibk.gitsearch.service.dto.LikesCriteria;
import at.ac.uibk.gitsearch.web.rest.errors.BadRequestAlertException;
import at.ac.uibk.gitsearch.web.rest.utils.RestUtils;
import tech.jhipster.web.util.HeaderUtil;
import tech.jhipster.web.util.ResponseUtil;
......
package at.ac.uibk.gitsearch.web.rest;
import at.ac.uibk.gitsearch.repository.StatisticsRepository;
import at.ac.uibk.gitsearch.service.SearchService;
import at.ac.uibk.gitsearch.service.StatisticsService;
import at.ac.uibk.gitsearch.service.dto.StatisticsDTO;
import at.ac.uibk.gitsearch.web.rest.errors.BadRequestAlertException;
import at.ac.uibk.gitsearch.web.rest.utils.RestUtils;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.charset.Charset;
import java.util.List;
import java.util.Optional;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -21,7 +16,6 @@ import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpHeaders;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.util.AntPathMatcher;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
......@@ -32,6 +26,13 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.HandlerMapping;
import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
import at.ac.uibk.gitsearch.repository.StatisticsRepository;
import at.ac.uibk.gitsearch.service.SearchService;
import at.ac.uibk.gitsearch.service.StatisticsService;
import at.ac.uibk.gitsearch.service.dto.StatisticsDTO;
import at.ac.uibk.gitsearch.web.rest.errors.BadRequestAlertException;
import at.ac.uibk.gitsearch.web.rest.utils.RestUtils;
import tech.jhipster.web.util.HeaderUtil;
import tech.jhipster.web.util.PaginationUtil;
import tech.jhipster.web.util.ResponseUtil;
......@@ -167,7 +168,7 @@ public class StatisticsResource {
// TODO there is a race condition, if serveral parallel requests do not find an entry.
if (searchService.findExerciseById(exerciseId).isPresent()) {
// the exercise exists in the meta data search index
// the exercise exists in the meta data search index
StatisticsDTO newStats = new StatisticsDTO();
newStats.setDownloads(0);
newStats.setViews(1);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment