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

Skip to content
Snippets Groups Projects
Commit 4a1897db authored by Daniel Rainer's avatar Daniel Rainer
Browse files

Clean up SearchResource.java

parent 9c704657
2 merge requests!17Initial Merge to Prepare Release 1.0.0,!2Add gitlab metadata
......@@ -2,7 +2,6 @@ package at.ac.uibk.gitsearch.web.rest;
import java.io.IOException;
import java.util.List;
import java.util.Map.Entry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -28,7 +27,7 @@ import at.ac.uibk.gitsearch.service.dto.SearchResultsDTO;
@Transactional
public class SearchResource {
private final Logger log = LoggerFactory.getLogger(SearchResource.class);
private final Logger log = LoggerFactory.getLogger(SearchResource.class);
private final SearchService searchService;
......@@ -37,66 +36,66 @@ public class SearchResource {
}
/**
* {@code SEARCH /search/page-details} : search for the searchResults corresponding
* to the query.
* {@code SEARCH /search/page-details} : search for the searchResults corresponding
* to the query.
*
* @param query the query of the searchResult search.
* @return the result of the search.
* @param query the query of the searchResult search.
* @return the result of the search.
*/
@PostMapping("/search/page-details")
public SearchResultsDTO
searchPageDetails(@RequestBody SearchInputDTO query) throws IOException {
log.debug("REST request to search {}", query);
return searchService.searchResultPage(query,SearchInputDTO.PAGE_SIZE*query.getPage(), SearchInputDTO.PAGE_SIZE);
return searchService.searchResultPage(query, (long) SearchInputDTO.PAGE_SIZE * (long) query.getPage(), SearchInputDTO.PAGE_SIZE);
}
/**
* returns all keyword autocompletes for keyWord
*
* @param keyWordPrefix
* @return
* @throws IOException
*/
/**
* returns all keyword autocompletes for keyWord
*
* @param keyWordPrefix
* @return
* @throws IOException
*/
@GetMapping("/search/keywordsAutoComplete")
public List<AutoCompleteEntry> getKeywordsAutoComplete(@RequestParam String keyWordPrefix) throws IOException {
return searchService.getKeywordsAutoComplete(keyWordPrefix);
}
public List<AutoCompleteEntry> getKeywordsAutoComplete(@RequestParam String keyWordPrefix) throws IOException {
return searchService.getKeywordsAutoComplete(keyWordPrefix);
}
/**
* returns all creator autocompletes
*
* @param creatorPrefix
* @return
* @throws IOException
*/
/**
* returns all creator autocompletes
*
* @param creatorPrefix
* @return
* @throws IOException
*/
@GetMapping("/search/creatorAutoComplete")
public List<AutoCompleteEntry> getCreatorAutoComplete(@RequestParam String creatorPrefix) throws IOException {
return searchService.getCreatorAutoComplete(creatorPrefix);
}
public List<AutoCompleteEntry> getCreatorAutoComplete(@RequestParam String creatorPrefix) throws IOException {
return searchService.getCreatorAutoComplete(creatorPrefix);
}
/**
* returns all contributor autocompletes
*
* @param contributorPrefix
* @return
* @throws IOException
*/
/**
* returns all contributor autocompletes
*
* @param contributorPrefix
* @return
* @throws IOException
*/
@GetMapping("/search/contributorAutoComplete")
public List<AutoCompleteEntry> getContributorAutoComplete(@RequestParam String contributorPrefix) throws IOException {
return searchService.getContributorAutoComplete(contributorPrefix);
}
public List<AutoCompleteEntry> getContributorAutoComplete(@RequestParam String contributorPrefix) throws IOException {
return searchService.getContributorAutoComplete(contributorPrefix);
}
/**
* returns all programmingLanguage autocompletes for keyWord
*
* @param programmingLanguagePrefix
* @return
* @throws IOException
*/
/**
* returns all programmingLanguage autocompletes for keyWord
*
* @param programmingLanguagePrefix
* @return
* @throws IOException
*/
@GetMapping("/search/programmingLanguageAutoComplete")
public List<AutoCompleteEntry> getProgrammingLanguageAutoComplete(@RequestParam String programmingLanguagePrefix) throws IOException {
return searchService.getProgrammingLanguageAutoComplete(programmingLanguagePrefix);
}
public List<AutoCompleteEntry> getProgrammingLanguageAutoComplete(@RequestParam String programmingLanguagePrefix) throws IOException {
return searchService.getProgrammingLanguageAutoComplete(programmingLanguagePrefix);
}
}
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