/*
 * Copyright (C) 2026  Tim Zimmermann <tim@aglais.org>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package org.aglais.zms.server.routing;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Annotation marking a method as http route handler
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public @interface HttpRoute {
    /**
     * The path handled by this method
     *
     * @return Handled path
     */
    String path();

    /**
     * The {@link HttpMethod} handled by this method, defaults to {@link HttpMethod#GET}
     *
     * @return Handled method
     */
    HttpMethod method() default HttpMethod.GET;

    /**
     * The content type written into the response by this handler method, defaults to "application/json; charset=UTF-8"
     *
     * @return Produced content type
     */
    String contentType() default "application/json; charset=UTF-8";
}
