package com.qiuguo.iot.gateway.config.properties;

import java.util.List;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;

/**
 * 跨域配置.
 *
 * @author yangning
 * @since 2022/11/7 14:45
 */
@Getter
@Setter
// @ConfigurationProperties(prefix = "application.cors")
public class CorsProperties {
    
    /**
     * 允许跨域访问的域名.
     */
    private List<String> allowedOriginPatterns;
    
    /**
     * 允许跨域访问的方法.
     */
    private List<String> allowedMethods;
    
    /**
     * 允许跨域访问的请求头.
     */
    private List<String> allowedHeaders;
    
    /**
     * 暴露的响应头.
     */
    private List<String> exposedHeaders;
    
    /**
     * 是否允许跨域发送cookie.
     */
    private Boolean allowCredentials = true;
    
    /**
     * 跨域访问有效期.
     */
    private Long maxAge = 1800L;
}
