Revision 57130
Added by Michele Artini over 4 years ago
VocabulariesController.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.organizations.controller; |
2 | 2 |
|
3 |
import java.util.Arrays; |
|
3 | 4 |
import java.util.HashMap; |
4 | 5 |
import java.util.List; |
5 | 6 |
import java.util.Map; |
7 |
import java.util.stream.Collectors; |
|
6 | 8 |
|
7 | 9 |
import org.springframework.beans.factory.annotation.Autowired; |
8 | 10 |
import org.springframework.web.bind.annotation.RequestMapping; |
... | ... | |
11 | 13 |
|
12 | 14 |
import eu.dnetlib.organizations.utils.DatabaseUtils; |
13 | 15 |
import eu.dnetlib.organizations.utils.DatabaseUtils.VocabularyTable; |
16 |
import eu.dnetlib.organizations.utils.RelationType; |
|
17 |
import eu.dnetlib.organizations.utils.SimilarityType; |
|
14 | 18 |
|
15 | 19 |
@RestController |
16 | 20 |
@RequestMapping("/api/vocabularies") |
... | ... | |
24 | 28 |
final Map<String, List<String>> vocs = new HashMap<>(); |
25 | 29 |
vocs.put("orgTypes", databaseUtils.listValuesOfVocabularyTable(VocabularyTable.org_types)); |
26 | 30 |
vocs.put("idTypes", databaseUtils.listValuesOfVocabularyTable(VocabularyTable.id_types)); |
27 |
vocs.put("relTypes", databaseUtils.listValuesOfVocabularyTable(VocabularyTable.rel_types)); |
|
28 |
vocs.put("similaritiesType", databaseUtils.listValuesOfVocabularyTable(VocabularyTable.simrel_types)); |
|
29 | 31 |
vocs.put("languages", databaseUtils.listValuesOfVocabularyTable(VocabularyTable.languages)); |
30 | 32 |
vocs.put("countries", databaseUtils.listValuesOfVocabularyTable(VocabularyTable.countries)); |
33 |
vocs.put("relTypes", Arrays.stream(RelationType.values()).map(Object::toString).collect(Collectors.toList())); |
|
34 |
vocs.put("similaritiesType", Arrays.stream(SimilarityType.values()).map(Object::toString).collect(Collectors.toList())); |
|
31 | 35 |
return vocs; |
32 | 36 |
} |
33 | 37 |
|
Also available in: Unified diff