All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.houkunlin.system.common.aop.AllowIPConfigurationProperties Maven / Gradle / Ivy

The newest version!
package com.houkunlin.system.common.aop;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.Map;
import java.util.Set;

/**
 * 允许指定IP访问接口 配置
 *
 * @author HouKunLin
 */
@Data
@Configuration
@ConfigurationProperties("system.common")
public class AllowIPConfigurationProperties {
    /**
     * 

允许访问IP列表。

*

*

KEY 为 配置键,与 {@link AllowIP#key() AllowIP#key()} AllowIP#key() 对应。

*

* Value 为 IP 列表,表示可访问的IP列表。格式如下: *

    *
  1. 127.0.0.1
  2. *
  3. 127.0.0.1/16
  4. *
  5. 192.168.0.1
  6. *
  7. 192.168.0.0/24
  8. *
  9. 192.168.0.100/32
  10. *
  11. 192.168.0.0-192.168.1.255
  12. *
  13. 192.168.0.0/24-192.168.5.0/24
  14. *
  15. 192.168.0.0/24-192.168.5.255
  16. * *

    *

    * 配置示例: *

    
         * system:
         *   common:
         *     allow-ip:
         *       office-net:
         *         - 127.0.0.1
         *         - 127.0.0.1/16
         *         - 192.168.0.1
         *         - 192.168.0.0/24
         *         - 192.168.0.100/32
         *         - 192.168.0.0-192.168.1.255
         *         - 192.168.0.0/24-192.168.5.0/24
         *         - 192.168.0.0/24-192.168.5.255
         * 
    *

    * * @see IpUtil#parseIpRange(String) */ private Map> allowIp; }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy