Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
renren-generator
Overview
Overview
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
吴迪
renren-generator
Commits
ff464827
Commit
ff464827
authored
May 12, 2020
by
gxz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决了使用非Mongo加载相应依赖的问题
同时优化了内部类的创建命名
parent
d64ddee6
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
4 deletions
+9
-4
MongoDBGeneratorDao.java
src/main/java/io/renren/dao/MongoDBGeneratorDao.java
+1
-1
GenUtils.java
src/main/java/io/renren/utils/GenUtils.java
+6
-1
application.yml
src/main/resources/application.yml
+2
-2
No files found.
src/main/java/io/renren/dao/MongoDBGeneratorDao.java
View file @
ff464827
...
@@ -21,7 +21,7 @@ import java.util.Map;
...
@@ -21,7 +21,7 @@ import java.util.Map;
@Conditional
(
MongoCondition
.
class
)
@Conditional
(
MongoCondition
.
class
)
public
class
MongoDBGeneratorDao
implements
GeneratorDao
{
public
class
MongoDBGeneratorDao
implements
GeneratorDao
{
@Autowired
private
MongoDBCollectionFactory
mongoDBCollectionFactory
;
private
MongoDBCollectionFactory
mongoDBCollectionFactory
;
@Override
@Override
...
...
src/main/java/io/renren/utils/GenUtils.java
View file @
ff464827
...
@@ -301,7 +301,7 @@ public class GenUtils {
...
@@ -301,7 +301,7 @@ public class GenUtils {
packagePath
+=
packageName
.
replace
(
"."
,
File
.
separator
)
+
File
.
separator
+
moduleName
+
File
.
separator
;
packagePath
+=
packageName
.
replace
(
"."
,
File
.
separator
)
+
File
.
separator
+
moduleName
+
File
.
separator
;
}
}
if
(
template
.
contains
(
"MongoChildrenEntity.java.vm"
))
{
if
(
template
.
contains
(
"MongoChildrenEntity.java.vm"
))
{
return
packagePath
+
"entity"
+
File
.
separator
+
"inner"
+
File
.
separator
+
currentTableName
+
File
.
separator
+
className
+
"InnerEntity.java"
;
return
packagePath
+
"entity"
+
File
.
separator
+
"inner"
+
File
.
separator
+
currentTableName
+
File
.
separator
+
splitInnerName
(
className
)
+
"InnerEntity.java"
;
}
}
if
(
template
.
contains
(
"Entity.java.vm"
)
||
template
.
contains
(
"MongoEntity.java.vm"
))
{
if
(
template
.
contains
(
"Entity.java.vm"
)
||
template
.
contains
(
"MongoEntity.java.vm"
))
{
return
packagePath
+
"entity"
+
File
.
separator
+
className
+
"Entity.java"
;
return
packagePath
+
"entity"
+
File
.
separator
+
className
+
"Entity.java"
;
...
@@ -343,4 +343,9 @@ public class GenUtils {
...
@@ -343,4 +343,9 @@ public class GenUtils {
return
null
;
return
null
;
}
}
private
static
String
splitInnerName
(
String
name
){
name
=
name
.
replaceAll
(
"\\."
,
"_"
);
return
name
;
}
}
}
src/main/resources/application.yml
View file @
ff464827
...
@@ -39,8 +39,8 @@ spring:
...
@@ -39,8 +39,8 @@ spring:
# port: 27017
# port: 27017
# auth: false #是否使用密码验证
# auth: false #是否使用密码验证
# username: tincery
# username: tincery
# password:
Txy123.com
# password:
renren
# source:
tincery_pro
# source:
123456
# database: test
# database: test
mybatis-plus
:
mybatis-plus
:
...
...
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