Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Q
quick_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
Lv xiang
quick_generator
Commits
3cb36c43
Commit
3cb36c43
authored
Jun 13, 2018
by
xxlv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix template
parent
5c4cb6c1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
176 additions
and
146 deletions
+176
-146
workspace.xml
.idea/workspace.xml
+100
-117
gen.py
gen.py
+59
-17
${PLACE}.java
template/${PLACE}.java
+1
-1
${PLACE}BizImpl.java
template/${PLACE}BizImpl.java
+4
-1
${PLACE}Facade.java
template/${PLACE}Facade.java
+2
-2
${PLACE}FacadeImpl.java
template/${PLACE}FacadeImpl.java
+8
-7
${PLACE}Mapper.xml
template/${PLACE}Mapper.xml
+2
-1
No files found.
.idea/workspace.xml
View file @
3cb36c43
...
...
@@ -2,15 +2,13 @@
<project
version=
"4"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"1abc04e8-e167-42cd-98ea-074bbb2150ed"
name=
"Default"
comment=
""
>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/gen.py"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/gen.py"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/template/${PLACE}.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/template/${PLACE}.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/template/${PLACE}Biz.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/template/${PLACE}Biz.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/template/${PLACE}BizImpl.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/template/${PLACE}BizImpl.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/template/${PLACE}Facade.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/template/${PLACE}Facade.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/template/${PLACE}FacadeImpl.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/template/${PLACE}FacadeImpl.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/template/${PLACE}Mapper.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/template/${PLACE}Mapper.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/template/${PLACE}ReqDto.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/template/${PLACE}ReqDto.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/template/${PLACE}RespDto.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/template/${PLACE}RespDto.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/template/${PLACE}Mapper.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/template/${PLACE}Mapper.xml"
afterDir=
"false"
/>
</list>
<option
name=
"EXCLUDED_CONVERTED_TO_IGNORED"
value=
"true"
/>
<option
name=
"TRACKING_ENABLED"
value=
"true"
/>
...
...
@@ -24,11 +22,11 @@
</component>
<component
name=
"FileEditorManager"
>
<leaf
SIDE_TABS_SIZE_LIMIT_KEY=
"300"
>
<file
leaf-file-name=
"gen.py"
pinned=
"false"
current-in-tab=
"
tru
e"
>
<file
leaf-file-name=
"gen.py"
pinned=
"false"
current-in-tab=
"
fals
e"
>
<entry
file=
"file://$PROJECT_DIR$/gen.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
270
"
>
<caret
line=
"2
84"
column=
"11"
selection-start-line=
"284"
selection-start-column=
"11"
selection-end-line=
"284"
selection-end-column=
"11
"
/>
<state
relative-caret-position=
"
-367
"
>
<caret
line=
"2
65"
column=
"45"
lean-forward=
"true"
selection-start-line=
"265"
selection-start-column=
"45"
selection-end-line=
"265"
selection-end-column=
"45
"
/>
<folding>
<element
signature=
"e#42#51#0"
expanded=
"true"
/>
</folding>
...
...
@@ -36,6 +34,24 @@
</provider>
</entry>
</file>
<file
leaf-file-name=
"${PLACE}FacadeImpl.java"
pinned=
"false"
current-in-tab=
"true"
>
<entry
file=
"file://$PROJECT_DIR$/template/${PLACE}FacadeImpl.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state>
<caret
column=
"28"
selection-start-column=
"28"
selection-end-column=
"28"
/>
</state>
</provider>
</entry>
</file>
<file
leaf-file-name=
"${PLACE}Mapper.xml"
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/template/${PLACE}Mapper.xml"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"30"
>
<caret
line=
"2"
column=
"57"
selection-start-line=
"2"
selection-start-column=
"43"
selection-end-line=
"2"
selection-end-column=
"57"
/>
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component
name=
"FindInProjectRecents"
>
...
...
@@ -43,9 +59,14 @@
<find>
systemlogZt
</find>
<find>
{}/dat
</find>
<find>
clean_tmp
</find>
<find>
gen_po
</find>
<find>
compile_table
</find>
<find>
config_mybatis
</find>
<find>
PLACE
</find>
<find>
po
</find>
<find>
gen_po
</find>
<find>
is_po
</find>
<find>
table
</find>
<find>
get_rs
</find>
</findStrings>
<replaceStrings>
<replace>
${PLACE}
</replace>
...
...
@@ -59,18 +80,19 @@
<option
name=
"CHANGED_PATHS"
>
<list>
<option
value=
"$PROJECT_DIR$/heml.py"
/>
<option
value=
"$PROJECT_DIR$/tmp/generatorConfig.xml"
/>
<option
value=
"$PROJECT_DIR$/.gitignore"
/>
<option
value=
"$PROJECT_DIR$/README.md"
/>
<option
value=
"$PROJECT_DIR$/template/${PLACE}.java"
/>
<option
value=
"$PROJECT_DIR$/template/${PLACE}Biz.java"
/>
<option
value=
"$PROJECT_DIR$/template/${PLACE}BizImpl.java"
/>
<option
value=
"$PROJECT_DIR$/template/${PLACE}Facade.java"
/>
<option
value=
"$PROJECT_DIR$/template/${PLACE}FacadeImpl.java"
/>
<option
value=
"$PROJECT_DIR$/template/${PLACE}Mapper.java"
/>
<option
value=
"$PROJECT_DIR$/template/${PLACE}ReqDto.java"
/>
<option
value=
"$PROJECT_DIR$/template/${PLACE}RespDto.java"
/>
<option
value=
"$PROJECT_DIR$/template/${PLACE}Facade.java"
/>
<option
value=
"$PROJECT_DIR$/template/${PLACE}.java"
/>
<option
value=
"$PROJECT_DIR$/template/${PLACE}BizImpl.java"
/>
<option
value=
"$PROJECT_DIR$/template/${PLACE}Mapper.xml"
/>
<option
value=
"$PROJECT_DIR$/tmp/generatorConfig.xml"
/>
<option
value=
"$PROJECT_DIR$/gen.py"
/>
<option
value=
"$PROJECT_DIR$/template/${PLACE}FacadeImpl.java"
/>
</list>
</option>
</component>
...
...
@@ -101,12 +123,12 @@
<subPane>
<expand>
<path>
<item
name=
"quick_
tpl
"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"quick_
tpl
"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"quick_
generator
"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"quick_
generator
"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
<path>
<item
name=
"quick_
tpl
"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"quick_
tpl
"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"quick_
generator
"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"quick_
generator
"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"template"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
</expand>
...
...
@@ -229,8 +251,8 @@
<window_info
anchor=
"bottom"
id=
"Version Control"
order=
"7"
/>
<window_info
anchor=
"bottom"
id=
"Python Console"
order=
"9"
/>
<window_info
anchor=
"bottom"
id=
"Run"
order=
"2"
/>
<window_info
a
ctive=
"true"
a
nchor=
"bottom"
id=
"Terminal"
order=
"7"
visible=
"true"
weight=
"0.329718"
/>
<window_info
content_ui=
"combo"
id=
"Project"
order=
"0
"
weight=
"0.25235197"
/>
<window_info
anchor=
"bottom"
id=
"Terminal"
order=
"7"
visible=
"true"
weight=
"0.329718"
/>
<window_info
active=
"true"
content_ui=
"combo"
id=
"Project"
order=
"0"
visible=
"true
"
weight=
"0.25235197"
/>
<window_info
anchor=
"bottom"
id=
"Docker"
order=
"9"
show_stripe_button=
"false"
/>
<window_info
anchor=
"right"
id=
"Database"
order=
"3"
/>
<window_info
anchor=
"right"
id=
"SciView"
order=
"5"
/>
...
...
@@ -260,9 +282,8 @@
<window_info
id=
"Designer"
order=
"2"
/>
<window_info
anchor=
"right"
id=
"Palette"
order=
"3"
/>
<window_info
anchor=
"bottom"
id=
"Python Console"
order=
"12"
/>
<window_info
anchor=
"bottom"
id=
"Run"
order=
"2"
/>
<window_info
id=
"Image Layers"
order=
"3"
/>
<window_info
anchor=
"
right"
id=
"Commander"
internal_type=
"SLIDING"
order=
"0"
type=
"SLIDING"
weight=
"0.4
"
/>
<window_info
anchor=
"
bottom"
id=
"Run"
order=
"2
"
/>
<window_info
anchor=
"bottom"
id=
"Cvs"
order=
"4"
weight=
"0.25"
/>
<window_info
anchor=
"right"
id=
"Ant Build"
order=
"1"
weight=
"0.25"
/>
<window_info
id=
"Capture Tool"
order=
"4"
/>
...
...
@@ -271,12 +292,12 @@
<window_info
anchor=
"bottom"
id=
"Terminal"
order=
"8"
visible=
"true"
weight=
"0.329718"
/>
<window_info
anchor=
"bottom"
id=
"Docker"
order=
"13"
show_stripe_button=
"false"
/>
<window_info
anchor=
"right"
id=
"Capture Analysis"
order=
"4"
/>
<window_info
anchor=
"right"
id=
"Commander"
internal_type=
"SLIDING"
order=
"0"
type=
"SLIDING"
weight=
"0.4"
/>
<window_info
anchor=
"bottom"
id=
"Event Log"
order=
"9"
side_tool=
"true"
/>
<window_info
anchor=
"right"
content_ui=
"combo"
id=
"Hierarchy"
order=
"2"
weight=
"0.25"
/>
<window_info
anchor=
"bottom"
id=
"Database Changes"
order=
"10"
show_stripe_button=
"false"
/>
<window_info
anchor=
"bottom"
id=
"Version Control"
order=
"11"
/>
<window_info
anchor=
"right"
id=
"Maven Projects"
order=
"5"
/>
<window_info
anchor=
"bottom"
id=
"Find"
order=
"1"
weight=
"0.329718"
/>
<window_info
active=
"true"
content_ui=
"combo"
id=
"Project"
order=
"0"
visible=
"true"
weight=
"0.25235197"
/>
<window_info
anchor=
"right"
id=
"SciView"
order=
"9"
/>
<window_info
anchor=
"right"
id=
"Database"
order=
"6"
/>
...
...
@@ -286,6 +307,7 @@
<window_info
anchor=
"right"
id=
"Theme Preview"
order=
"8"
/>
<window_info
id=
"Structure"
order=
"1"
side_tool=
"true"
weight=
"0.25"
/>
<window_info
anchor=
"bottom"
id=
"Inspection"
order=
"5"
weight=
"0.4"
/>
<window_info
anchor=
"bottom"
id=
"Find"
order=
"1"
weight=
"0.329718"
/>
<window_info
anchor=
"bottom"
id=
"Debug"
order=
"3"
weight=
"0.4"
/>
</layout-to-restore>
</component>
...
...
@@ -296,34 +318,6 @@
<option
name=
"myLimit"
value=
"2678400000"
/>
</component>
<component
name=
"editorHistoryManager"
>
<entry
file=
"file://$PROJECT_DIR$/gen.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"150"
>
<caret
line=
"12"
column=
"17"
lean-forward=
"true"
selection-start-line=
"12"
selection-start-column=
"17"
selection-end-line=
"12"
selection-end-column=
"17"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/template/${PLACE}Facade.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"15"
>
<caret
line=
"1"
selection-start-line=
"1"
selection-end-line=
"1"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/template/${PLACE}FacadeImpl.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"315"
>
<caret
line=
"21"
column=
"5"
selection-start-line=
"21"
selection-start-column=
"5"
selection-end-line=
"21"
selection-end-column=
"5"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/gen.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"150"
>
<caret
line=
"12"
column=
"17"
lean-forward=
"true"
selection-start-line=
"12"
selection-start-column=
"17"
selection-end-line=
"12"
selection-end-column=
"17"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/template/${PLACE}Facade.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"15"
>
...
...
@@ -466,41 +460,12 @@
<entry
file=
"file://$PROJECT_DIR$/tmp/SystemlogMapper.xml"
/>
<entry
file=
"file://$PROJECT_DIR$/tmp/SystemlogRespDto.java"
/>
<entry
file=
"file://$PROJECT_DIR$/tmp/DemoBiz.java"
/>
<entry
file=
"file://$PROJECT_DIR$/ydl-login-intf/src/main/java/com/ydl/login/intf/po/DoctorModify.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
<entry
file=
"file://$PROJECT_DIR$/ydl-login-intf/src/main/java/com/ydl/login/intf/po/Fans.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
<entry
file=
"file://$PROJECT_DIR$/ydl-login-intf/src/main/java/com/ydl/login/intf/po/Queue.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
<entry
file=
"file://$PROJECT_DIR$/ydl-login-intf/src/main/java/com/ydl/login/intf/po/About.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"-135"
/>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/tmp/generatorConfig.xml"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"285"
>
<caret
line=
"19"
column=
"91"
lean-forward=
"true"
selection-start-line=
"19"
selection-start-column=
"91"
selection-end-line=
"19"
selection-end-column=
"91"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/tmp/About.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"210"
>
<caret
line=
"14"
column=
"7"
lean-forward=
"true"
selection-start-line=
"14"
selection-start-column=
"7"
selection-end-line=
"14"
selection-end-column=
"7"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/.gitignore"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"15"
>
<caret
line=
"1"
column=
"5"
lean-forward=
"true"
selection-start-line=
"1"
selection-start-column=
"5"
selection-end-line=
"1"
selection-end-column=
"5"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/ydl-login-intf/src/main/java/com/ydl/login/intf/po/DoctorModify.java"
/>
<entry
file=
"file://$PROJECT_DIR$/ydl-login-intf/src/main/java/com/ydl/login/intf/po/Fans.java"
/>
<entry
file=
"file://$PROJECT_DIR$/ydl-login-intf/src/main/java/com/ydl/login/intf/po/Queue.java"
/>
<entry
file=
"file://$PROJECT_DIR$/ydl-login-intf/src/main/java/com/ydl/login/intf/po/About.java"
/>
<entry
file=
"file://$PROJECT_DIR$/tmp/About.java"
/>
<entry
file=
"file://$PROJECT_DIR$/.gitignore"
/>
<entry
file=
"file:///usr/lib/python2.7/re.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"197"
>
...
...
@@ -508,85 +473,102 @@
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/README.md"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"435"
>
<caret
line=
"29"
lean-forward=
"true"
selection-start-line=
"29"
selection-end-line=
"29"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/template/${PLACE}.java"
>
<entry
file=
"file://$PROJECT_DIR$/README.md"
/>
<entry
file=
"file://$PROJECT_DIR$/template/${PLACE}Biz.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state>
<caret
column=
"47"
selection-start-column=
"47"
selection-end-column=
"47
"
/>
<state
relative-caret-position=
"45"
>
<caret
line=
"3"
column=
"45"
selection-start-line=
"3"
selection-start-column=
"45"
selection-end-line=
"3"
selection-end-column=
"45
"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/template/${PLACE}
Biz
.java"
>
<entry
file=
"file://$PROJECT_DIR$/template/${PLACE}
ReqDto
.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
4
5"
>
<caret
line=
"
3"
column=
"45"
selection-start-line=
"3"
selection-start-column=
"45"
selection-end-line=
"3"
selection-end-column=
"45
"
/>
<state
relative-caret-position=
"
10
5"
>
<caret
line=
"
7"
lean-forward=
"true"
selection-start-line=
"7"
selection-end-line=
"7
"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/template/${PLACE}
BizImpl
.java"
>
<entry
file=
"file://$PROJECT_DIR$/template/${PLACE}
RespDto
.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state>
<caret
column=
"46"
selection-start-column=
"46"
selection-end-column=
"46"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/template/${PLACE}Facade.java"
>
<entry
file=
"file://$PROJECT_DIR$/template/${PLACE}.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
<entry
file=
"file://$PROJECT_DIR$/template/${PLACE}BizImpl.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
75
"
>
<caret
line=
"
5"
column=
"80"
lean-forward=
"true"
selection-start-line=
"5"
selection-start-column=
"80"
selection-end-line=
"5"
selection-end-column=
"80
"
/>
<state
relative-caret-position=
"
270
"
>
<caret
line=
"
18"
column=
"57"
selection-start-line=
"18"
selection-start-column=
"57"
selection-end-line=
"18"
selection-end-column=
"57
"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/template/${PLACE}Facade
Impl
.java"
>
<entry
file=
"file://$PROJECT_DIR$/template/${PLACE}Facade.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
135
"
>
<caret
line=
"
9"
column=
"33"
lean-forward=
"true"
selection-start-line=
"9"
selection-start-column=
"33"
selection-end-line=
"9"
selection-end-column=
"33
"
/>
<state
relative-caret-position=
"
60
"
>
<caret
line=
"
4"
column=
"45"
selection-start-line=
"4"
selection-start-column=
"31"
selection-end-line=
"4"
selection-end-column=
"45
"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/template/${PLACE}Mapper.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
7
5"
>
<caret
line=
"
5"
column=
"62"
lean-forward=
"true"
selection-start-line=
"5"
selection-start-column=
"62"
selection-end-line=
"5"
selection-end-column=
"62
"
/>
<state
relative-caret-position=
"
10
5"
>
<caret
line=
"
7"
lean-forward=
"true"
selection-start-line=
"7"
selection-end-line=
"7
"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/template/${PLACE}Mapper.xml"
>
<entry
file=
"file://$PROJECT_DIR$/tmp/AbnormalOrder.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
<entry
file=
"file://$PROJECT_DIR$/tmp/AbnormalOrderFacadeImpl.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
/>
</entry>
<entry
file=
"file://$PROJECT_DIR$/tmp/AbnormalOrderMapper.xml"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"60"
>
<caret
line=
"4"
column=
"9"
lean-forward=
"true"
selection-start-line=
"4"
selection-start-column=
"9"
selection-end-line=
"4"
selection-end-column=
"9"
/>
<caret
line=
"4"
column=
"9"
selection-start-line=
"4"
selection-start-column=
"9"
selection-end-line=
"4"
selection-end-column=
"9"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/t
emplate/${PLACE}ReqDto.java
"
>
<entry
file=
"file://$PROJECT_DIR$/t
mp/generatorConfig.xml
"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
105
"
>
<caret
line=
"
7"
lean-forward=
"true"
selection-start-line=
"7"
selection-end-line=
"7
"
/>
<state
relative-caret-position=
"
447
"
>
<caret
line=
"
59"
lean-forward=
"true"
selection-start-line=
"59"
selection-end-line=
"59
"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/t
emplate/${PLACE}RespDto
.java"
>
<entry
file=
"file://$PROJECT_DIR$/t
mp/java/com/ydl/user/intf/po/AbnormalOrder
.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state>
<caret
column=
"46"
selection-start-column=
"46"
selection-end-column=
"46
"
/>
<state
relative-caret-position=
"195"
>
<caret
line=
"13"
lean-forward=
"true"
selection-start-line=
"13"
selection-end-line=
"13
"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/gen.py"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
270
"
>
<caret
line=
"2
84"
column=
"11"
selection-start-line=
"284"
selection-start-column=
"11"
selection-end-line=
"284"
selection-end-column=
"11
"
/>
<state
relative-caret-position=
"
-367
"
>
<caret
line=
"2
65"
column=
"45"
lean-forward=
"true"
selection-start-line=
"265"
selection-start-column=
"45"
selection-end-line=
"265"
selection-end-column=
"45
"
/>
<folding>
<element
signature=
"e#42#51#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/template/${PLACE}Mapper.xml"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"30"
>
<caret
line=
"2"
column=
"57"
selection-start-line=
"2"
selection-start-column=
"43"
selection-end-line=
"2"
selection-end-column=
"57"
/>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/template/${PLACE}FacadeImpl.java"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state>
<caret
column=
"28"
selection-start-column=
"28"
selection-end-column=
"28"
/>
</state>
</provider>
</entry>
</component>
</project>
\ No newline at end of file
gen.py
View file @
3cb36c43
...
...
@@ -130,6 +130,8 @@ def is_po(res_name, identity):
:param identity:
:return:
"""
res_name
=
res_name
[
0
]
.
upper
()
+
res_name
[
1
:]
print
(
"检测po {} {}"
.
format
(
res_name
,
identity
.
split
(
"/"
)[
-
1
]))
return
"{}.java"
.
format
(
res_name
)
==
identity
.
split
(
"/"
)[
-
1
]
...
...
@@ -158,14 +160,20 @@ def config_mybatis(res_name, table_name, mybatis_config_path):
enableDeleteByExample
=
"false"
,
enableSelectByExample
=
"false"
,
enableUpdateByExample
=
"false"
,
selectByExampleQueryId
=
"false"
)
classPathEntry
=
ET
.
Element
(
"classPathEntry"
,
location
=
"{}/mysql-connector-java-5.1.25.jar"
.
format
(
JAR_PATH
))
context
=
root
.
find
(
"context"
)
root
.
getroot
()
.
insert
(
0
,
classPathEntry
)
context
.
append
(
e
)
po_path
=
context
.
find
(
"javaModelGenerator"
)
.
get
(
"targetPackage"
)
java_model_generator
=
context
.
find
(
"javaModelGenerator"
)
java_model_generator
.
set
(
"targetProject"
,
"{}/java/"
.
format
(
TMP
))
tmp_mybatis_path
=
os
.
path
.
join
(
TMP
,
"generatorConfig.xml"
)
root
.
write
(
tmp_mybatis_path
,
encoding
=
"utf-8"
)
with
open
(
tmp_mybatis_path
,
"r+"
)
as
f
:
...
...
@@ -209,7 +217,13 @@ def gen_po(res_name, project_target_path):
print
(
"----------------------------------------"
)
os
.
system
(
gen_po_cmd
)
with
open
(
"{}/{}.java"
.
format
(
po_path
,
res_name
),
"r+"
)
as
f
:
mybatis_gen_po_path
=
"{}/{}.java"
.
format
(
po_path
,
res_name
)
if
(
not
os
.
path
.
exists
(
mybatis_gen_po_path
)):
print
(
"无法获取到Mybatis 生成的po文件"
)
exit
(
-
1
)
with
open
(
mybatis_gen_po_path
,
"r+"
)
as
f
:
po
=
f
.
read
()
return
po
...
...
@@ -226,6 +240,8 @@ def compile_content(res_name, compile_table, origin, tmp, project_target_path):
:param project_target_path:
:return:
"""
res_name
=
get_res_name
(
res_name
)
if
not
os
.
path
.
isdir
(
tmp
):
os
.
mkdir
(
tmp
)
...
...
@@ -241,6 +257,7 @@ def compile_content(res_name, compile_table, origin, tmp, project_target_path):
# 检测如果当前的文件是PO的话,使用mybatis 生成po
if
is_po
(
res_name
,
identity
):
print
(
"发现po {}"
.
format
(
identity
))
with
open
(
identity
,
"w+"
)
as
f
:
f
.
write
(
gen_po
(
res_name
,
project_target_path
))
...
...
@@ -281,22 +298,47 @@ def clean_tmp():
def
get_res_name
(
res_name
):
# TODO
# 转化为驼峰
pass
name
=
underline2hump
(
res_name
)
return
name
[
0
]
.
upper
()
+
name
[
1
:]
def
hump2underline
(
hunp_str
):
'''
驼峰形式字符串转成下划线形式
:param hunp_str: 驼峰形式字符串
:return: 字母全小写的下划线形式字符串
'''
# 匹配正则,匹配小写字母和大写字母的分界位置
p
=
re
.
compile
(
r'([a-z]|\d)([A-Z])'
)
# 这里第二个参数使用了正则分组的后向引用
sub
=
re
.
sub
(
p
,
r'\1_\2'
,
hunp_str
)
.
lower
()
return
sub
def
underline2hump
(
underline_str
):
'''
下划线形式字符串转成驼峰形式
:param underline_str: 下划线形式字符串
:return: 驼峰形式字符串
'''
# 这里re.sub()函数第二个替换参数用到了一个匿名回调函数,回调函数的参数x为一个匹配对象,返回值为一个处理后的字符串
sub
=
re
.
sub
(
r'(_\w)'
,
lambda
x
:
x
.
group
(
1
)[
1
]
.
upper
(),
underline_str
)
return
sub
def
get_table_name
(
res_name
):
table_name
=
""
res_name
=
res_name
[
0
:
1
]
.
lower
()
+
res_name
[
1
:]
for
i
in
range
(
0
,
len
(
res_name
)):
t
=
res_name
[
i
]
if
(
t
.
isupper
()):
t
=
""
.
join
([
"_"
,
t
.
lower
()])
table_name
=
""
.
join
([
table_name
,
t
])
return
table_name
return
hump2underline
(
res_name
)
#
# table_name = ""
# res_name = res_name[0:1].lower() + res_name[1:]
#
# for i in range(0, len(res_name)):
# t = res_name[i]
# if (t.isupper()):
# t = "".join(["_", t.lower()])
# table_name = "".join([table_name, t])
#
# return table_name
def
gen
(
res_name
,
look_path
):
...
...
@@ -329,6 +371,7 @@ def gen(res_name, look_path):
intf
=
PROJECT_TARGET_PATH
[
"intf_po_path"
]
# 检索包名
p
=
re
.
compile
(
"[
\
s
\
S]*
\
/(.+)
\
-intf
\
/[
\
s
\
S]*"
)
matches
=
re
.
match
(
p
,
intf
)
...
...
@@ -368,18 +411,17 @@ def gen(res_name, look_path):
if
__name__
==
"__main__"
:
print
(
"-------------------------"
)
print
(
"Start Building your Resource"
)
print
(
"Draw by ghost "
)
print
(
"-------------------------"
)
parser
=
argparse
.
ArgumentParser
(
description
=
"Auto create Resource for ydl java project"
)
parser
.
add_argument
(
'--verbose'
,
'-v'
,
action
=
'store_true'
,
help
=
'debug mode'
)
parser
.
add_argument
(
"resource_name"
)
parser
.
add_argument
(
"project_path"
)
args
=
parser
.
parse_args
()
project_path
=
args
.
project_path
resource_name
=
args
.
resource_name
gen
(
resource_name
,
project_path
)
template/${PLACE}.java
View file @
3cb36c43
package
com
.
$
{
PACKAGE_LEVEL1
}.
$
{
PACKAGE_LEVEL
1
}.
intf
.
po
;
package
com
.
$
{
PACKAGE_LEVEL1
}.
$
{
PACKAGE_LEVEL
2
}.
intf
.
po
;
public
class
${
PLACE
}
{
...
...
template/${PLACE}BizImpl.java
View file @
3cb36c43
...
...
@@ -15,5 +15,8 @@ public class ${PLACE}BizImpl extends BaseService<${PLACE}> implements ${PLACE}Bi
@Resource
private
$
{
PLACE
}
Mapper
$
{
PLACE_VAR
}
Mapper
;
@Override
public
$
{
PLACE
}
create
$
{
PLACE
}(
$
{
PLACE
}
$
{
PLACE_VAR
})
{
return
null
;
}
}
template/${PLACE}Facade.java
View file @
3cb36c43
...
...
@@ -2,8 +2,8 @@
package
com
.
$
{
PACKAGE_LEVEL1
}.
$
{
PACKAGE_LEVEL2
}.
intf
.
facade
;
import
com.
$
{
PACKAGE_LEVEL1
}.
common
.
dto
.
BaseDtoResponse
;
import
com.
$
{
PACKAGE_LEVEL1
}.
$
{
PACKAGE_LEVEL2
}.
intf
.
dto
.
request
.{
PLACE
}
ReqDto
;
import
com.
$
{
PACKAGE_LEVEL1
}.
$
{
PACKAGE_LEVEL2
}.
intf
.
dto
.
response
.{
PLACE
}
RespDto
;
import
com.
$
{
PACKAGE_LEVEL1
}.
$
{
PACKAGE_LEVEL2
}.
intf
.
dto
.
request
.
$
{
PLACE
}
ReqDto
;
import
com.
$
{
PACKAGE_LEVEL1
}.
$
{
PACKAGE_LEVEL2
}.
intf
.
dto
.
response
.
$
{
PLACE
}
RespDto
;
public
interface
${
PLACE
}
Facade
{
BaseDtoResponse
<
$
{
PLACE
}
RespDto
>
create
$
{
PLACE
}(
$
{
PLACE
}
ReqDto
$
{
PLACE_VAR
}
ReqDto
);
...
...
template/${PLACE}FacadeImpl.java
View file @
3cb36c43
package
com
.
$
{
PACKAGE_LEVEL1
}.
$
{
PACKAGE_LEVEL2
}.
service
.
facade
;
import
com.
$
{
PACKAGE_LEVEL1
}.
common
.
dto
.
BaseDtoResponse
;
import
com.
$
{
PACKAGE_LEVEL1
}.
common
.
helper
.
ResponseFormatterHelper
;
import
com.
$
{
PACKAGE_LEVEL1
}.
common
.
utils
.
ModelMapperUtil
;
import
com.
$
{
PACKAGE_LEVEL1
}.
$
{
PACKAGE_LEVEL2
}.
intf
.
facade
.
$
{
PLACE
}
Facade
;
import
com.
$
{
PACKAGE_LEVEL1
}.
$
{
PACKAGE_LEVEL2
}.
service
.
biz
.
$
{
PLACE
}
Biz
;
import
com.ydl.common.dto.BaseDtoResponse
;
import
com.ydl.common.helper.ResponseFormatterHelper
;
import
com.ydl.common.utils.ModelMapperUtil
;
import
com.ydl.user.intf.dto.request.
$
{
PLACE
}
ReqDto
;
import
com.ydl.user.intf.dto.response.
$
{
PLACE
}
RespDto
;
import
com.ydl.user.intf.facade.
$
{
PLACE
}
Facade
;
import
com.ydl.user.service.biz.
$
{
PLACE
}
Biz
;
import
com.ydl.user.intf.po.
$
{
PLACE
};
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
...
...
@@ -20,9 +23,7 @@ public class ${PLACE}FacadeImpl implements ${PLACE}Facade {
public
BaseDtoResponse
<
$
{
PLACE
}
RespDto
>
create
$
{
PLACE
}(
$
{
PLACE
}
ReqDto
$
{
PLACE_VAR
}
ReqDto
)
{
$
{
PLACE
}
$
{
PLACE_VAR
}=
ModelMapperUtil
.
strictMap
(
$
{
PLACE_VAR
}
ReqDto
,
$
{
PLACE
}.
class
);
$
{
PLACE
}
$
{
PLACE_VAR
}
Stored
=
$
{
PLACE_VAR
}
Biz
.
create
$
{
PLACE
}(
$
{
PLACE_VAR
});
$
{
PLACE
}
RespDto
$
{
PLACE_VAR
}
RespDto
=
ModelMapperUtil
.
strictMap
(
$
{
PLACE_VAR
}
Stored
,
$
{
PLACE
}
RespDto
.
class
);
return
ResponseFormatterHelper
.
success
(
$
{
PLACE_VAR
}
RespDto
);
...
...
template/${PLACE}Mapper.xml
View file @
3cb36c43
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.
ydl.user
.service.dao.${PLACE}Mapper"
>
<mapper
namespace=
"com.
${PACKAGE_LEVEL1}.${PACKAGE_LEVEL2}
.service.dao.${PLACE}Mapper"
>
</mapper>
\ No newline at end of file
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