Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 1 addition & 46 deletions src/main/java/no/ndla/taxonomy/rest/v1/Queries.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,15 @@
import no.ndla.taxonomy.config.Constants;
import no.ndla.taxonomy.rest.v1.dtos.searchapi.TaxonomyContextDTO;
import no.ndla.taxonomy.service.NodeService;
import no.ndla.taxonomy.service.dtos.NodeDTO;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping(path = {"/v1/queries"})
public class Queries {
private final Topics topicController;
private final Resources resourceController;
private final NodeService nodeService;

public Queries(Topics topicController, Resources resourceController, NodeService nodeService) {
this.topicController = topicController;
this.resourceController = resourceController;
public Queries(NodeService nodeService) {
this.nodeService = nodeService;
}

Expand Down Expand Up @@ -69,44 +64,4 @@ public List<TaxonomyContextDTO> queryPath(
String language) {
return nodeService.getContextByPath(path, language);
}

@GetMapping("/resources")
@Operation(
summary =
"Gets a list of resources matching given contentURI, empty list of no matches are found. DEPRECATED: Use /v1/resources?contentURI= instead")
@Transactional(readOnly = true)
@Deprecated
public List<NodeDTO> queryResources(
@RequestParam("contentURI") Optional<URI> contentURI,
@Parameter(description = "ISO-639-1 language code", example = "nb")
@RequestParam(value = "language", defaultValue = Constants.DefaultLanguage, required = false)
String language,
@Parameter(description = "Filter by key and value") @RequestParam(value = "key", required = false)
Optional<String> key,
@Parameter(description = "Fitler by key and value") @RequestParam(value = "value", required = false)
Optional<String> value,
@Parameter(description = "Filter by visible") @RequestParam(value = "isVisible", required = false)
Optional<Boolean> isVisible) {
return resourceController.getAllResources(language, contentURI, key, value, isVisible);
}

@GetMapping("/topics")
@Operation(
summary =
"Gets a list of topics matching given contentURI, empty list of no matches are found. DEPRECATED: Use /v1/topics?contentURI= instead")
@Transactional(readOnly = true)
@Deprecated
public List<NodeDTO> queryTopics(
@RequestParam("contentURI") URI contentURI,
@Parameter(description = "ISO-639-1 language code", example = "nb")
@RequestParam(value = "language", defaultValue = Constants.DefaultLanguage, required = false)
String language,
@Parameter(description = "Filter by key and value") @RequestParam(value = "key", required = false)
Optional<String> key,
@Parameter(description = "Fitler by key and value") @RequestParam(value = "value", required = false)
Optional<String> value,
@Parameter(description = "Filter by visible") @RequestParam(value = "isVisible", required = false)
Optional<Boolean> isVisible) {
return topicController.getAllTopics(language, Optional.of(contentURI), key, value, isVisible);
}
}
85 changes: 0 additions & 85 deletions src/main/java/no/ndla/taxonomy/rest/v1/ResourceTranslations.java

This file was deleted.

245 changes: 0 additions & 245 deletions src/main/java/no/ndla/taxonomy/rest/v1/Resources.java

This file was deleted.

Loading