From 2f236043a8081b472467fa72c246d0ce1f0bdaa9 Mon Sep 17 00:00:00 2001
From: ‘liusuyi’ <1951119284@qq.com>
Date: 星期二, 08 八月 2023 16:52:34 +0800
Subject: [PATCH] 删除mybatisplus代码生成工具
---
ard-work/pom.xml | 27 --------
/dev/null | 118 ---------------------------------------
2 files changed, 2 insertions(+), 143 deletions(-)
diff --git a/ard-work/pom.xml b/ard-work/pom.xml
index 18bb4f8..bfe265f 100644
--- a/ard-work/pom.xml
+++ b/ard-work/pom.xml
@@ -161,7 +161,7 @@
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
- <version>3.5.1</version>
+ <version>3.2.0</version>
</dependency>
<dependency>
<groupId>com.github.xiaoymin</groupId>
@@ -169,30 +169,7 @@
<version>3.0.3</version>
<scope>compile</scope>
</dependency>
- <!--MP浠g爜鐢熸垚鍣ㄤ緷璧�-->
- <dependency>
- <groupId>com.baomidou</groupId>
- <artifactId>mybatis-plus-generator</artifactId>
- <version>3.5.3.1</version>
- </dependency>
- <!--velocity妯℃澘寮曟搸-->
- <dependency>
- <groupId>org.apache.velocity</groupId>
- <artifactId>velocity-engine-core</artifactId>
- <version>2.0</version>
- </dependency>
- <!--postgresql鏁版嵁搴撲緷璧�-->
- <dependency>
- <groupId>org.postgresql</groupId>
- <artifactId>postgresql</artifactId>
- <scope>runtime</scope>
- </dependency>
-<!-- <!–mybatis-plus渚濊禆–>-->
-<!-- <dependency>-->
-<!-- <groupId>com.baomidou</groupId>-->
-<!-- <artifactId>mybatis-plus-boot-starter</artifactId>-->
-<!-- <version>3.5.1</version>-->
-<!-- </dependency>-->
+
</dependencies>
diff --git a/ard-work/src/main/java/com/ruoyi/utils/generator/CodeGeneration.java b/ard-work/src/main/java/com/ruoyi/utils/generator/CodeGeneration.java
deleted file mode 100644
index 049a5e6..0000000
--- a/ard-work/src/main/java/com/ruoyi/utils/generator/CodeGeneration.java
+++ /dev/null
@@ -1,118 +0,0 @@
-package com.ruoyi.utils.generator;
-
-import com.baomidou.mybatisplus.annotation.IdType;
-import com.baomidou.mybatisplus.generator.AutoGenerator;
-import com.baomidou.mybatisplus.generator.config.*;
-import com.baomidou.mybatisplus.generator.config.querys.PostgreSqlQuery;
-import com.baomidou.mybatisplus.generator.config.rules.DateType;
-import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
-
-import java.util.Collections;
-
-/**
- * @ClassName: CodeGeneration
- * @Description: mybatisPlus 浠g爜鐢熸垚宸ュ叿
- * @Author: Administrator
- * @Date: 2023骞�03鏈�25鏃� 14:49
- * @Version: 1.0
- **/
-public class CodeGeneration {
- public static void main(String[] args) {
- /**
- * 鍏堥厤缃暟鎹簮
- */
- PostgreSqlQuery postgreSqlQuery = new PostgreSqlQuery() {
- @Override
- public String[] fieldCustom() {
- return new String[]{"Default"};
- }
- };
-
- DataSourceConfig dsc = new DataSourceConfig.Builder("jdbc:postgresql://192.168.1.15:5432/ry-vue?stringtype=unspecified","postgres","postgres")
- .dbQuery(postgreSqlQuery).build();
- //閫氳繃datasourceConfig鍒涘缓AutoGenerator
- AutoGenerator generator = new AutoGenerator(dsc);
-
- /**
- * 鍏ㄥ眬閰嶇疆
- */
- String projectPath = System.getProperty("user.dir"); //鑾峰彇椤圭洰璺緞
- String filePath = projectPath + "/ard-work/src/main/java"; //java涓嬬殑鏂囦欢璺緞
- GlobalConfig global = new GlobalConfig.Builder()
- .outputDir(filePath)//鐢熸垚鐨勮緭鍑鸿矾寰�
- .author("鍒樿嫃涔�")//鐢熸垚鐨勪綔鑰呭悕瀛�
- //.enableSwagger()寮�鍚痵wagger锛岄渶瑕佹坊鍔爏wagger渚濊禆骞堕厤缃�
- .dateType(DateType.TIME_PACK)//鏃堕棿绛栫暐
- .commentDate("yyyy骞碝M鏈坉d鏃�")//鏍煎紡鍖栨椂闂存牸寮�
- .disableOpenDir()//绂佹鎵撳紑杈撳嚭鐩綍锛岄粯璁alse
- .fileOverride()//瑕嗙洊鐢熸垚鏂囦欢
- .build();
-
- /**
- * 鍖呴厤缃�
- */
- PackageConfig packages = new PackageConfig.Builder()
- .entity("domian")//瀹炰綋绫诲寘鍚�
- .parent("com.ruoyi.test")//鐖跺寘鍚嶃�傚鏋滀负绌猴紝灏嗕笅闈㈠瓙鍖呭悕蹇呴』鍐欏叏閮紝 鍚﹀垯灏卞彧闇�鍐欏瓙鍖呭悕
- .controller("controller")//鎺у埗灞傚寘鍚�
- .mapper("mapper")//mapper灞傚寘鍚�
- .xml("mapper.xml")//鏁版嵁璁块棶灞倄ml鍖呭悕
- .service("service")//service灞傚寘鍚�
- .serviceImpl("service.impl")//service瀹炵幇绫诲寘鍚�
- .pathInfo(Collections.singletonMap(OutputFile.xml, projectPath + "/ard-work/src/main/resources/mapper"))
- .build();
-
- /**
- * 绛栫暐閰嶇疆寮�濮�
- */
- StrategyConfig strategyConfig = new StrategyConfig.Builder()
- .enableCapitalMode()//寮�鍚叏灞�澶у啓鍛藉悕
- //.likeTable()妯$硦琛ㄥ尮閰�
- .addInclude("school")//娣诲姞琛ㄥ尮閰嶏紝鎸囧畾瑕佺敓鎴愮殑鏁版嵁琛ㄥ悕锛屼笉鍐欓粯璁ら�夊畾鏁版嵁搴撴墍鏈夎〃
- //.disableSqlFilter()绂佺敤sql杩囨护:榛樿(涓嶄娇鐢ㄨ鏂规硶锛塼rue
- //.enableSchema()鍚敤schema:榛樿false
-
- .entityBuilder() //瀹炰綋绛栫暐閰嶇疆
- //.disableSerialVersionUID()绂佺敤鐢熸垚SerialVersionUID锛氶粯璁rue
- .enableChainModel()//寮�鍚摼寮忔ā鍨�
- .enableLombok()//寮�鍚痩ombok
- .enableRemoveIsPrefix()//寮�鍚� Boolean 绫诲瀷瀛楁绉婚櫎 is 鍓嶇紑
- .enableTableFieldAnnotation()//寮�鍚敓鎴愬疄浣撴椂鐢熸垚瀛楁娉ㄨВ
- //.addTableFills()娣诲姞琛ㄥ瓧娈靛~鍏�
- .naming(NamingStrategy.underline_to_camel)//鏁版嵁琛ㄦ槧灏勫疄浣撳懡鍚嶇瓥鐣ワ細榛樿涓嬪垝绾胯浆椹煎嘲underline_to_camel
- .columnNaming(NamingStrategy.underline_to_camel)//琛ㄥ瓧娈垫槧灏勫疄浣撳睘鎬у懡鍚嶈鍒欙細榛樿null锛屼笉鎸囧畾鎸夌収naming鎵ц
- .idType(IdType.AUTO)//娣诲姞鍏ㄥ眬涓婚敭绫诲瀷
- .formatFileName("%s")//鏍煎紡鍖栧疄浣撳悕绉帮紝%s鍙栨秷棣栧瓧姣岻
- .build()
-
- .mapperBuilder()//mapper鏂囦欢绛栫暐
- .enableMapperAnnotation()//寮�鍚痬apper娉ㄨВ
- .enableBaseResultMap()//鍚敤xml鏂囦欢涓殑BaseResultMap 鐢熸垚
- .enableBaseColumnList()//鍚敤xml鏂囦欢涓殑BaseColumnList
- //.cache(缂撳瓨绫�.class)璁剧疆缂撳瓨瀹炵幇绫�
- .formatMapperFileName("%sMapper")//鏍煎紡鍖朌ao绫诲悕绉�
- .formatXmlFileName("%sMapper")//鏍煎紡鍖杧ml鏂囦欢鍚嶇О
- .build()
-
- .serviceBuilder()//service鏂囦欢绛栫暐
- .formatServiceFileName("%sService")//鏍煎紡鍖� service 鎺ュ彛鏂囦欢鍚嶇О
- .formatServiceImplFileName("%sServiceImpl")//鏍煎紡鍖� service 鎺ュ彛鏂囦欢鍚嶇О
- .build()
-
- .controllerBuilder()//鎺у埗灞傜瓥鐣�
- //.enableHyphenStyle()寮�鍚┘宄拌浆杩炲瓧绗︼紝榛樿锛歠alse
- .enableRestStyle()//寮�鍚敓鎴怈RestController
- .formatFileName("%sController")//鏍煎紡鍖栨枃浠跺悕绉�
- .build();
- /*鑷虫锛岀瓥鐣ラ厤缃墠绠楀熀鏈畬鎴愶紒*/
-
- /**
- * 灏嗘墍鏈夐厤缃」鏁村悎鍒癆utoGenerator涓繘琛屾墽琛�
- */
- generator.global(global)
- .packageInfo(packages)
- .strategy(strategyConfig)
- .execute();
- }
-}
-
--
Gitblit v1.9.3