package com.hnu.commom;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
/**
* @description
* @author: Whoami
* @create: 2021-06-10 13:26
**/
@Component
@ConfigurationProperties(prefix = "begin")
public class My {
public static Long time;
public Long getTime() {
return time;
}
public void setTime(Long time) {
My.time = time;
}
}
package com.hnu.commom;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.stereotype.Component;
/**
* @description
* @author: Whoami
* @create: 2021-06-10 13:35
**/
@Component
@AutoConfigureAfter(My.class)
public class Test {
static {
My my = new My();
System.out.println(my.getTime());
}
}