mirror of
				https://github.com/continew-org/continew-admin.git
				synced 2025-10-31 10:57:13 +08:00 
			
		
		
		
	chore: continew-starter 2.4.0 => 2.5.0
1.continew-starter-log-httptrace-pro => continew-starter-log-interceptor 2.移除 WebMvcConfiguration 配置(已迁移到 Starter 项目) 3.Starter 全局响应(新)适配,自定义异常拦截调整到 Admin 项目 4.部分 API 调整
This commit is contained in:
		| @@ -16,7 +16,6 @@ | ||||
|  | ||||
| package top.continew.admin.generator.service; | ||||
|  | ||||
| import jakarta.servlet.http.HttpServletRequest; | ||||
| import jakarta.servlet.http.HttpServletResponse; | ||||
| import top.continew.admin.generator.model.entity.FieldConfigDO; | ||||
| import top.continew.admin.generator.model.entity.GenConfigDO; | ||||
| @@ -86,8 +85,7 @@ public interface GeneratorService { | ||||
|      * 生成代码 | ||||
|      * | ||||
|      * @param tableNames 表明层 | ||||
|      * @param request    请求对象 | ||||
|      * @param response   响应对象 | ||||
|      */ | ||||
|     void generate(List<String> tableNames, HttpServletRequest request, HttpServletResponse response); | ||||
|     void generate(List<String> tableNames, HttpServletResponse response); | ||||
| } | ||||
|   | ||||
| @@ -27,7 +27,6 @@ import cn.hutool.core.util.ZipUtil; | ||||
| import cn.hutool.db.meta.Column; | ||||
| import cn.hutool.system.SystemUtil; | ||||
| import com.baomidou.mybatisplus.core.toolkit.Wrappers; | ||||
| import jakarta.servlet.http.HttpServletRequest; | ||||
| import jakarta.servlet.http.HttpServletResponse; | ||||
| import lombok.RequiredArgsConstructor; | ||||
| import lombok.extern.slf4j.Slf4j; | ||||
| @@ -281,7 +280,7 @@ public class GeneratorServiceImpl implements GeneratorService { | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public void generate(List<String> tableNames, HttpServletRequest request, HttpServletResponse response) { | ||||
|     public void generate(List<String> tableNames, HttpServletResponse response) { | ||||
|         try { | ||||
|             String tempDir = SystemUtil.getUserInfo().getTempDir(); | ||||
|             // 删除旧代码 | ||||
| @@ -296,7 +295,7 @@ public class GeneratorServiceImpl implements GeneratorService { | ||||
|             File tempDirFile = new File(tempDir, projectProperties.getAppName()); | ||||
|             String zipFilePath = tempDirFile.getPath() + jodd.io.ZipUtil.ZIP_EXT; | ||||
|             ZipUtil.zip(tempDirFile.getPath(), zipFilePath); | ||||
|             FileUploadUtils.download(request, response, new File(zipFilePath), true); | ||||
|             FileUploadUtils.download(response, new File(zipFilePath)); | ||||
|         } catch (Exception e) { | ||||
|             log.error("Generate code of table '{}' occurred an error. {}", tableNames, e.getMessage(), e); | ||||
|             throw new BusinessException("代码生成失败,请手动清理生成文件"); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user