本文整理汇总了Java中io.swagger.annotations.Extension类的典型用法代码示例。如果您正苦于以下问题:Java Extension类的具体用法?Java Extension怎么用?Java Extension使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Extension类属于io.swagger.annotations包,在下文中一共展示了Extension类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: list
import io.swagger.annotations.Extension; //导入依赖的package包/类
@GET
@Produces({"application/hal+json", "application/hal+json;concept=customers;v=1"})
@ApiOperation(value = "lists customers", response = CustomersRepresentation.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 = "advisor", value = "advisors are allowed getting every customer"),
@ExtensionProperty(name = "customer", value = "customer only allowed getting own information")}
)},
produces = "application/hal+json, application/hal+json;concept=customers;v=1",
notes = "List all customers in a default projection, which is Customers version 1" +
"Supported projections and versions are: " +
"Customers in version 1 " +
"The Accept header for the default version is application/hal+json;concept=customers;v=1.0.0.... " +
"The format for the default version is {....}", nickname = "listCustomers")
@ApiResponses(value = {
@ApiResponse(code = 415, message = "Content type not supported.")
})
public Response list(@Context UriInfo uriInfo, @Context Request request, @HeaderParam("Accept") String accept) {
return customersProducers.getOrDefault(accept, this::handleUnsupportedContentType).getResponse(uriInfo, request);
}
示例2: list
import io.swagger.annotations.Extension; //导入依赖的package包/类
@GET
@Produces({"application/hal+json", "application/hal+json;concept=accountoverview;v=1"})
@ApiOperation(value = "lists accounts", response = AccountsRepresentation.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 = "advisor", value = "advisors are allowed getting every account"),
@ExtensionProperty(name = "customer", value = "customer only allowed getting own accounts")}
)},
produces = "application/hal+json, application/hal+json;concept=accountoverview;v=1",
notes = "List all accounts in a default projection, which is AccountOverview version 1" +
"Supported projections and versions are: " +
"AccountOverview in version 1 " +
"The Accept header for the default version is application/hal+json;concept=AccountOverview;v=1.0.0.... " +
"The format for the default version is {....}", nickname = "listAccounts")
@ApiResponses(value = {
@ApiResponse(code = 415, message = "Content type not supported.")
})
public Response list(@Context UriInfo uriInfo, @Context Request request, @QueryParam("customer") @DefaultValue("0") String customer, @HeaderParam("Accept") String accept) {
return accountsProducers.getOrDefault(accept, this::handleUnsupportedContentType).getResponse(uriInfo, request, customer);
}
示例3: list
import io.swagger.annotations.Extension; //导入依赖的package包/类
@GET
@Produces({"application/hal+json", "application/hal+json;concept=location;v=1"})
@ApiOperation(value = "lists locations", response = LocationsRepresentation.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 = "advisor", value = "advisors are allowed getting every location"),
@ExtensionProperty(name = "customer", value = "customer only allowed getting own locations")}
)},
produces = "application/hal+json, application/hal+json;concept=locations;v=1",
notes = "List all locations in a default projection, which is Location version 1" +
"Supported projections and versions are: " +
"Locations in version 1 " +
"The Accept header for the default version is application/hal+json;concept=location;v=1.0.0.... " +
"The format for the default version is {....}", nickname = "listLocations")
@ApiResponses(value = {
@ApiResponse(code = 415, message = "Content type not supported.")
})
public Response list(@Context UriInfo uriInfo, @Context Request request, @HeaderParam("Accept") String accept) {
return locationsProducers.getOrDefault(accept, this::handleUnsupportedContentType).getResponse(uriInfo, request);
}
示例4: list
import io.swagger.annotations.Extension; //导入依赖的package包/类
@GET
@Produces({"application/hal+json", "application/hal+json;concept=virtualaccount;v=1"})
@ApiOperation(value = "lists accounts", response = VirtualAccountsRepresentation.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 = "advisor", value = "advisors are allowed getting every virtualaccount"),
@ExtensionProperty(name = "customer", value = "customer only allowed getting own locations")}
)},
produces = "application/hal+json, application/hal+json;concept=locations;v=1",
notes = "List all locations in a default projection, which is VirtualAccount version 1" +
"Supported projections and versions are: " +
"VirtualAccounts in version 1 " +
"The Accept header for the default version is application/hal+json;concept=virtualaccount;v=1.0.0.... " +
"The format for the default version is {....}", nickname = "listVirtualAccounts")
@ApiResponses(value = {
@ApiResponse(code = 415, message = "Content type not supported.")
})
public Response list(@Context UriInfo uriInfo, @Context Request request, @HeaderParam("Accept") String accept) {
return accountsProducer.getOrDefault(accept, this::handleUnsupportedContentType).getResponse(uriInfo, request);
}
示例5: getSensorStats
import io.swagger.annotations.Extension; //导入依赖的package包/类
/**
* Retrieve Sensor data for the given time period.
*
* @param deviceId unique identifier for given device type instance
* @param from starting time
* @param to ending time
* @return response with List<SensorRecord> object which includes sensor data which is requested
*/
@Path("device/stats/{deviceId}")
@GET
@Consumes("application/json")
@Produces("application/json")
@ApiOperation(
consumes = MediaType.APPLICATION_JSON,
httpMethod = "GET",
value = "Sensor Stats",
notes = "",
response = Response.class,
tags = "sampledevice",
extensions = {
@Extension(properties = {
@ExtensionProperty(name = SCOPE, value = "perm:sampledevice:enroll")
})
}
)
Response getSensorStats(@PathParam("deviceId") String deviceId, @QueryParam("from") long from,
@QueryParam("to") long to, @QueryParam("sensorType") String sensorType);
示例6: getDeviceStats
import io.swagger.annotations.Extension; //导入依赖的package包/类
/**
* Retrieve Sensor data for the device type
*/
@Path("stats/{deviceId}/sensors/{sensorName}")
@GET
@Consumes("application/json")
@Produces("application/json")
@ApiOperation(
consumes = MediaType.APPLICATION_JSON,
httpMethod = "GET",
value = "Retrieve Sensor data for the device type",
notes = "",
response = Response.class,
tags = "connectedcup",
extensions = {
@Extension(properties = {
@ExtensionProperty(name = SCOPE, value = "perm:connectedcup:enroll")
})
}
)
Response getDeviceStats(@PathParam("deviceId") String deviceId, @PathParam("sensorName") String sensor,
@QueryParam("from") long from, @QueryParam("to") long to);
示例7: testBase
import io.swagger.annotations.Extension; //导入依赖的package包/类
@ApiOperation(
value = "summary",
notes = "notes",
tags = {"tag1", "tag2"},
httpMethod = "GET",
nickname = "test",
produces = "application/json",
consumes = "application/json",
protocols = "http,https",
code = 202,
responseHeaders = {@ResponseHeader(name = "h1", response = int.class)},
extensions = {@Extension(
name = "x-tagA",
properties = {@ExtensionProperty(name = "x-tagAExt", value = "value of tagAExt")})})
void testBase();
示例8: getGreeting
import io.swagger.annotations.Extension; //导入依赖的package包/类
@GET
@Path("/test/")
@ApiOperation(value = "Test",
extensions = {
@Extension(properties = {
@ExtensionProperty(name = "externalPath", value = "/hello-world/v1/")
})})
public Response getGreeting() {
return Response.ok("Test").build();
}
示例9: get
import io.swagger.annotations.Extension; //导入依赖的package包/类
@GET
@Path("{virtualAccountNumber}")
@Produces({"application/hal+json", "application/hal+json;concept=virtualaccount;v=1", "application/hal+json;concept=virtualaccount;v=2"})
@ApiOperation(value = "gets the information from a single position", response = VirtualAccountRepresentation.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=virtualaccount;v=1, application/hal+json;concept=virtualaccount;v=2",
notes = "obtain a single customer back in a default projection, which is VirtualAccount version 2" +
" Supported projections and versions are:" +
" VirtualAccount in version1 and VirtualAccount 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 = "getVirtualAccount")
@ApiResponses(value = {
@ApiResponse(code = 404, message = "virtualaccount not found.")
})
public Response get(@Context UriInfo uriInfo, @Context Request request,
@PathParam("virtualAccountNumber") @Pattern(regexp = "^[0-9]*$") String virtualAccountNumber,
@HeaderParam("Accept") String accept) {
LOGGER.info("Default version of virtualaccount collected");
return accountProducers.getOrDefault(accept, this::handleUnsupportedContentType)
.getResponse(uriInfo, request, virtualAccountNumber);
}
示例10: get
import io.swagger.annotations.Extension; //导入依赖的package包/类
@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);
}
示例11: transactions
import io.swagger.annotations.Extension; //导入依赖的package包/类
@GET
@Produces({ "application/hal+json", "application/hal+json;concept=reconciledtransactions;v=1"})
@ApiOperation(value = "obtain reconciled transactions (added API capabilities not though not implemented)",
response = ReconciledTransactionsRepresentation.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 from own account"),
@ExtensionProperty(name = "advisor", value = "advisor allows getting from every account")}
)},
tags = {"select", "sort", "elements", "interval", "filter", "embed", "decorator", "reconciled"},
notes = "obtain a list of all reconciled transactions from an account" +
"the reconciled transactions are user controlled checks and notes for transactions " +
"such as - Yes I have verified that this transaction was correct and thus it is reconciled",
produces = "application/hal+json, application/hal+json;concept=reconciledtransactions;v=1",
nickname = "listReconciledTransactions")
@ApiResponses(value = {
@ApiResponse(code = 415, message = "Content type not supported.")
})
public Response list(@Context UriInfo uriInfo, @Context Request request,
@HeaderParam("Accept") String accept, @PathParam("regNo") String regNo, @PathParam("accountNo") String accountNo
) {
return reconciledTxsProducers.getOrDefault(accept, this::handleUnsupportedContentType)
.getResponse(uriInfo, request, regNo, accountNo);
}
示例12: get
import io.swagger.annotations.Extension; //导入依赖的package包/类
@GET
@Path("{id}")
@Produces({ "application/hal+json", "application/hal+json;concept=reconciledtransaction;v=1" })
@LogDuration(limit = 50)
@ApiOperation(value = "obtain a single reconciled transaction from a given account", response = ReconciledTransactionRepresentation.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 account")}
)},
produces = "application/hal+json, application/hal+json;concept=reconciledtransaction;v=1",
nickname = "getReconciledTransaction")
@ApiResponses(value = {
@ApiResponse(code = 404, message = "No reconciled transaction found."),
@ApiResponse(code = 415, message = "Content type not supported.")
})
public Response get(@Context UriInfo uriInfo, @Context Request request,
@HeaderParam("Accept") String accept, @PathParam("regNo") String regNo,
@PathParam("accountNo") String accountNo, @PathParam("id") String id) {
return reconciledTxProducers.getOrDefault(accept, this::handleUnsupportedContentType)
.getResponse(uriInfo, request, regNo, accountNo, id);
}
示例13: list
import io.swagger.annotations.Extension; //导入依赖的package包/类
@GET
@Produces({ "application/hal+json", "application/hal+json;concept=transactionoverview;v=1" })
@ApiOperation(
value = "obtain all transactions on account for a given account", response = TransactionsRepresentation.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 from own account"),
@ExtensionProperty(name = "advisor", value = "advisor allows getting from every account")}
)},
tags = {"sort", "elements", "interval", "transactions"},
produces = "application/hal+json, application/hal+json;concept=transactionoverview;v=1",
nickname = "listTransactions"
)
public Response list(@Context UriInfo uriInfo, @Context Request request,
@HeaderParam("Accept") String accept, @PathParam("regNo") String regNo,
@PathParam("accountNo") String accountNo,
@QueryParam("sort") String sort, @QueryParam("elements") String elements,
@QueryParam("interval") String interval) {
return transactionsProducers.getOrDefault(accept, this::handleUnsupportedContentType)
.getResponse(uriInfo, request, regNo, accountNo, sort, elements, interval);
}
示例14: get
import io.swagger.annotations.Extension; //导入依赖的package包/类
@GET
@Path("{id}")
@Produces({ "application/hal+json", "application/hal+json;concept=transaction;v=1"})
@LogDuration(limit = 50)
@ApiOperation(
value = "obtain the individual single transaction from an account", response = TransactionRepresentation.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 from own account"),
@ExtensionProperty(name = "advisor", value = "advisor allows getting from every account")}
)},
produces = "application/hal+json, application/hal+json;concept=transaction;v=1",
nickname = "getTransaction")
@ApiResponses(value = {
@ApiResponse(code = 404, message = "No transaction found."),
@ApiResponse(code = 415, message = "Content type not supported.")
})
/**
* the use of authorization scopes to signal roles is a bit dubious and thus this may change in the future
*/
public Response get(@Context UriInfo uriInfo, @Context Request request,
@HeaderParam("Accept") String accept,
@PathParam("regNo") String regNo,
@PathParam("accountNo") String accountNo,
@PathParam("id") String id) {
return transactionProducers.getOrDefault(accept, this::handleUnsupportedContentType)
.getResponse(uriInfo, request, regNo, accountNo, id);
}
示例15: get
import io.swagger.annotations.Extension; //导入依赖的package包/类
@GET
@Path("{regNo}-{accountNo}")
@Produces({"application/hal+json", "application/hal+json;concept=account;v=1", "application/hal+json;concept=account;v=2"})
@ApiOperation(value = "gets the information from a single account", response = AccountRepresentation.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 account"),
@ExtensionProperty(name = "advisor", value = "advisor allows getting every account")}
)},
produces = "application/hal+json, application/hal+json;concept=account;v=1, application/hal+json;concept=account;v=2",
notes = "obtain a single account back in a default projection, which is Account version 2" +
" Supported projections and versions are:" +
" AccountSparse in version1 and Account 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 = "getAccount")
@ApiResponses(value = {
@ApiResponse(code = 404, message = "No account found.")
})
public Response get(@Context UriInfo uriInfo, @Context Request request,
@PathParam("regNo") @Pattern(regexp = "^[0-9]{4}$") String regNo,
@PathParam("accountNo") @Pattern(regexp = "^[0-9]+$") String accountNo,
@HeaderParam("Accept") String accept) {
LOGGER.info("Default version of account collected");
return accountProducers.getOrDefault(accept, this::handleUnsupportedContentType).getResponse(uriInfo, request, regNo, accountNo);
}