Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
231ffa43
Commit
231ffa43
authored
Aug 31, 2023
by
tianyiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tzs拆分服务根据表生成代码
parent
7ea33d57
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
18 deletions
+27
-18
pom.xml
amos-boot-biz-common/pom.xml
+5
-0
MyBatisPlusCodeGeneratorTzs.java
...os/boot/biz/common/utils/MyBatisPlusCodeGeneratorTzs.java
+22
-18
No files found.
amos-boot-biz-common/pom.xml
View file @
231ffa43
...
...
@@ -136,6 +136,11 @@
<artifactId>
pagehelper
</artifactId>
<version>
5.1.10
</version>
</dependency>
<dependency>
<groupId>
org.postgresql
</groupId>
<artifactId>
postgresql
</artifactId>
<scope>
runtime
</scope>
</dependency>
</dependencies>
...
...
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/utils/MyBatisPlusCodeGeneratorTzs.java
View file @
231ffa43
...
...
@@ -27,28 +27,32 @@ public class MyBatisPlusCodeGeneratorTzs {
* 项目名称缩写
*/
static
String
projectShortName
=
"tzs"
;
/**
* 拆分服务名 可根据实际拆分项目进行修改
*/
static
String
ShortName
=
"ymt"
;
/**
* 项目api目录
*/
static
String
apiAddress
=
"/amos-boot-system-"
+
projectShortName
+
"
/"
+
"amos-boot-module-"
+
project
ShortName
+
"-api/"
;
static
String
apiAddress
=
"/amos-boot-system-"
+
projectShortName
+
"/"
+
"amos-boot-module-ymt
/"
+
"amos-boot-module-"
+
ShortName
+
"-api/"
;
/**
* 项目biz目录
*/
static
String
bizAddress
=
"/amos-boot-system-"
+
projectShortName
+
"/"
+
"amos-boot-module-"
+
project
ShortName
+
"-biz/"
;
static
String
bizAddress
=
"/amos-boot-system-"
+
projectShortName
+
"/"
+
"amos-boot-module-ymt/"
+
"amos-boot-module-"
+
ShortName
+
"-biz/"
;
/**
* 项目api路径
*/
static
String
apiPath
=
apiAddress
+
"src/main/java/com/yeejoin/amos/boot/module/"
+
project
ShortName
+
"/api"
;
static
String
apiPath
=
apiAddress
+
"src/main/java/com/yeejoin/amos/boot/module/"
+
ShortName
+
"/api"
;
/**
* 项目biz路径
*/
static
String
bizPath
=
bizAddress
+
"src/main/java/com/yeejoin/amos/boot/module/"
+
project
ShortName
+
"/biz"
;
static
String
bizPath
=
bizAddress
+
"src/main/java/com/yeejoin/amos/boot/module/"
+
ShortName
+
"/biz"
;
/**
* 接口及实体等代码生成路径
...
...
@@ -102,12 +106,12 @@ public class MyBatisPlusCodeGeneratorTzs {
gc
.
setActiveRecord
(
false
);
// 数据源配置
DataSourceConfig
dsc
=
new
DataSourceConfig
();
dsc
.
setUrl
(
"jdbc:
mysql://172.16.10.90:53306/tzs_amos_tzs_biz?
serverTimezone=GMT%2B8"
);
// dsc.setSchemaName("public
");
// dsc.setDriverName("com.mysql.jdbc
.Driver");
dsc
.
setDriverName
(
"com.mysql.cj.jdbc
.Driver"
);
dsc
.
setUsername
(
"
root
"
);
dsc
.
setPassword
(
"Yeejoin@202
0
"
);
dsc
.
setUrl
(
"jdbc:
postgresql://36.46.137.116:5432/tzs_amos_tzs_biz_init?&
serverTimezone=GMT%2B8"
);
dsc
.
setSchemaName
(
"amos_tzs_biz
"
);
dsc
.
setDriverName
(
"org.postgresql
.Driver"
);
// dsc.setDriverName("cn.com.vastbase
.Driver");
dsc
.
setUsername
(
"
admin
"
);
dsc
.
setPassword
(
"Yeejoin@202
3
"
);
dsc
.
setTypeConvert
(
new
ITypeConvert
()
{
@Override
...
...
@@ -129,7 +133,7 @@ public class MyBatisPlusCodeGeneratorTzs {
// 包配置
final
PackageConfig
pc
=
new
PackageConfig
();
// 填写对应模块
pc
.
setModuleName
(
project
ShortName
);
pc
.
setModuleName
(
ShortName
);
// 实体路径
pc
.
setParent
(
"com.yeejoin.amos.boot.module"
);
pc
.
setEntity
(
"api.entity"
);
...
...
@@ -204,7 +208,7 @@ public class MyBatisPlusCodeGeneratorTzs {
focList
.
add
(
new
FileOutConfig
(
mapper
)
{
@Override
public
String
outputFile
(
TableInfo
tableInfo
)
{
String
filePath
=
interfaceCodeOutPath
String
filePath
=
interfaceCodeOutPath
+
"/mapper/"
+
tableInfo
.
getEntityName
()
+
"Mapper"
+
StringPool
.
DOT_JAVA
;
System
.
out
.
println
(
"mapper:"
+
filePath
);
return
filePath
;
...
...
@@ -214,17 +218,17 @@ public class MyBatisPlusCodeGeneratorTzs {
focList
.
add
(
new
FileOutConfig
(
service
)
{
@Override
public
String
outputFile
(
TableInfo
tableInfo
)
{
String
filePath
=
interfaceCodeOutPath
String
filePath
=
interfaceCodeOutPath
+
"/service/"
+
tableInfo
.
getServiceName
()
+
StringPool
.
DOT_JAVA
;
System
.
out
.
println
(
"service:"
+
filePath
);
return
filePath
;
System
.
out
.
println
(
"service:"
+
filePath
);
return
filePath
;
}
});
focList
.
add
(
new
FileOutConfig
(
serviceImpl
)
{
@Override
public
String
outputFile
(
TableInfo
tableInfo
)
{
String
filePath
=
controllerCodeOutPath
String
filePath
=
controllerCodeOutPath
+
"/service/impl/"
+
tableInfo
.
getServiceImplName
()
+
StringPool
.
DOT_JAVA
;
System
.
out
.
println
(
"service/impl:"
+
filePath
);
return
filePath
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment