Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Genesys Backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
45
Issues
45
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Genesys PGR
Genesys Backend
Commits
35320b92
Commit
35320b92
authored
Oct 10, 2018
by
Viacheslav Pavlov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
addded endpoint for autocomplete ISO3 code
parent
2fa52e73
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
6 deletions
+16
-6
src/main/java/org/genesys/catalog/api/v0/GeoController.java
src/main/java/org/genesys/catalog/api/v0/GeoController.java
+16
-6
No files found.
src/main/java/org/genesys/catalog/api/v0/GeoController.java
View file @
35320b92
...
...
@@ -16,6 +16,7 @@
package
org.genesys.catalog.api.v0
;
import
java.io.IOException
;
import
java.util.List
;
import
java.util.UUID
;
import
org.genesys.catalog.exceptions.NotFoundElement
;
...
...
@@ -28,12 +29,7 @@ import org.slf4j.LoggerFactory;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -108,4 +104,18 @@ public class GeoController {
throw
new
NotFoundElement
(
"Code is not in valid format: 3-letter | 2-letter | numeric"
);
}
/**
* Autocomplete.
*
* @param text the text
* @return the list
* @throws IOException Signals that an I/O exception has occurred.
*/
@GetMapping
(
value
=
"/iso3166/autocomplete"
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
List
<
VocabularyTerm
>
autocompleteGeoTerm
(
@RequestParam
(
"c"
)
final
String
text
)
throws
IOException
{
return
vocabularyService
.
autocompleteTerms
(
ISO3166_3ALPHA
,
text
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment