疯狂的狮子li
2022-09-15 6281ec0456f2b02d924cdb360db47c5ef93db8f2
ruoyi-generator/src/main/java/com/ruoyi/generator/controller/GenController.java
@@ -12,7 +12,6 @@
import com.ruoyi.generator.domain.GenTable;
import com.ruoyi.generator.domain.GenTableColumn;
import com.ruoyi.generator.service.IGenTableService;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@@ -29,7 +28,6 @@
 * @author Lion Li
 */
@Validated
@Tag(name = "代码生成", description = "代码生成管理")
@RequiredArgsConstructor
@RestController
@RequestMapping("/tool/gen")
@@ -48,6 +46,8 @@
    /**
     * 修改代码生成业务
     *
     * @param tableId 表ID
     */
    @SaCheckPermission("tool:gen:query")
    @GetMapping(value = "/{tableId}")
@@ -73,6 +73,8 @@
    /**
     * 查询数据表字段列表
     *
     * @param tableId 表ID
     */
    @SaCheckPermission("tool:gen:list")
    @GetMapping(value = "/column/{tableId}")
@@ -86,6 +88,8 @@
    /**
     * 导入表结构(保存)
     *
     * @param tables 表名串
     */
    @SaCheckPermission("tool:gen:import")
    @Log(title = "代码生成", businessType = BusinessType.IMPORT)
@@ -112,6 +116,8 @@
    /**
     * 删除代码生成
     *
     * @param tableIds 表ID串
     */
    @SaCheckPermission("tool:gen:remove")
    @Log(title = "代码生成", businessType = BusinessType.DELETE)
@@ -123,6 +129,8 @@
    /**
     * 预览代码
     *
     * @param tableId 表ID
     */
    @SaCheckPermission("tool:gen:preview")
    @GetMapping("/preview/{tableId}")
@@ -133,6 +141,8 @@
    /**
     * 生成代码(下载方式)
     *
     * @param tableName 表名
     */
    @SaCheckPermission("tool:gen:code")
    @Log(title = "代码生成", businessType = BusinessType.GENCODE)
@@ -144,6 +154,8 @@
    /**
     * 生成代码(自定义路径)
     *
     * @param tableName 表名
     */
    @SaCheckPermission("tool:gen:code")
    @Log(title = "代码生成", businessType = BusinessType.GENCODE)
@@ -155,6 +167,8 @@
    /**
     * 同步数据库
     *
     * @param tableName 表名
     */
    @SaCheckPermission("tool:gen:edit")
    @Log(title = "代码生成", businessType = BusinessType.UPDATE)
@@ -166,6 +180,8 @@
    /**
     * 批量生成代码
     *
     * @param tables 表名串
     */
    @SaCheckPermission("tool:gen:code")
    @Log(title = "代码生成", businessType = BusinessType.GENCODE)
@@ -180,7 +196,6 @@
     * 生成zip文件
     */
    private void genCode(HttpServletResponse response, byte[] data) throws IOException {
        response.reset();
        response.addHeader("Access-Control-Allow-Origin", "*");
        response.addHeader("Access-Control-Expose-Headers", "Content-Disposition");
        response.setHeader("Content-Disposition", "attachment; filename=\"ruoyi.zip\"");