Merge branch 'leng_dev' into greenwich
# Conflicts: # pigx-auth/pom.xml # pigx-common/pigx-common-core/pom.xml # pigx-common/pigx-common-data/pom.xml # pigx-common/pigx-common-gateway/pom.xml # pigx-common/pigx-common-job/pom.xml # pigx-common/pigx-common-log/pom.xml # pigx-common/pigx-common-minio/pom.xml # pigx-common/pigx-common-security/pom.xml # pigx-common/pigx-common-swagger/pom.xml # pigx-common/pigx-common-transaction/pom.xml # pigx-common/pom.xml # pigx-config/pom.xml # pigx-config/src/main/resources/config/pigx-upms-biz-dev.yml # pigx-eureka/pom.xml # pigx-gateway/pom.xml # pigx-upms/pigx-upms-api/pom.xml # pigx-upms/pigx-upms-biz/pom.xml # pigx-upms/pom.xml # pigx-visual/pigx-activiti/pom.xml # pigx-visual/pigx-codegen/pom.xml # pigx-visual/pigx-daemon/pom.xml # pigx-visual/pigx-monitor/pom.xml # pigx-visual/pigx-sso-client-demo/pom.xml # pigx-visual/pigx-tx-manager/pom.xml # pigx-visual/pom.xml # pom.xml
This commit is contained in:
commit
2b2507a068
85 files changed
+1423
-629
No files matched your search
+4
-2
@@ -23,6 +23,7 @@ import com.pig4cloud.pigx.codegen.entity.GenConfig;
|
||||
import com.pig4cloud.pigx.codegen.service.SysGeneratorService;
|
||||
import com.pig4cloud.pigx.common.core.util.R;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.SneakyThrows;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@@ -55,13 +56,14 @@ public class SysGeneratorController {
|
||||
/**
|
||||
* 生成代码
|
||||
*/
|
||||
@SneakyThrows
|
||||
@PostMapping("/code")
|
||||
public void generatorCode(@RequestBody GenConfig genConfig, HttpServletResponse response) throws IOException {
|
||||
public void generatorCode(@RequestBody GenConfig genConfig, HttpServletResponse response) {
|
||||
byte[] data = sysGeneratorService.generatorCode(genConfig);
|
||||
|
||||
response.reset();
|
||||
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, String.format("attachment; filename=%s.zip", genConfig.getTableName()));
|
||||
response.addHeader(HttpHeaders.CONTENT_LENGTH, String.valueOf(data.length));
|
||||
response.addHeader(HttpHeaders.CONTENT_LENGTH, String.valueOf(data.length));
|
||||
response.setContentType("application/octet-stream; charset=UTF-8");
|
||||
|
||||
IoUtil.write(response.getOutputStream(), Boolean.TRUE, data);
|
||||
|
||||
Reference in new issue
Block a user