Ver código fonte

代码生成支持自定义路径

RuoYi 5 anos atrás
pai
commit
56ea7c9caf

+ 142 - 0
ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/file/FileUtils.java

@@ -0,0 +1,142 @@
1
+package com.ruoyi.common.core.utils.file;
2
+
3
+import java.io.File;
4
+import java.io.FileInputStream;
5
+import java.io.FileNotFoundException;
6
+import java.io.IOException;
7
+import java.io.OutputStream;
8
+import java.io.UnsupportedEncodingException;
9
+import java.net.URLEncoder;
10
+import javax.servlet.http.HttpServletRequest;
11
+
12
+/**
13
+ * 文件处理工具类
14
+ * 
15
+ * @author ruoyi
16
+ */
17
+public class FileUtils extends org.apache.commons.io.FileUtils
18
+{
19
+    public static String FILENAME_PATTERN = "[a-zA-Z0-9_\\-\\|\\.\\u4e00-\\u9fa5]+";
20
+
21
+    /**
22
+     * 输出指定文件的byte数组
23
+     * 
24
+     * @param filePath 文件路径
25
+     * @param os 输出流
26
+     * @return
27
+     */
28
+    public static void writeBytes(String filePath, OutputStream os) throws IOException
29
+    {
30
+        FileInputStream fis = null;
31
+        try
32
+        {
33
+            File file = new File(filePath);
34
+            if (!file.exists())
35
+            {
36
+                throw new FileNotFoundException(filePath);
37
+            }
38
+            fis = new FileInputStream(file);
39
+            byte[] b = new byte[1024];
40
+            int length;
41
+            while ((length = fis.read(b)) > 0)
42
+            {
43
+                os.write(b, 0, length);
44
+            }
45
+        }
46
+        catch (IOException e)
47
+        {
48
+            throw e;
49
+        }
50
+        finally
51
+        {
52
+            if (os != null)
53
+            {
54
+                try
55
+                {
56
+                    os.close();
57
+                }
58
+                catch (IOException e1)
59
+                {
60
+                    e1.printStackTrace();
61
+                }
62
+            }
63
+            if (fis != null)
64
+            {
65
+                try
66
+                {
67
+                    fis.close();
68
+                }
69
+                catch (IOException e1)
70
+                {
71
+                    e1.printStackTrace();
72
+                }
73
+            }
74
+        }
75
+    }
76
+
77
+    /**
78
+     * 删除文件
79
+     * 
80
+     * @param filePath 文件
81
+     * @return
82
+     */
83
+    public static boolean deleteFile(String filePath)
84
+    {
85
+        boolean flag = false;
86
+        File file = new File(filePath);
87
+        // 路径为文件且不为空则进行删除
88
+        if (file.isFile() && file.exists())
89
+        {
90
+            file.delete();
91
+            flag = true;
92
+        }
93
+        return flag;
94
+    }
95
+
96
+    /**
97
+     * 文件名称验证
98
+     * 
99
+     * @param filename 文件名称
100
+     * @return true 正常 false 非法
101
+     */
102
+    public static boolean isValidFilename(String filename)
103
+    {
104
+        return filename.matches(FILENAME_PATTERN);
105
+    }
106
+
107
+    /**
108
+     * 下载文件名重新编码
109
+     * 
110
+     * @param request 请求对象
111
+     * @param fileName 文件名
112
+     * @return 编码后的文件名
113
+     */
114
+    public static String setFileDownloadHeader(HttpServletRequest request, String fileName)
115
+            throws UnsupportedEncodingException
116
+    {
117
+        final String agent = request.getHeader("USER-AGENT");
118
+        String filename = fileName;
119
+        if (agent.contains("MSIE"))
120
+        {
121
+            // IE浏览器
122
+            filename = URLEncoder.encode(filename, "utf-8");
123
+            filename = filename.replace("+", " ");
124
+        }
125
+        else if (agent.contains("Firefox"))
126
+        {
127
+            // 火狐浏览器
128
+            filename = new String(fileName.getBytes(), "ISO8859-1");
129
+        }
130
+        else if (agent.contains("Chrome"))
131
+        {
132
+            // google浏览器
133
+            filename = URLEncoder.encode(filename, "utf-8");
134
+        }
135
+        else
136
+        {
137
+            // 其它浏览器
138
+            filename = URLEncoder.encode(filename, "utf-8");
139
+        }
140
+        return filename;
141
+    }
142
+}

+ 18 - 6
ruoyi-modules/ruoyi-gen/src/main/java/com/ruoyi/gen/controller/GenController.java

@@ -148,18 +148,30 @@ public class GenController extends BaseController
148 148
     }
149 149
 
150 150
     /**
151
-     * 生成代码
151
+     * 生成代码(下载方式)
152 152
      */
153 153
     @PreAuthorize("@ss.hasPermi('tool:gen:code')")
154 154
     @Log(title = "代码生成", businessType = BusinessType.GENCODE)
155
-    @GetMapping("/genCode/{tableName}")
156
-    public void genCode(HttpServletResponse response, @PathVariable("tableName") String tableName) throws IOException
155
+    @GetMapping("/download/{tableName}")
156
+    public void download(HttpServletResponse response, @PathVariable("tableName") String tableName) throws IOException
157 157
     {
158
-        byte[] data = genTableService.generatorCode(tableName);
158
+        byte[] data = genTableService.downloadCode(tableName);
159 159
         genCode(response, data);
160 160
     }
161 161
 
162 162
     /**
163
+     * 生成代码(自定义路径)
164
+     */
165
+    @PreAuthorize("@ss.hasPermi('tool:gen:code')")
166
+    @Log(title = "代码生成", businessType = BusinessType.GENCODE)
167
+    @GetMapping("/genCode/{tableName}")
168
+    public AjaxResult genCode(HttpServletResponse response, @PathVariable("tableName") String tableName)
169
+    {
170
+        genTableService.generatorCode(tableName);
171
+        return AjaxResult.success();
172
+    }
173
+
174
+    /**
163 175
      * 批量生成代码
164 176
      */
165 177
     @PreAuthorize("@ss.hasPermi('tool:gen:code')")
@@ -168,7 +180,7 @@ public class GenController extends BaseController
168 180
     public void batchGenCode(HttpServletResponse response, String tables) throws IOException
169 181
     {
170 182
         String[] tableNames = Convert.toStrArray(tables);
171
-        byte[] data = genTableService.generatorCode(tableNames);
183
+        byte[] data = genTableService.downloadCode(tableNames);
172 184
         genCode(response, data);
173 185
     }
174 186
 
@@ -183,4 +195,4 @@ public class GenController extends BaseController
183 195
         response.setContentType("application/octet-stream; charset=UTF-8");
184 196
         IOUtils.write(data, response.getOutputStream());
185 197
     }
186
-}
198
+}

+ 26 - 0
ruoyi-modules/ruoyi-gen/src/main/java/com/ruoyi/gen/domain/GenTable.java

@@ -55,6 +55,12 @@ public class GenTable extends BaseEntity
55 55
     @NotBlank(message = "作者不能为空")
56 56
     private String functionAuthor;
57 57
 
58
+    /** 生成代码方式(0zip压缩包 1自定义路径) */
59
+    private String genType;
60
+
61
+    /** 生成路径(不填默认项目路径) */
62
+    private String genPath;
63
+
58 64
     /** 主键信息 */
59 65
     private GenTableColumn pkColumn;
60 66
 
@@ -180,6 +186,26 @@ public class GenTable extends BaseEntity
180 186
         this.functionAuthor = functionAuthor;
181 187
     }
182 188
 
189
+    public String getGenType()
190
+    {
191
+        return genType;
192
+    }
193
+
194
+    public void setGenType(String genType)
195
+    {
196
+        this.genType = genType;
197
+    }
198
+
199
+    public String getGenPath()
200
+    {
201
+        return genPath;
202
+    }
203
+
204
+    public void setGenPath(String genPath)
205
+    {
206
+        this.genPath = genPath;
207
+    }
208
+
183 209
     public GenTableColumn getPkColumn()
184 210
     {
185 211
         return pkColumn;

+ 67 - 5
ruoyi-modules/ruoyi-gen/src/main/java/com/ruoyi/gen/service/GenTableServiceImpl.java

@@ -1,6 +1,7 @@
1 1
 package com.ruoyi.gen.service;
2 2
 
3 3
 import java.io.ByteArrayOutputStream;
4
+import java.io.File;
4 5
 import java.io.IOException;
5 6
 import java.io.StringWriter;
6 7
 import java.util.LinkedHashMap;
@@ -22,7 +23,9 @@ import com.alibaba.fastjson.JSONObject;
22 23
 import com.ruoyi.common.core.constant.Constants;
23 24
 import com.ruoyi.common.core.constant.GenConstants;
24 25
 import com.ruoyi.common.core.exception.CustomException;
26
+import com.ruoyi.common.core.text.CharsetKit;
25 27
 import com.ruoyi.common.core.utils.StringUtils;
28
+import com.ruoyi.common.core.utils.file.FileUtils;
26 29
 import com.ruoyi.common.security.utils.SecurityUtils;
27 30
 import com.ruoyi.gen.domain.GenTable;
28 31
 import com.ruoyi.gen.domain.GenTableColumn;
@@ -201,13 +204,13 @@ public class GenTableServiceImpl implements IGenTableService
201 204
     }
202 205
 
203 206
     /**
204
-     * 生成代码
207
+     * 生成代码(下载方式)
205 208
      * 
206 209
      * @param tableName 表名称
207 210
      * @return 数据
208 211
      */
209 212
     @Override
210
-    public byte[] generatorCode(String tableName)
213
+    public byte[] downloadCode(String tableName)
211 214
     {
212 215
         ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
213 216
         ZipOutputStream zip = new ZipOutputStream(outputStream);
@@ -217,13 +220,55 @@ public class GenTableServiceImpl implements IGenTableService
217 220
     }
218 221
 
219 222
     /**
220
-     * 批量生成代码
223
+     * 生成代码(自定义路径)
224
+     * 
225
+     * @param tableName 表名称
226
+     * @return 数据
227
+     */
228
+    @Override
229
+    public void generatorCode(String tableName)
230
+    {
231
+        // 查询表信息
232
+        GenTable table = genTableMapper.selectGenTableByName(tableName);
233
+        // 查询列信息
234
+        List<GenTableColumn> columns = table.getColumns();
235
+        setPkColumn(table, columns);
236
+
237
+        VelocityInitializer.initVelocity();
238
+
239
+        VelocityContext context = VelocityUtils.prepareContext(table);
240
+
241
+        // 获取模板列表
242
+        List<String> templates = VelocityUtils.getTemplateList(table.getTplCategory());
243
+        for (String template : templates)
244
+        {
245
+            if (!StringUtils.containsAny(template, "sql.vm", "api.js.vm", "index.vue.vm", "index-tree.vue.vm"))
246
+            {
247
+                // 渲染模板
248
+                StringWriter sw = new StringWriter();
249
+                Template tpl = Velocity.getTemplate(template, Constants.UTF8);
250
+                tpl.merge(context, sw);
251
+                try
252
+                {
253
+                    String path = getGenPath(table, template);
254
+                    FileUtils.writeStringToFile(new File(path), sw.toString(), CharsetKit.UTF_8);
255
+                }
256
+                catch (IOException e)
257
+                {
258
+                    throw new CustomException("渲染模板失败,表名:" + table.getTableName());
259
+                }
260
+            }
261
+        }
262
+    }
263
+
264
+    /**
265
+     * 批量生成代码(下载方式)
221 266
      * 
222 267
      * @param tableNames 表数组
223 268
      * @return 数据
224 269
      */
225 270
     @Override
226
-    public byte[] generatorCode(String[] tableNames)
271
+    public byte[] downloadCode(String[] tableNames)
227 272
     {
228 273
         ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
229 274
         ZipOutputStream zip = new ZipOutputStream(outputStream);
@@ -346,4 +391,21 @@ public class GenTableServiceImpl implements IGenTableService
346 391
             genTable.setParentMenuName(parentMenuName);
347 392
         }
348 393
     }
349
-}
394
+
395
+    /**
396
+     * 获取代码生成地址
397
+     * 
398
+     * @param table 业务表信息
399
+     * @param template 模板文件路径
400
+     * @return 生成地址
401
+     */
402
+    public static String getGenPath(GenTable table, String template)
403
+    {
404
+        String genPath = table.getGenPath();
405
+        if (StringUtils.equals(genPath, "/"))
406
+        {
407
+            return System.getProperty("user.dir") + File.separator + "src" + File.separator + VelocityUtils.getFileName(template, table);
408
+        }
409
+        return genPath + File.separator + VelocityUtils.getFileName(template, table);
410
+    }
411
+}

+ 12 - 4
ruoyi-modules/ruoyi-gen/src/main/java/com/ruoyi/gen/service/IGenTableService.java

@@ -75,20 +75,28 @@ public interface IGenTableService
75 75
     public Map<String, String> previewCode(Long tableId);
76 76
 
77 77
     /**
78
-     * 生成代码
78
+     * 生成代码(下载方式)
79 79
      * 
80 80
      * @param tableName 表名称
81 81
      * @return 数据
82 82
      */
83
-    public byte[] generatorCode(String tableName);
83
+    public byte[] downloadCode(String tableName);
84 84
 
85 85
     /**
86
-     * 批量生成代码
86
+     * 生成代码(自定义路径)
87
+     * 
88
+     * @param tableName 表名称
89
+     * @return 数据
90
+     */
91
+    public void generatorCode(String tableName);
92
+
93
+    /**
94
+     * 批量生成代码(下载方式)
87 95
      * 
88 96
      * @param tableNames 表数组
89 97
      * @return 数据
90 98
      */
91
-    public byte[] generatorCode(String[] tableNames);
99
+    public byte[] downloadCode(String[] tableNames);
92 100
 
93 101
     /**
94 102
      * 修改保存参数校验

+ 11 - 3
ruoyi-modules/ruoyi-gen/src/main/resources/mapper/generator/GenTableMapper.xml

@@ -15,6 +15,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
15 15
 		<result property="businessName"   column="business_name"   />
16 16
 		<result property="functionName"   column="function_name"   />
17 17
 		<result property="functionAuthor" column="function_author" />
18
+		<result property="genType"        column="gen_type"        />
19
+		<result property="genPath"        column="gen_path"        />
18 20
 		<result property="options"        column="options"         />
19 21
 		<result property="createBy"       column="create_by"       />
20 22
 		<result property="createTime"     column="create_time"     />
@@ -50,7 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
50 52
     </resultMap>
51 53
 	
52 54
 	<sql id="selectGenTableVo">
53
-        select table_id, table_name, table_comment, class_name, tpl_category, package_name, module_name, business_name, function_name, function_author, options, create_by, create_time, update_by, update_time, remark from gen_table
55
+        select table_id, table_name, table_comment, class_name, tpl_category, package_name, module_name, business_name, function_name, function_author, gen_type, gen_path, options, create_by, create_time, update_by, update_time, remark from gen_table
54 56
     </sql>
55 57
     
56 58
     <select id="selectGenTableList" parameterType="GenTable" resultMap="GenTableResult">
@@ -100,7 +102,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
100 102
 	</select>
101 103
 	
102 104
 	<select id="selectGenTableById" parameterType="Long" resultMap="GenTableResult">
103
-	    SELECT t.table_id, t.table_name, t.table_comment, t.class_name, t.tpl_category, t.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.options, t.remark,
105
+	    SELECT t.table_id, t.table_name, t.table_comment, t.class_name, t.tpl_category, t.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.gen_type, t.gen_path, t.options, t.remark,
104 106
 			   c.column_id, c.column_name, c.column_comment, c.column_type, c.java_type, c.java_field, c.is_pk, c.is_increment, c.is_required, c.is_insert, c.is_edit, c.is_list, c.is_query, c.query_type, c.html_type, c.dict_type, c.sort
105 107
 		FROM gen_table t
106 108
 			 LEFT JOIN gen_table_column c ON t.table_id = c.table_id
@@ -108,7 +110,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
108 110
 	</select>
109 111
 	
110 112
 	<select id="selectGenTableByName" parameterType="String" resultMap="GenTableResult">
111
-	    SELECT t.table_id, t.table_name, t.table_comment, t.class_name, t.tpl_category, t.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.options, t.remark,
113
+	    SELECT t.table_id, t.table_name, t.table_comment, t.class_name, t.tpl_category, t.package_name, t.module_name, t.business_name, t.function_name, t.function_author, t.gen_type, t.gen_path, t.options, t.remark,
112 114
 			   c.column_id, c.column_name, c.column_comment, c.column_type, c.java_type, c.java_field, c.is_pk, c.is_increment, c.is_required, c.is_insert, c.is_edit, c.is_list, c.is_query, c.query_type, c.html_type, c.dict_type, c.sort
113 115
 		FROM gen_table t
114 116
 			 LEFT JOIN gen_table_column c ON t.table_id = c.table_id
@@ -126,6 +128,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
126 128
 			<if test="businessName != null and businessName != ''">business_name,</if>
127 129
 			<if test="functionName != null and functionName != ''">function_name,</if>
128 130
 			<if test="functionAuthor != null and functionAuthor != ''">function_author,</if>
131
+			<if test="genType != null and genType != ''">gen_type,</if>
132
+			<if test="genPath != null and genPath != ''">gen_path,</if>
129 133
 			<if test="remark != null and remark != ''">remark,</if>
130 134
  			<if test="createBy != null and createBy != ''">create_by,</if>
131 135
 			create_time
@@ -139,6 +143,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
139 143
 			<if test="businessName != null and businessName != ''">#{businessName},</if>
140 144
 			<if test="functionName != null and functionName != ''">#{functionName},</if>
141 145
 			<if test="functionAuthor != null and functionAuthor != ''">#{functionAuthor},</if>
146
+			<if test="genType != null and genType != ''">#{genType},</if>
147
+			<if test="genPath != null and genPath != ''">#{genPath},</if>
142 148
 			<if test="remark != null and remark != ''">#{remark},</if>
143 149
  			<if test="createBy != null and createBy != ''">#{createBy},</if>
144 150
 			sysdate()
@@ -152,6 +158,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
152 158
             <if test="tableComment != null and tableComment != ''">table_comment = #{tableComment},</if>
153 159
             <if test="className != null and className != ''">class_name = #{className},</if>
154 160
             <if test="functionAuthor != null and functionAuthor != ''">function_author = #{functionAuthor},</if>
161
+            <if test="genType != null and genType != ''">gen_type = #{genType},</if>
162
+            <if test="genPath != null and genPath != ''">gen_path = #{genPath},</if>
155 163
             <if test="tplCategory != null and tplCategory != ''">tpl_category = #{tplCategory},</if>
156 164
             <if test="packageName != null and packageName != ''">package_name = #{packageName},</if>
157 165
             <if test="moduleName != null and moduleName != ''">module_name = #{moduleName},</if>

+ 9 - 0
ruoyi-ui/src/api/tool/gen.js

@@ -42,6 +42,7 @@ export function importTable(data) {
42 42
     params: data
43 43
   })
44 44
 }
45
+
45 46
 // 预览生成代码
46 47
 export function previewTable(tableId) {
47 48
   return request({
@@ -49,6 +50,7 @@ export function previewTable(tableId) {
49 50
     method: 'get'
50 51
   })
51 52
 }
53
+
52 54
 // 删除表数据
53 55
 export function delTable(tableId) {
54 56
   return request({
@@ -57,3 +59,10 @@ export function delTable(tableId) {
57 59
   })
58 60
 }
59 61
 
62
+// 生成代码(自定义路径)
63
+export function genCode(tableName) {
64
+  return request({
65
+    url: '/code/gen/genCode/' + tableName,
66
+    method: 'get'
67
+  })
68
+}

+ 45 - 3
ruoyi-ui/src/views/tool/gen/genInfoForm.vue

@@ -6,7 +6,7 @@
6 6
           <span slot="label">生成模板</span>
7 7
           <el-select v-model="info.tplCategory">
8 8
             <el-option label="单表(增删改查)" value="crud" />
9
-            <el-option label="树表(增删改查)" value="tree"/>
9
+            <el-option label="树表(增删改查)" value="tree" />
10 10
           </el-select>
11 11
         </el-form-item>
12 12
       </el-col>
@@ -60,14 +60,56 @@
60 60
       </el-col>
61 61
 
62 62
       <el-col :span="12">
63
-        <el-form-item prop="functionName">
63
+        <el-form-item>
64 64
           <span slot="label">
65 65
             上级菜单
66 66
             <el-tooltip content="分配到指定菜单下,例如 系统管理" placement="top">
67 67
               <i class="el-icon-question"></i>
68 68
             </el-tooltip>
69 69
           </span>
70
-          <treeselect :append-to-body="true" v-model="info.parentMenuId" :options="menus" :normalizer="normalizer" :show-count="true" placeholder="请选择系统菜单"/>
70
+          <treeselect
71
+            :append-to-body="true"
72
+            v-model="info.parentMenuId"
73
+            :options="menus"
74
+            :normalizer="normalizer"
75
+            :show-count="true"
76
+            placeholder="请选择系统菜单"
77
+          />
78
+        </el-form-item>
79
+      </el-col>
80
+
81
+      <el-col :span="12">
82
+        <el-form-item prop="genType">
83
+          <span slot="label">
84
+            生成代码方式
85
+            <el-tooltip content="默认为zip压缩包下载,也可以自定义生成路径" placement="top">
86
+              <i class="el-icon-question"></i>
87
+            </el-tooltip>
88
+          </span>
89
+          <el-radio v-model="info.genType" label="0">zip压缩包</el-radio>
90
+          <el-radio v-model="info.genType" label="1">自定义路径</el-radio>
91
+        </el-form-item>
92
+      </el-col>
93
+
94
+      <el-col :span="24" v-if="info.genType == '1'">
95
+        <el-form-item prop="genPath">
96
+          <span slot="label">
97
+            自定义路径
98
+            <el-tooltip content="填写磁盘绝对路径,若不填写,则生成到当前Web项目下" placement="top">
99
+              <i class="el-icon-question"></i>
100
+            </el-tooltip>
101
+          </span>
102
+          <el-input v-model="info.genPath">
103
+            <el-dropdown slot="append">
104
+              <el-button type="primary">
105
+                最近路径快速选择
106
+                <i class="el-icon-arrow-down el-icon--right"></i>
107
+              </el-button>
108
+              <el-dropdown-menu slot="dropdown">
109
+                <el-dropdown-item @click.native="info.genPath = '/'">恢复默认的生成基础路径</el-dropdown-item>
110
+              </el-dropdown-menu>
111
+            </el-dropdown>
112
+          </el-input>
71 113
         </el-form-item>
72 114
       </el-col>
73 115
     </el-row>

+ 8 - 2
ruoyi-ui/src/views/tool/gen/index.vue

@@ -166,7 +166,7 @@
166 166
 </template>
167 167
 
168 168
 <script>
169
-import { listTable, previewTable, delTable } from "@/api/tool/gen";
169
+import { listTable, previewTable, delTable, genCode } from "@/api/tool/gen";
170 170
 import importTable from "./importTable";
171 171
 import { downLoadZip } from "@/utils/zipdownload";
172 172
 export default {
@@ -241,7 +241,13 @@ export default {
241 241
         this.msgError("请选择要生成的数据");
242 242
         return;
243 243
       }
244
-      downLoadZip("/code/gen/batchGenCode?tables=" + tableNames, "ruoyi");
244
+      if(row.genType === "1") {
245
+        genCode(row.tableName).then(response => {
246
+          this.msgSuccess("成功生成到自定义路径:" + row.genPath);
247
+        });
248
+      } else {
249
+        downLoadZip("/tool/gen/batchGenCode?tables=" + tableNames, "ruoyi");
250
+      }
245 251
     },
246 252
     /** 打开导入表弹窗 */
247 253
     openImportTable() {

+ 2 - 0
sql/ry_20200711.sql

@@ -637,6 +637,8 @@ create table gen_table (
637 637
   business_name     varchar(30)                                comment '生成业务名',
638 638
   function_name     varchar(50)                                comment '生成功能名',
639 639
   function_author   varchar(50)                                comment '生成功能作者',
640
+  gen_type          char(1)         default '0'                comment '生成代码方式(0zip压缩包 1自定义路径)',
641
+  gen_path          varchar(200)    default '/'                comment '生成路径(不填默认项目路径)',
640 642
   options           varchar(1000)                              comment '其它生成选项',
641 643
   create_by         varchar(64)     default ''                 comment '创建者',
642 644
   create_time 	    datetime                                   comment '创建时间',