mirror of
https://gitee.com/likeadmin/likeadmin_java.git
synced 2026-06-20 09:12:55 +08:00
fix 代码生成器不兼容的bug
This commit is contained in:
@@ -95,7 +95,7 @@ public class GenController {
|
||||
@GetMapping("/detail")
|
||||
public AjaxResult<Map<String, Object>> detail(@Validated @IDMust() @RequestParam("id") Integer id) {
|
||||
Map<String, Object> maps = iGenerateService.detail(id);
|
||||
return AjaxResult.success(maps);
|
||||
return AjaxResult.success(200, "成功", maps);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -109,7 +109,7 @@ public class GenController {
|
||||
Assert.notNull(tables, "请选择要导入的表");
|
||||
String[] tableNames = tables.split(",");
|
||||
iGenerateService.importTable(tableNames);
|
||||
return AjaxResult.success();
|
||||
return AjaxResult.success("成功", 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -122,7 +122,7 @@ public class GenController {
|
||||
@PostMapping("/editTable")
|
||||
public AjaxResult<Object> editTable(@Validated() @RequestBody GenParam genParam) {
|
||||
iGenerateService.editTable(genParam);
|
||||
return AjaxResult.success();
|
||||
return AjaxResult.success("成功", 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -135,7 +135,7 @@ public class GenController {
|
||||
@PostMapping("/delTable")
|
||||
public AjaxResult<Object> deleteTable(@Validated(value = GenParam.delete.class) @RequestBody GenParam genParam) {
|
||||
iGenerateService.deleteTable(genParam.getIds());
|
||||
return AjaxResult.success();
|
||||
return AjaxResult.success("成功", 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -148,7 +148,7 @@ public class GenController {
|
||||
@PostMapping("/syncTable")
|
||||
public AjaxResult<Object> syncTable(@Validated @IDMust() @RequestParam("id") Integer id) {
|
||||
iGenerateService.syncTable(id);
|
||||
return AjaxResult.success();
|
||||
return AjaxResult.success("成功", 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.mdd.generator.validate;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.mdd.common.validator.annotation.IDMust;
|
||||
import com.mdd.common.validator.annotation.IntegerContains;
|
||||
import com.mdd.common.validator.annotation.StringContains;
|
||||
@@ -34,21 +35,25 @@ public class GenParam implements Serializable {
|
||||
@NotNull(message = "tableName参数缺失")
|
||||
@NotEmpty(message = "表名称不能为空")
|
||||
@Length(min = 1, max = 200, message = "名称不能大于200个字符")
|
||||
@JsonProperty("tableName")
|
||||
private String tableName;
|
||||
|
||||
@NotNull(message = "entityName参数缺失")
|
||||
@NotEmpty(message = "实体类名称不能为空")
|
||||
@Length(min = 1, max = 200, message = "实体类名称不能大于200个字符")
|
||||
@JsonProperty("entityName")
|
||||
private String entityName;
|
||||
|
||||
@NotNull(message = "tableComment参数缺失")
|
||||
@NotEmpty(message = "表描述不能为空")
|
||||
@Length(min = 1, max = 200, message = "表描述不能大于200个字符")
|
||||
@JsonProperty("tableComment")
|
||||
private String tableComment;
|
||||
|
||||
@NotNull(message = "authorName参数缺失")
|
||||
@NotEmpty(message = "作者名称不能为空")
|
||||
@Length(min = 1, max = 100, message = "作者名称不能大于60个字符")
|
||||
@JsonProperty("authorName")
|
||||
private String authorName;
|
||||
|
||||
@Length(max = 60, message = "备注不能大于200个字符")
|
||||
@@ -57,37 +62,53 @@ public class GenParam implements Serializable {
|
||||
@NotNull(message = "genTpl参数缺失")
|
||||
@NotEmpty(message = "请选择生成模板")
|
||||
@StringContains(values = {"crud", "tree"}, message = "选择的生成模板不符合")
|
||||
@JsonProperty("genTpl")
|
||||
private String genTpl;
|
||||
|
||||
@NotNull(message = "moduleName参数缺失")
|
||||
@NotEmpty(message = "生成模块名不能为空")
|
||||
@Length(min = 1, max = 60, message = "生成模块名不能大于60个字符")
|
||||
@JsonProperty("moduleName")
|
||||
private String moduleName;
|
||||
|
||||
@NotNull(message = "functionName参数缺失")
|
||||
@NotEmpty(message = "生成功能名不能为空")
|
||||
@Length(min = 1, max = 60, message = "生成功能名不能大于60个字符")
|
||||
@JsonProperty("functionName")
|
||||
private String functionName;
|
||||
|
||||
@NotNull(message = "genType参数缺失")
|
||||
@IntegerContains(values = {0, 1}, message = "选择的生成代码方式不符合")
|
||||
@JsonProperty("genType")
|
||||
private Integer genType;
|
||||
|
||||
@Length(max = 200, message = "生成代码路径不能大于200个字符")
|
||||
@JsonProperty("genPath")
|
||||
private String genPath = "/";
|
||||
|
||||
private List<Map<String, String>> column = new ArrayList<>();
|
||||
|
||||
@JsonProperty("treePrimary")
|
||||
private String treePrimary = "";
|
||||
@JsonProperty("treeParent")
|
||||
private String treeParent = "";
|
||||
@JsonProperty("treeName")
|
||||
private String treeName = "";
|
||||
|
||||
@JsonProperty("subTableName")
|
||||
private String subTableName = "";
|
||||
@JsonProperty("subTableFk")
|
||||
private String subTableFk = "";
|
||||
|
||||
@JsonProperty("subTableFr")
|
||||
private String subTableFr = "";
|
||||
|
||||
@JsonProperty("menuStatus")
|
||||
private Integer menuStatus = 2;
|
||||
@JsonProperty("menuPid")
|
||||
private Integer menuPid = 0;
|
||||
|
||||
@JsonProperty("menuName")
|
||||
private String menuName = "";
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user