热点资源
This commit is contained in:
@@ -17,6 +17,6 @@ import java.io.OutputStream;
|
||||
*/
|
||||
public interface SourceService extends IService<Source> {
|
||||
|
||||
void downloadSource(ServletOutputStream outputStream, String sid) throws IOException;
|
||||
void downloadSource(ServletOutputStream outputStream, Source source) throws IOException;
|
||||
|
||||
}
|
||||
|
||||
@@ -30,8 +30,7 @@ public class SourceServiceImpl extends ServiceImpl<SourceMapper, Source> impleme
|
||||
OSSClientUtil ossClientUtil;
|
||||
|
||||
@Override
|
||||
public void downloadSource(ServletOutputStream outputStream, String sid) throws IOException {
|
||||
Source source = getOne(new QueryWrapper<Source>().eq("id", sid));
|
||||
public void downloadSource(ServletOutputStream outputStream, Source source) throws IOException {
|
||||
String sourceLink = source.getSourceLink();
|
||||
// 读取文件内容。
|
||||
BufferedInputStream in = new BufferedInputStream(ossClientUtil.downloadFile(sourceLink));
|
||||
|
||||
Reference in New Issue
Block a user