@Path("motorcycle")
public class MotorcycleRecource {
@GET
@Path("/search")
@Produces("application/json")
public Motorcycle getMotorcycleByYear(@QueryParam("year") Integer year) {
return motorcycleService.getMotorcycleByYear(year);
}
@GET
@Path("/search")
@Produces("application/json")
public Motorcycle getMotorcycleByEngineCapacity(@QueryParam("engineCapacity") Integer engineCapacity) {
return motorcycleService.getMotorcycleByEngineCapacity(engineCapacity);
}
}
我想在我的服务器上使用相同的路径创建2个映射,但是当我尝试编译器时会出现大量错误和异常 我想要两个映射都在摩托车/搜索映射,所以我可以做 摩托车/搜索?年= 摩托车/搜索?engineCapacity =