package com.bizzan.bitrade.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.bizzan.bitrade.system.IpSearch;


@Configuration
public class IpSearchConfig {
    @Value("${ipsearch.path:}")
    private String path;

    @Bean
    public IpSearch getIpSearch() {
        if (path == null || path.trim().isEmpty()) {
            return null;
        }
        try {
            return IpSearch.getInstance(path);
        } catch (Exception e) {
            return null;
        }
    }
}
