2 * Copyright (C) 2024 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
9 package eu
.etaxonomy
.cdm
.remote
.controller
;
11 import java
.io
.IOException
;
13 import org
.springframework
.beans
.factory
.annotation
.Autowired
;
14 import org
.springframework
.web
.bind
.annotation
.PathVariable
;
15 import org
.springframework
.web
.bind
.annotation
.RequestMapping
;
16 import org
.springframework
.web
.bind
.annotation
.RequestMethod
;
17 import org
.springframework
.web
.bind
.annotation
.RestController
;
19 import eu
.etaxonomy
.cdm
.api
.service
.INameMatchingService
;
20 import eu
.etaxonomy
.cdm
.api
.service
.NameMatchingServiceImpl
.NameMatchingResult
;
21 import io
.swagger
.annotations
.Api
;
30 @RequestMapping(value
= {"/namecache/{namecache}" })
32 public class NameMatchingController
{
35 private INameMatchingService nameMatchingservice
;
40 method
= RequestMethod
.GET
)
41 public NameMatchingResult
doGetNameMatching(
42 @PathVariable("namecache") String nameCache
) throws IOException
{
43 if (nameCache
!= null & !nameCache
.isEmpty()) {
44 nameCache
= nameCache
.substring(0,1).toUpperCase() + nameCache
.substring(1).toLowerCase();
46 NameMatchingResult result
= nameMatchingservice
.findMatchingNames(nameCache
, null, false);