package com.pwt.netty;


import com.pwt.netty.client.CodeScannerClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

@Configuration
@PropertySource(value = { "classpath:application-netty.yml" })
//@ConfigurationProperties(prefix = "station")
public class CodeScannerConfig {

    @Value("${scanner_ip}")
    private String host;

    @Value("${scanner_port}")
    private int port;

    @Bean
    public CodeScannerClient codeScannerClient() {
        return new CodeScannerClient(host, port);
//        return new CodeScannerClient("192.168.3.32", 1000);
    }
}
