@GET
@Path("{latitude}-{longitude}")
@Produces({"application/hal+json", "application/hal+json;concept=location;v=1", "application/hal+json;concept=location;v=2"})
@ApiOperation(value = "gets the information from a single position", response = LocationRepresentation.class,
authorizations = {
@Authorization(value = "oauth2", scopes = {}),
@Authorization(value = "oauth2-cc", scopes = {}),
@Authorization(value = "oauth2-ac", scopes = {}),
@Authorization(value = "oauth2-rop", scopes = {}),
@Authorization(value = "Bearer")
},
extensions = {@Extension(name = "roles", properties = {
@ExtensionProperty(name = "customer", value = "customer allows getting own information"),
@ExtensionProperty(name = "advisor", value = "advisor allows getting all information")}
)},
produces = "application/hal+json, application/hal+json;concept=location;v=1, application/hal+json;concept=location;v=2",
notes = "obtain a single customer back in a default projection, which is Location version 2" +
" Supported projections and versions are:" +
" Location in version1 and Location in version 2" +
" The format of the default version is .... - The Accept Header is not marked as required in the " +
"swagger - but it is needed - we are working on a solution to that", nickname = "getLocation")
@ApiResponses(value = {
@ApiResponse(code = 404, message = "location not found.")
})
public Response get(@Context UriInfo uriInfo, @Context Request request,
@PathParam("latitude") @Pattern(regexp = "^[0-9]+.[0-9]+,[0-9]*$") String latitude,
@PathParam("longitude") @Pattern(regexp = "^[0-9]+.[0-9]+,[0-9]*$") String longitude,
@HeaderParam("Accept") String accept) {
LOGGER.info("Default version of location collected");
return locationProducers.getOrDefault(accept, this::handleUnsupportedContentType)
.getResponse(uriInfo, request, latitude, longitude);
}
LocationServiceExposure.java 文件源码
java
阅读 32
收藏 0
点赞 0
评论 0
项目:mid-tier
作者:
评论列表
文章目录