@GET
@Path("{customerNo}")
@Produces({"application/hal+json", "application/hal+json;concept=customer;v=1", "application/hal+json;concept=customer;v=2"})
@ApiOperation(value = "gets the information from a single customer", response = CustomerRepresentation.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=customer;v=1, application/hal+json;concept=customer;v=2",
notes = "obtain a single customer back in a default projection, which is Customer version 2" +
" Supported projections and versions are:" +
" Customer in version1 and Customer 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 = "getCustomer")
@ApiResponses(value = {
@ApiResponse(code = 404, message = "No customer found.")
})
public Response get(@Context UriInfo uriInfo, @Context Request request,
@PathParam("customerNo") @Pattern(regexp = "^[0-9]{10}$") String customerNo,
@HeaderParam("Accept") String accept) {
LOGGER.info("Default version of customer collected");
return customerProducers.getOrDefault(accept, this::handleUnsupportedContentType).getResponse(uriInfo, request, customerNo);
}
CustomerServiceExposure.java 文件源码
java
阅读 34
收藏 0
点赞 0
评论 0
项目:mid-tier
作者:
评论列表
文章目录