mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-11-02 13:31:49 +08:00
Pre Merge pull request !889 from xy/fix/download-code-zip-close
This commit is contained in:
commit
05ea5735ed
@ -341,8 +341,11 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||
public byte[] downloadCode(Long tableId) {
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
ZipOutputStream zip = new ZipOutputStream(outputStream);
|
||||
try {
|
||||
writeCodeToZip(tableId, zip);
|
||||
} finally {
|
||||
IoUtil.close(zip);
|
||||
}
|
||||
return outputStream.toByteArray();
|
||||
}
|
||||
|
||||
@ -408,10 +411,13 @@ public class GenTableServiceImpl implements IGenTableService {
|
||||
public byte[] downloadCode(String[] tableIds) {
|
||||
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
|
||||
ZipOutputStream zip = new ZipOutputStream(outputStream);
|
||||
try {
|
||||
for (String tableId : tableIds) {
|
||||
writeCodeToZip(Long.parseLong(tableId), zip);
|
||||
}
|
||||
} finally {
|
||||
IoUtil.close(zip);
|
||||
}
|
||||
return outputStream.toByteArray();
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user