package com.zy.core; import com.alibaba.fastjson.JSON; import com.zy.core.properties.SlaveProperties; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; /** * Created by vincent on 2020/8/4 */ @Slf4j @Component public class ServerBootstrap { @Autowired private SlaveProperties slaveProperties; @PostConstruct public void init(){ System.out.println(JSON.toJSONString(slaveProperties)); } @PreDestroy public void destroy() { } }