我在spring.io/uploadfile中研究了RESTful Web服务,但是导入StorageProperties时遇到问题:
我不知道这是什么以及如何使用它。 这是Java应用程序:
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import com.java.StorageProperties;
import com.java.StorageService;
@SpringBootApplication
@EnableConfigurationProperties(StorageProperties.class)
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
@Bean
CommandLineRunner init(StorageService storageService) {
return (args) -> {
storageService.deleteAll();
storageService.init();
};
}
}
导入com.java.StorageProperties
无法解析,
但是在这个项目中我没有看到像StorageProperties这样的类。