import io.github.aparnachaudhary.donovan.core.annotation.*; import io.github.aparnachaudhary.donovan.core.http.Response; @Path("/api") public class MyAPI { @GET @Path("/hello") public Response sayHello() { String message = "Hello, World!"; return Response.ok().entity(message).build(); } @POST @Path("/doSomething") public Response doSomething(@QueryParam("param") String param) { return Response.ok().build(); } @ExceptionHandler(Exception.class) public Response handleException(Exception e) { return Response.serverError().entity(e.getMessage()).build(); } }


上一篇:
下一篇:
切换中文