|
@@ -1,6 +1,7 @@
|
|
package com.kmall.gen.controller;
|
|
package com.kmall.gen.controller;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
import com.kmall.gen.service.SysGeneratorService;
|
|
import com.kmall.gen.service.SysGeneratorService;
|
|
import com.kmall.common.utils.PageUtils;
|
|
import com.kmall.common.utils.PageUtils;
|
|
import com.kmall.common.utils.Query;
|
|
import com.kmall.common.utils.Query;
|
|
@@ -10,6 +11,7 @@ import org.apache.commons.io.IOUtils;
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
@@ -60,9 +62,8 @@ public class SysGeneratorController {
|
|
//获取表名,不进行xss过滤
|
|
//获取表名,不进行xss过滤
|
|
HttpServletRequest orgRequest = XssHttpServletRequestWrapper.getOrgRequest(request);
|
|
HttpServletRequest orgRequest = XssHttpServletRequestWrapper.getOrgRequest(request);
|
|
String tables = orgRequest.getParameter("tables");
|
|
String tables = orgRequest.getParameter("tables");
|
|
- tableNames = JSON.parseArray(tables).toArray(tableNames);
|
|
|
|
|
|
|
|
- byte[] data = sysGeneratorService.generatorCode(tableNames);
|
|
|
|
|
|
+ byte[] data = sysGeneratorService.generatorCode(tables.split(","));
|
|
|
|
|
|
response.reset();
|
|
response.reset();
|
|
response.setHeader("Content-Disposition", "attachment; filename=\"AutoCode.zip\"");
|
|
response.setHeader("Content-Disposition", "attachment; filename=\"AutoCode.zip\"");
|