Open zjqwll opened 6 years ago
@Component public class ImProperties {
public static String WEBSOCKET_SERVER_URL; @PostConstruct private void init() { WEBSOCKET_SERVER_URL = websocketServerUrl; } @Value(value = "${netty.socketio.server.host}") private String websocketServerUrl;
}
我想问下用静态方法这样写和直接用get,set这么写有什么好处?
这样写 就是为了方便使用配置文件 配置该属性
@Component public class ImProperties {
}
我想问下用静态方法这样写和直接用get,set这么写有什么好处?