我相信在泽西岛是不可能的(至少我找不到相关的例子或文档)。
但请记住,您可以将常见的逻辑提取到一个方法中,并且有两个方法针对同一个方法和不同的方法
@Consumes
指令。
@POST
@Consumes({MediaType.APPLICATION_JSON})
@Path("/")
void createJson(@Suspended final AsyncResponse asyncResponse,
@ApiParam(required = true) @NotNull @Valid final CreateServiceRequest service) {
create(service)
}
@POST
@Consumes({MediaType.APPLICATION_FORM_URLENCODED})
@Path("/")
void createJson(@Suspended final AsyncResponse asyncResponse,
@ApiParam(required = true) @NotNull @Valid final CreateServiceRequest service) {
create(service)
}