将Iterable转成List

先导入
import com.google.common.collect.Lists;
然后使用
 @RequestMapping("/findAll")
    public Iterable<Person> findAll(){
        List<Person> people = Lists.newArrayList(demoService.findAll());
        return demoService.findAll();
    }

猜你喜欢

转载自blog.csdn.net/qq_39940205/article/details/80165908