28 lines
819 B
Java
28 lines
819 B
Java
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;
|
|
import eu.dnetlib.is.model.vocabulary.Vocabulary;
|
|
import eu.dnetlib.is.model.vocabulary.VocabularyTerm;
|
|
|
|
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);
|
|
}
|
|
}
|