在Jhipster中实现下载按钮

时间:2018-09-25 04:34:10

标签: angular jhipster

我正在尝试在jhipster整体应用程序中实现一个简单的下载按钮,以帮助我下载特定实体的所有条目。

有人可以帮助我,告诉我该怎么做吗?

1 个答案:

答案 0 :(得分:1)

添加此软件包:

public class VideoCache {
    private static SimpleCache sDownloadCache;

    public static SimpleCache getInstance() {
        if (sDownloadCache == null) sDownloadCache = new SimpleCache(new File(getCacheDir(), "exoCache"), new NoOpCacheEvictor());
        return sDownloadCache;
    }
}

然后创建此服务:

DataSource.Factory dataSourceFactory = new CacheDataSourceFactory(VideoCache.getInstance(), new DefaultDataSourceFactory(this, "seyed"));

用法:

yarn add file-saver
yarn add xlsx