@Value("classpath:factors.json")
Resource fators;
@PostConstruct
public void init(){
String json = new String(IOUtils.readFully(fators.getInputStream(), -1,true));
List<Factor> factorList = JsonUtils.json2List(json, Factor.class);
}
Spring通过注解读取json文件
最新推荐文章于 2024-07-16 01:58:05 发布