Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
architecture
/
glsx-archetype
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit f1de95f9
authored
Apr 14, 2023
by
刘宇峰
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
框架完善
1 parent
230610c0
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
84 additions
and
9 deletions
glsx-archetype-parent/rest-admin-pulsar-archetype/pom.xml
glsx-archetype-parent/rest-canal-archetype/pom.xml
rest-archetype-framework-build/rest-admin-framework-dependencies/pom.xml
rest-archetype-framework/rest-admin-exception/src/main/java/com/glsx/plat/exception/ServiceException.java
rest-archetype-framework/rest-admin-mybatis/pom.xml
rest-archetype-framework/rest-admin-mybatis/src/main/java/com/glsx/plat/mybatis/plugin/LombokPlugin.java
glsx-archetype-parent/rest-admin-pulsar-archetype/pom.xml
View file @
f1de95f
...
@@ -77,7 +77,7 @@
...
@@ -77,7 +77,7 @@
<dependency>
<dependency>
<groupId>
org.mybatis.generator
</groupId>
<groupId>
org.mybatis.generator
</groupId>
<artifactId>
mybatis-generator-core
</artifactId>
<artifactId>
mybatis-generator-core
</artifactId>
<version>
1.
3.7
</version>
<version>
1.
4.1
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
tk.mybatis
</groupId>
<groupId>
tk.mybatis
</groupId>
...
...
glsx-archetype-parent/rest-canal-archetype/pom.xml
View file @
f1de95f
...
@@ -50,7 +50,7 @@
...
@@ -50,7 +50,7 @@
<dependency>
<dependency>
<groupId>
org.mybatis.generator
</groupId>
<groupId>
org.mybatis.generator
</groupId>
<artifactId>
mybatis-generator-core
</artifactId>
<artifactId>
mybatis-generator-core
</artifactId>
<version>
1.
3.7
</version>
<version>
1.
4.1
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
tk.mybatis
</groupId>
<groupId>
tk.mybatis
</groupId>
...
...
rest-archetype-framework-build/rest-admin-framework-dependencies/pom.xml
View file @
f1de95f
...
@@ -31,6 +31,9 @@
...
@@ -31,6 +31,9 @@
<jackson.version>
2.13.3
</jackson.version>
<jackson.version>
2.13.3
</jackson.version>
<joda.time.version>
2.12.5
</joda.time.version>
<joda.time.version>
2.12.5
</joda.time.version>
<persistence.version>
1.0
</persistence.version>
<persistence.version>
1.0
</persistence.version>
<pagehelper.boot.version>
1.4.2
</pagehelper.boot.version>
<jsqlparser.version>
4.4
</jsqlparser.version>
<mybatis.generator.version>
1.4.1
</mybatis.generator.version>
<org.mapstruct.version>
1.5.2.Final
</org.mapstruct.version>
<org.mapstruct.version>
1.5.2.Final
</org.mapstruct.version>
</properties>
</properties>
...
@@ -87,6 +90,21 @@
...
@@ -87,6 +90,21 @@
<artifactId>
joda-time
</artifactId>
<artifactId>
joda-time
</artifactId>
<version>
${joda.time.version}
</version>
<version>
${joda.time.version}
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.github.pagehelper
</groupId>
<artifactId>
pagehelper-spring-boot-starter
</artifactId>
<version>
${pagehelper.boot.version}
</version>
</dependency>
<dependency>
<groupId>
com.github.jsqlparser
</groupId>
<artifactId>
jsqlparser
</artifactId>
<version>
${jsqlparser.version}
</version>
</dependency>
<dependency>
<groupId>
org.mybatis.generator
</groupId>
<artifactId>
mybatis-generator-core
</artifactId>
<version>
${mybatis.generator.version}
</version>
</dependency>
<dependency>
<dependency>
<groupId>
com.glsx
</groupId>
<groupId>
com.glsx
</groupId>
...
...
rest-archetype-framework/rest-admin-exception/src/main/java/com/glsx/plat/exception/ServiceException.java
View file @
f1de95f
...
@@ -21,10 +21,10 @@ public class ServiceException extends RuntimeException implements Serializable {
...
@@ -21,10 +21,10 @@ public class ServiceException extends RuntimeException implements Serializable {
public
static
ServiceException
create
(
String
code
,
String
msg
)
{
public
static
ServiceException
create
(
String
code
,
String
msg
)
{
log
.
error
(
"RuntimeException {} {}"
,
code
,
msg
);
log
.
error
(
"RuntimeException {} {}"
,
code
,
msg
);
ServiceException
serviceE
xception
=
new
ServiceException
();
ServiceException
e
xception
=
new
ServiceException
();
serviceE
xception
.
setCode
(
code
);
e
xception
.
setCode
(
code
);
serviceE
xception
.
setMsg
(
msg
);
e
xception
.
setMsg
(
msg
);
return
serviceE
xception
;
return
e
xception
;
}
}
}
}
rest-archetype-framework/rest-admin-mybatis/pom.xml
View file @
f1de95f
...
@@ -14,7 +14,6 @@
...
@@ -14,7 +14,6 @@
<properties>
<properties>
<mybatis.boot.version>
2.2.2
</mybatis.boot.version>
<mybatis.boot.version>
2.2.2
</mybatis.boot.version>
<mapper.boot.version>
2.1.5
</mapper.boot.version>
<mapper.boot.version>
2.1.5
</mapper.boot.version>
<pagehelper.boot.version>
1.4.2
</pagehelper.boot.version>
</properties>
</properties>
<dependencies>
<dependencies>
...
@@ -53,7 +52,6 @@
...
@@ -53,7 +52,6 @@
<dependency>
<dependency>
<groupId>
com.github.pagehelper
</groupId>
<groupId>
com.github.pagehelper
</groupId>
<artifactId>
pagehelper-spring-boot-starter
</artifactId>
<artifactId>
pagehelper-spring-boot-starter
</artifactId>
<version>
${pagehelper.boot.version}
</version>
<exclusions>
<exclusions>
<exclusion>
<exclusion>
<groupId>
com.github.jsqlparser
</groupId>
<groupId>
com.github.jsqlparser
</groupId>
...
@@ -65,7 +63,10 @@
...
@@ -65,7 +63,10 @@
<dependency>
<dependency>
<groupId>
com.github.jsqlparser
</groupId>
<groupId>
com.github.jsqlparser
</groupId>
<artifactId>
jsqlparser
</artifactId>
<artifactId>
jsqlparser
</artifactId>
<version>
4.4
</version>
</dependency>
<dependency>
<groupId>
org.mybatis.generator
</groupId>
<artifactId>
mybatis-generator-core
</artifactId>
</dependency>
</dependency>
</dependencies>
</dependencies>
</project>
</project>
\ No newline at end of file
\ No newline at end of file
rest-archetype-framework/rest-admin-mybatis/src/main/java/com/glsx/plat/mybatis/plugin/LombokPlugin.java
0 → 100644
View file @
f1de95f
package
com
.
glsx
.
plat
.
mybatis
.
plugin
;
import
org.mybatis.generator.api.IntrospectedColumn
;
import
org.mybatis.generator.api.IntrospectedTable
;
import
org.mybatis.generator.api.PluginAdapter
;
import
org.mybatis.generator.api.dom.java.Method
;
import
org.mybatis.generator.api.dom.java.TopLevelClass
;
import
java.util.List
;
/**
* 在实体中生成 Lombok 注解
*/
public
class
LombokPlugin
extends
PluginAdapter
{
@Override
public
boolean
validate
(
List
<
String
>
list
)
{
return
true
;
}
/**
* 添加注解的方法
*/
@Override
public
boolean
modelBaseRecordClassGenerated
(
TopLevelClass
topLevelClass
,
IntrospectedTable
introspectedTable
)
{
// 添加实体类的 import
topLevelClass
.
addImportedType
(
"lombok.Data"
);
topLevelClass
.
addImportedType
(
"lombok.NoArgsConstructor"
);
topLevelClass
.
addImportedType
(
"lombok.AllArgsConstructor"
);
topLevelClass
.
addImportedType
(
"lombok.experimental.Accessors"
);
// 添加实体类的 lombok 注解
topLevelClass
.
addAnnotation
(
"@Data"
);
topLevelClass
.
addAnnotation
(
"@Accessors(chain = true)"
);
topLevelClass
.
addAnnotation
(
"@NoArgsConstructor"
);
topLevelClass
.
addAnnotation
(
"@AllArgsConstructor"
);
return
true
;
}
@Override
public
boolean
modelSetterMethodGenerated
(
Method
method
,
TopLevelClass
topLevelClass
,
IntrospectedColumn
introspectedColumn
,
IntrospectedTable
introspectedTable
,
ModelClassType
modelClassType
)
{
// 不生成 setter
return
false
;
}
@Override
public
boolean
modelGetterMethodGenerated
(
Method
method
,
TopLevelClass
topLevelClass
,
IntrospectedColumn
introspectedColumn
,
IntrospectedTable
introspectedTable
,
ModelClassType
modelClassType
)
{
// 不生成 getter
return
false
;
}
}
\ No newline at end of file
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
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 post a comment