package com.njzscloud.common.core.http.annotation;


import com.njzscloud.common.core.http.interceptor.CompositeInterceptor;
import com.njzscloud.common.core.http.interceptor.RequestInterceptor;
import com.njzscloud.common.core.http.interceptor.ResponseInterceptor;

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

import static java.lang.annotation.ElementType.TYPE;

/**
 * HTTP 服务器配置
 */
@Target({TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface RemoteServer {
    /**
     * 服务器地址, 如, http://localhost:80/api
     *
     * @return String
     */
    String value();

    /**
     * 请求拦截器, 在请求之前触发
     *
     * @return RequestInterceptor.class
     * @see RequestInterceptor
     * @see CompositeInterceptor
     */
    Class<? extends RequestInterceptor> requestInterceptor() default CompositeInterceptor.class;

    /**
     * 响应拦截器, 在请求之后触发
     *
     * @return ResponseInterceptor.class
     * @see ResponseInterceptor
     * @see CompositeInterceptor
     */
    Class<? extends ResponseInterceptor> responseInterceptor() default CompositeInterceptor.class;
}
