mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-09-09 20:57:21 +08:00
@@ -21,6 +21,8 @@ import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.enums.ParameterIn;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -32,7 +34,6 @@ import top.charles7c.continew.admin.generator.model.resp.GeneratePreviewResp;
|
||||
import top.charles7c.continew.admin.generator.model.resp.TableResp;
|
||||
import top.charles7c.continew.admin.generator.service.GeneratorService;
|
||||
import top.charles7c.continew.starter.core.autoconfigure.project.ProjectProperties;
|
||||
import top.charles7c.continew.starter.core.util.validate.ValidationUtils;
|
||||
import top.charles7c.continew.starter.extension.crud.model.query.PageQuery;
|
||||
import top.charles7c.continew.starter.extension.crud.model.resp.PageResp;
|
||||
import top.charles7c.continew.starter.web.model.R;
|
||||
@@ -102,9 +103,7 @@ public class GeneratorController {
|
||||
@Parameter(name = "tableName", description = "表名称", required = true, example = "sys_user", in = ParameterIn.PATH)
|
||||
@SaCheckPermission("tool:generator:list")
|
||||
@PostMapping("/{tableName}")
|
||||
public R<Void> generate(@PathVariable String tableName) {
|
||||
ValidationUtils.throwIf(projectProperties.isProduction(), "仅支持在开发环境生成代码");
|
||||
generatorService.generate(tableName);
|
||||
return R.ok("生成成功,请查看生成代码是否正确");
|
||||
public void generate(@PathVariable String tableName, HttpServletRequest request, HttpServletResponse response) {
|
||||
generatorService.generate(tableName, request, response);
|
||||
}
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@ generator:
|
||||
- gen_field_config
|
||||
## 类型映射
|
||||
typeMappings:
|
||||
MySQL:
|
||||
MYSQL:
|
||||
Integer:
|
||||
- int
|
||||
- tinyint
|
||||
|
@@ -277,7 +277,6 @@ CREATE TABLE IF NOT EXISTS `gen_config` (
|
||||
`table_name` varchar(64) NOT NULL COMMENT '表名称',
|
||||
`module_name` varchar(60) NOT NULL COMMENT '模块名称',
|
||||
`package_name` varchar(60) NOT NULL COMMENT '包名称',
|
||||
`frontend_path` varchar(255) DEFAULT NULL COMMENT '前端路径',
|
||||
`business_name` varchar(50) NOT NULL COMMENT '业务名称',
|
||||
`author` varchar(100) NOT NULL COMMENT '作者',
|
||||
`table_prefix` varchar(20) DEFAULT NULL COMMENT '表前缀',
|
||||
|
@@ -462,7 +462,6 @@ CREATE TABLE IF NOT EXISTS "gen_config" (
|
||||
"table_name" varchar(64) NOT NULL,
|
||||
"module_name" varchar(60) NOT NULL,
|
||||
"package_name" varchar(60) NOT NULL,
|
||||
"frontend_path" varchar(255) DEFAULT NULL,
|
||||
"business_name" varchar(50) NOT NULL,
|
||||
"author" varchar(100) NOT NULL,
|
||||
"table_prefix" varchar(20) DEFAULT NULL,
|
||||
@@ -474,7 +473,6 @@ CREATE TABLE IF NOT EXISTS "gen_config" (
|
||||
COMMENT ON COLUMN "gen_config"."table_name" IS '表名称';
|
||||
COMMENT ON COLUMN "gen_config"."module_name" IS '模块名称';
|
||||
COMMENT ON COLUMN "gen_config"."package_name" IS '包名称';
|
||||
COMMENT ON COLUMN "gen_config"."frontend_path" IS '前端路径';
|
||||
COMMENT ON COLUMN "gen_config"."business_name" IS '业务名称';
|
||||
COMMENT ON COLUMN "gen_config"."author" IS '作者';
|
||||
COMMENT ON COLUMN "gen_config"."table_prefix" IS '表前缀';
|
||||
|
Reference in New Issue
Block a user