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.data.is.vocabulary.model.Vocabulary;
import eu.dnetlib.data.is.vocabulary.model.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);
	}
}
