ref #9222 ref #6581 adapting web services to single sourced classes
[cdmlib.git] / cdmlib-remote / src / main / java / eu / etaxonomy / cdm / remote / controller / MetadataController.java
1 // $Id$
2 /**
3 * Copyright (C) 2020 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
6 *
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
9 */
10 package eu.etaxonomy.cdm.remote.controller;
11
12 import java.util.Map;
13
14 import org.springframework.beans.factory.annotation.Autowired;
15 import org.springframework.web.bind.annotation.RequestMapping;
16 import org.springframework.web.bind.annotation.RequestMethod;
17 import org.springframework.web.bind.annotation.RestController;
18
19 import eu.etaxonomy.cdm.api.service.IMetadataService;
20 import eu.etaxonomy.cdm.config.CdmSourceException;
21 import eu.etaxonomy.cdm.model.metadata.CdmMetaDataPropertyName;
22 import io.swagger.annotations.Api;
23
24 /**
25 * @author a.kohlbecker
26 * @date May 19, 2020
27 *
28 */
29 @RestController
30 @Api("metadata")
31 @RequestMapping(value = {"/metadata"})
32 public class MetadataController {
33
34 @Autowired
35 private IMetadataService service;
36
37
38 @RequestMapping(method = RequestMethod.GET)
39 public Map<CdmMetaDataPropertyName, String> getMetadata() throws CdmSourceException {
40 return service.getCdmMetadataMap();
41 }
42
43 }