2022-12-05 11:04:54 +01:00
|
|
|
package eu.dnetlib.is.vocabulary;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
|
|
|
|
import eu.dnetlib.common.controller.AbstractDnetController;
|
2023-02-06 15:31:21 +01:00
|
|
|
import eu.dnetlib.is.model.vocabulary.Vocabulary;
|
|
|
|
import eu.dnetlib.is.model.vocabulary.VocabularyTerm;
|
2022-12-05 11:04:54 +01:00
|
|
|
|
|
|
|
public class AbstractVocabularyController extends AbstractDnetController {
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
protected VocabularyService vocabularyService;
|
|
|
|
|
|
|
|
@GetMapping("/")
|
|
|
|
public List<Vocabulary> listVocs() {
|
|
|
|
return vocabularyService.listVocs();
|
|
|
|
}
|
|
|
|
|
|
|
|
@GetMapping("/{vocabulary}/terms")
|
|
|
|
public Iterable<VocabularyTerm> listTerms(@PathVariable final String vocabulary) {
|
|
|
|
return vocabularyService.listTerms(vocabulary);
|
|
|
|
}
|
|
|
|
}
|