1.类上添加@Component注解
2.设置一个@Autowired的方法,获取类中对象
@Component
public class PdfUtil {
private static MinioUtil minioUtil;
private static MinioBucketProperties minioBucketProperties;
@Autowired
public void setMinio(MinioUtil minioUtil,MinioBucketProperties minioBucketProperties) {
PdfUtil.minioUtil = minioUtil;
PdfUtil.minioBucketProperties = minioBucketProperties;
}
public static void test() {
minioUtil.xx();
}
}