() {
+ @Override
+ protected String call() throws Exception {
+ Thread.sleep(2000);
+ return "success";
+ }
+
+ @Override
+ protected void scheduled() {
+ // 任务开始, 填写刷新UI的操作
+ super.scheduled();
+ }
+
+ @Override
+ protected void running() {
+ // 任务执行
+ super.running();
+ }
+
+ // 任务成功之后,关闭提示
+ @Override
+ protected void succeeded() {
+ // 任务执行成功
+ stage.close();
+ super.succeeded();
+ }
+ };
+ }
+ };
+ service.start();
+
+ }
+
+}
diff --git a/src/main/java/ink/wgink/code/factory/utils/WStringUtil.java b/src/main/java/ink/wgink/code/factory/utils/WStringUtil.java
new file mode 100644
index 0000000..e6c335f
--- /dev/null
+++ b/src/main/java/ink/wgink/code/factory/utils/WStringUtil.java
@@ -0,0 +1,285 @@
+package ink.wgink.code.factory.utils;
+
+
+import net.sourceforge.pinyin4j.PinyinHelper;
+import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
+import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
+import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
+import net.sourceforge.pinyin4j.format.HanyuPinyinVCharType;
+import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * 字符串相关方法
+ */
+public class WStringUtil {
+
+ static final Pattern LOWER_UPPER_PATTERN = Pattern.compile("[A-Z][a-z]*");
+ static final Pattern PHONE_PATTERN = Pattern.compile("1\\d{10}");
+ static final Pattern EMAIL_PATTERN = Pattern.compile("^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$");
+
+ /**
+ * 是否是电话
+ *
+ * @param value
+ * @return
+ */
+ public static boolean isPhone(String value) {
+ return PHONE_PATTERN.matcher(value).matches();
+ }
+
+ /**
+ * 是否是邮箱
+ *
+ * @param value
+ * @return
+ */
+ public static boolean isEmail(String value) {
+ return EMAIL_PATTERN.matcher(value).matches();
+ }
+
+ /**
+ * 将以逗号分隔的字符串转换成字符串数组
+ *
+ * @param valStr
+ * @return String[]
+ */
+ public static String[] StrList(String valStr) {
+ int i = 0;
+ String TempStr = valStr;
+ String[] returnStr = new String[valStr.length() + 1 - TempStr.replace(",", "").length()];
+ valStr = valStr + ",";
+ while (valStr.indexOf(',') > 0) {
+ returnStr[i] = valStr.substring(0, valStr.indexOf(','));
+ valStr = valStr.substring(valStr.indexOf(',') + 1, valStr.length());
+
+ i++;
+ }
+ return returnStr;
+ }
+
+ /**
+ * 获取字符串编码
+ *
+ * @param str
+ * @return
+ */
+ public static String getEncoding(String str) {
+ String encode = "GB2312";
+ try {
+ if (str.equals(new String(str.getBytes(encode), encode))) {
+ String s = encode;
+ return s;
+ }
+ } catch (Exception exception) {
+ }
+ encode = "ISO-8859-1";
+ try {
+ if (str.equals(new String(str.getBytes(encode), encode))) {
+ String s1 = encode;
+ return s1;
+ }
+ } catch (Exception exception1) {
+ }
+ encode = "UTF-8";
+ try {
+ if (str.equals(new String(str.getBytes(encode), encode))) {
+ String s2 = encode;
+ return s2;
+ }
+ } catch (Exception exception2) {
+ }
+ encode = "GBK";
+ try {
+ if (str.equals(new String(str.getBytes(encode), encode))) {
+ String s3 = encode;
+ return s3;
+ }
+ } catch (Exception exception3) {
+ }
+ return "";
+ }
+
+ /**
+ * 第一个字母转小写,英文
+ *
+ * @param str
+ * @return
+ */
+ public static String firstToLower(String str) {
+ return str.substring(0, 1).toLowerCase() + str.substring(1);
+ }
+
+ /**
+ * 第一个字母大写、英文
+ *
+ * @param str
+ * @return
+ */
+ public static String firstToUpper(String str) {
+ return str.substring(0, 1).toUpperCase() + str.substring(1);
+ }
+
+ /**
+ *
+ * title 驼峰名称转下划线名称
+ *
+ *
+ * description 驼峰名称转小写名称用下划线名称
+ *
+ *
+ * @param str
+ * @return
+ * @author WenG
+ * @date 2018年2月28日 下午4:28:45
+ * @modifier WenG
+ * @date 2018年2月28日 下午4:28:45
+ */
+ public static String lowerUpper2UnderLine(String str) {
+ Matcher matcher = LOWER_UPPER_PATTERN.matcher(str);
+ while (matcher.find()) {
+ String group = matcher.group();
+ String lower = "_" + group.toLowerCase();
+ str = str.replaceFirst(group, lower);
+ matcher = LOWER_UPPER_PATTERN.matcher(str);
+ }
+ if (str.startsWith("_")) {
+ str = str.substring(1, str.length());
+ }
+ return str;
+ }
+
+ /**
+ *
+ * title 下划线分割转驼峰式
+ *
+ *
+ * description 下划线分割转驼峰式
+ *
+ *
+ * @param str
+ * @return
+ * @author WenG
+ * @date 2018年2月28日 下午4:49:13
+ * @modifier WenG
+ * @date 2018年2月28日 下午4:49:13
+ */
+ public static String underLine2LowerUpper(String str) {
+ String[] strs = str.split("_");
+ StringBuilder sb = new StringBuilder();
+ for (int i = 0; i < strs.length; i++) {
+ String letter = strs[i].toLowerCase();
+ if (letter.length() == 0) {
+ continue;
+ }
+ if (i == 0) {
+ sb.append(letter);
+ } else {
+ int firstLetter = letter.charAt(0);
+ firstLetter -= 32;
+ sb.append((char) firstLetter).append(letter.substring(1));
+ }
+ }
+ if (sb.length() > 0) {
+ return sb.toString();
+ }
+ return str;
+ }
+
+ /**
+ *
+ * title 下划线分割转驼峰式
+ *
+ *
+ * description 下划线分割转驼峰式
+ *
+ *
+ * @param str
+ * @param firstLower 第一个字母小写
+ * @return
+ * @author WenG
+ * @date 2018年2月28日 下午4:56:28
+ * @modifier WenG
+ * @date 2018年2月28日 下午4:56:28
+ */
+ public static String underLine2LowerUpper(String str, boolean firstLower) {
+ String result = underLine2LowerUpper(str);
+ if (firstLower) {
+ int first = result.charAt(0) + 32;
+ result = ((char) first) + result.substring(1, result.length());
+ }
+ return result;
+ }
+
+ /**
+ * 获取拼音
+ *
+ * @param src
+ * @return
+ */
+ public static String getPingYin(String src) {
+ char[] t1 = null;
+ t1 = src.toCharArray();
+ String[] t2 = new String[t1.length];
+ HanyuPinyinOutputFormat t3 = new HanyuPinyinOutputFormat();
+ t3.setCaseType(HanyuPinyinCaseType.LOWERCASE);
+ t3.setToneType(HanyuPinyinToneType.WITHOUT_TONE);
+ t3.setVCharType(HanyuPinyinVCharType.WITH_V);
+ String t4 = "";
+ int t0 = t1.length;
+ try {
+ for (int i = 0; i < t0; i++) {
+ // 判断是否为汉字字符
+ if (Character.toString(t1[i]).matches("[\\u4E00-\\u9FA5]+")) {
+ t2 = PinyinHelper.toHanyuPinyinStringArray(t1[i], t3);
+ t4 += t2[0];
+ } else {
+ t4 += Character.toString(t1[i]);
+ }
+ }
+ return t4;
+ } catch (BadHanyuPinyinOutputFormatCombination e1) {
+ e1.printStackTrace();
+ }
+ return t4;
+ }
+
+ /**
+ * 获取中文首字母
+ *
+ * @param str
+ * @return
+ */
+ public static String getPinYinHeadChar(String str) {
+ String convert = "";
+ for (int j = 0; j < str.length(); j++) {
+ char word = str.charAt(j);
+ String[] pinyinArray = PinyinHelper.toHanyuPinyinStringArray(word);
+ if (pinyinArray != null) {
+ convert += pinyinArray[0].charAt(0);
+ } else {
+ convert += word;
+ }
+ }
+ return convert;
+ }
+
+ /**
+ * 汉字转ASCII码
+ *
+ * @param cnStr
+ * @return
+ */
+ public static String getCnASCII(String cnStr) {
+ StringBuffer strBuf = new StringBuffer();
+ byte[] bGBK = cnStr.getBytes();
+ for (int i = 0; i < bGBK.length; i++) {
+ // System.out.println(Integer.toHexString(bGBK[i]&0xff));
+ strBuf.append(Integer.toHexString(bGBK[i] & 0xff));
+ }
+ return strBuf.toString();
+ }
+
+}
diff --git a/src/main/java/ink/wgink/code/factory/vos/FieldVO.java b/src/main/java/ink/wgink/code/factory/vos/FieldVO.java
new file mode 100644
index 0000000..fb34e44
--- /dev/null
+++ b/src/main/java/ink/wgink/code/factory/vos/FieldVO.java
@@ -0,0 +1,205 @@
+package ink.wgink.code.factory.vos;
+
+import javafx.beans.property.SimpleIntegerProperty;
+import javafx.beans.property.SimpleStringProperty;
+
+/**
+ * When you feel like quitting. Think about why you started
+ * 当你想要放弃的时候,想想当初你为何开始
+ *
+ * @ClassName: FieldVO
+ * @Description: 字段
+ * @Author: WangGeng
+ * @Date: 2021/3/6 17:35
+ * @Version: 1.0
+ **/
+public class FieldVO {
+
+ private SimpleIntegerProperty rowNumber;
+ private SimpleStringProperty columnName;
+ private SimpleStringProperty columnComment;
+ private SimpleStringProperty columnDefault;
+ private String dataType;
+ private SimpleStringProperty columnType;
+ private Integer characterMaximum;
+ private Integer numericPrecision;
+ private Integer numericScale;
+ private SimpleStringProperty propertyName;
+ private SimpleStringProperty propertyType;
+ private SimpleIntegerProperty propertyLength;
+ private String formFieldType;
+ private Boolean isFormShow;
+ private Boolean isListShow;
+ private Boolean isNotNull;
+
+ public FieldVO() {
+ this.rowNumber = new SimpleIntegerProperty(0);
+ this.columnName = new SimpleStringProperty();
+ this.columnComment = new SimpleStringProperty();
+ this.columnDefault = new SimpleStringProperty();
+ this.columnType = new SimpleStringProperty();
+ this.propertyName = new SimpleStringProperty();
+ this.propertyType = new SimpleStringProperty();
+ this.propertyLength = new SimpleIntegerProperty(0);
+ }
+
+ public int getRowNumber() {
+ return rowNumber.get();
+ }
+
+ public SimpleIntegerProperty rowNumberProperty() {
+ return rowNumber;
+ }
+
+ public void setRowNumber(int rowNumber) {
+ this.rowNumber.set(rowNumber);
+ }
+
+ public String getColumnName() {
+ return columnName.get();
+ }
+
+ public SimpleStringProperty columnNameProperty() {
+ return columnName;
+ }
+
+ public void setColumnName(String columnName) {
+ this.columnName.set(columnName);
+ }
+
+ public String getColumnComment() {
+ return columnComment.get();
+ }
+
+ public SimpleStringProperty columnCommentProperty() {
+ return columnComment;
+ }
+
+ public void setColumnComment(String columnComment) {
+ this.columnComment.set(columnComment);
+ }
+
+ public String getColumnDefault() {
+ return columnDefault.get();
+ }
+
+ public SimpleStringProperty columnDefaultProperty() {
+ return columnDefault;
+ }
+
+ public void setColumnDefault(String columnDefault) {
+ this.columnDefault.set(columnDefault);
+ }
+
+ public String getDataType() {
+ return dataType == null ? "" : dataType.trim();
+ }
+
+ public void setDataType(String dataType) {
+ this.dataType = dataType;
+ }
+
+ public String getColumnType() {
+ return columnType.get();
+ }
+
+ public SimpleStringProperty columnTypeProperty() {
+ return columnType;
+ }
+
+ public void setColumnType(String columnType) {
+ this.columnType.set(columnType);
+ }
+
+ public Integer getCharacterMaximum() {
+ return characterMaximum;
+ }
+
+ public void setCharacterMaximum(Integer characterMaximum) {
+ this.characterMaximum = characterMaximum;
+ }
+
+ public Integer getNumericPrecision() {
+ return numericPrecision;
+ }
+
+ public void setNumericPrecision(Integer numericPrecision) {
+ this.numericPrecision = numericPrecision;
+ }
+
+ public Integer getNumericScale() {
+ return numericScale;
+ }
+
+ public void setNumericScale(Integer numericScale) {
+ this.numericScale = numericScale;
+ }
+
+ public String getPropertyName() {
+ return propertyName.get();
+ }
+
+ public SimpleStringProperty propertyNameProperty() {
+ return propertyName;
+ }
+
+ public void setPropertyName(String propertyName) {
+ this.propertyName.set(propertyName);
+ }
+
+ public String getPropertyType() {
+ return propertyType.get();
+ }
+
+ public SimpleStringProperty propertyTypeProperty() {
+ return propertyType;
+ }
+
+ public void setPropertyType(String propertyType) {
+ this.propertyType.set(propertyType);
+ }
+
+ public int getPropertyLength() {
+ return propertyLength.get();
+ }
+
+ public SimpleIntegerProperty propertyLengthProperty() {
+ return propertyLength;
+ }
+
+ public void setPropertyLength(int propertyLength) {
+ this.propertyLength.set(propertyLength);
+ }
+
+ public String getFormFieldType() {
+ return formFieldType == null ? "" : formFieldType.trim();
+ }
+
+ public void setFormFieldType(String formFieldType) {
+ this.formFieldType = formFieldType;
+ }
+
+ public Boolean getFormShow() {
+ return isFormShow;
+ }
+
+ public void setFormShow(Boolean formShow) {
+ isFormShow = formShow;
+ }
+
+ public Boolean getListShow() {
+ return isListShow;
+ }
+
+ public void setListShow(Boolean listShow) {
+ isListShow = listShow;
+ }
+
+ public Boolean getNotNull() {
+ return isNotNull;
+ }
+
+ public void setNotNull(Boolean notNull) {
+ isNotNull = notNull;
+ }
+}
diff --git a/src/main/java/ink/wgink/code/factory/vos/TableVO.java b/src/main/java/ink/wgink/code/factory/vos/TableVO.java
new file mode 100644
index 0000000..a195c5d
--- /dev/null
+++ b/src/main/java/ink/wgink/code/factory/vos/TableVO.java
@@ -0,0 +1,84 @@
+package ink.wgink.code.factory.vos;
+
+import javafx.beans.property.SimpleIntegerProperty;
+import javafx.beans.property.SimpleStringProperty;
+
+/**
+ * When you feel like quitting. Think about why you started
+ * 当你想要放弃的时候,想想当初你为何开始
+ *
+ * @ClassName: TableVO
+ * @Description:
+ * @Author: WangGeng
+ * @Date: 2021/3/3 14:07
+ * @Version: 1.0
+ **/
+public class TableVO {
+
+ private SimpleIntegerProperty rowNumber;
+ private SimpleStringProperty tableName;
+ private SimpleStringProperty tableCollation;
+ private SimpleStringProperty tableComment;
+
+ public TableVO() {
+ this.rowNumber = new SimpleIntegerProperty();
+ this.tableName = new SimpleStringProperty();
+ this.tableCollation = new SimpleStringProperty();
+ this.tableComment = new SimpleStringProperty();
+ }
+
+ public TableVO(Integer rowNumber, String tableName, String tableCollation, String tableComment) {
+ this.rowNumber = new SimpleIntegerProperty(rowNumber);
+ this.tableName = new SimpleStringProperty(tableName);
+ this.tableCollation = new SimpleStringProperty(tableCollation);
+ this.tableComment = new SimpleStringProperty(tableComment);
+ }
+
+ public int getRowNumber() {
+ return rowNumber.get();
+ }
+
+ public SimpleIntegerProperty rowNumberProperty() {
+ return rowNumber;
+ }
+
+ public void setRowNumber(int rowNumber) {
+ this.rowNumber.set(rowNumber);
+ }
+
+ public String getTableName() {
+ return tableName.get();
+ }
+
+ public SimpleStringProperty tableNameProperty() {
+ return tableName;
+ }
+
+ public void setTableName(String tableName) {
+ this.tableName.set(tableName);
+ }
+
+ public String getTableCollation() {
+ return tableCollation.get();
+ }
+
+ public SimpleStringProperty tableCollationProperty() {
+ return tableCollation;
+ }
+
+ public void setTableCollation(String tableCollation) {
+ this.tableCollation.set(tableCollation);
+ }
+
+ public String getTableComment() {
+ return tableComment.get();
+ }
+
+ public SimpleStringProperty tableCommentProperty() {
+ return tableComment;
+ }
+
+ public void setTableComment(String tableComment) {
+ this.tableComment.set(tableComment);
+ }
+}
diff --git a/src/main/resources/assets/css/style.css b/src/main/resources/assets/css/style.css
new file mode 100644
index 0000000..68f6a45
--- /dev/null
+++ b/src/main/resources/assets/css/style.css
@@ -0,0 +1,3 @@
+table {
+ -fx-alignment: center;
+}
\ No newline at end of file
diff --git a/src/main/resources/route/generate.fxml b/src/main/resources/route/generate.fxml
new file mode 100644
index 0000000..26b5172
--- /dev/null
+++ b/src/main/resources/route/generate.fxml
@@ -0,0 +1,191 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/route/login.fxml b/src/main/resources/route/login.fxml
new file mode 100644
index 0000000..4e7a728
--- /dev/null
+++ b/src/main/resources/route/login.fxml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/route/main.fxml b/src/main/resources/route/main.fxml
new file mode 100644
index 0000000..fd37339
--- /dev/null
+++ b/src/main/resources/route/main.fxml
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+