001package io.avaje.http.api;
002
003import java.lang.annotation.Retention;
004import java.lang.annotation.Target;
005
006import static java.lang.annotation.ElementType.METHOD;
007import static java.lang.annotation.RetentionPolicy.RUNTIME;
008
009/**
010 * Marks a method that handles HTTP GET requests.
011 *
012 * <pre>{@code
013 *
014 *   @Get(":id")
015 *   Customer get(long id) {
016 *
017 *     ...
018 *   }
019 *
020 * }</pre>
021 *
022 * <h4>Example</h4>
023 * <p>
024 * Path parameters are matched by name - "status" in the example below.
025 * </p>
026 * <p>
027 * Method parameters that do not match a path parameter default to being
028 * a query parameter - "since" is a query parameter in the example below.
029 * </p>
030 *
031 * <pre>{@code
032 *
033 *   @Get("/status/:status")
034 *   List<Customer> getByStatus(String status, LocalDate since) {
035 *
036 *     ...
037 *   }
038 *
039 * }</pre>
040 *
041 * <h4>Example - Multiple path parameters</h4>
042 * <pre>{@code
043 *
044 *   @Get("/status/:status/:parentId")
045 *   List<Customer> getByStatus(String status, long parentId, LocalDate since) {
046 *
047 *     ...
048 *   }
049 *
050 * }</pre>
051 */
052@Target(value=METHOD)
053@Retention(value=RUNTIME)
054@HttpMethod(value="GET")
055public @interface Get {
056  String value() default "";
057}