Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taobao-mini-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
qinhaitao
taobao-mini-template
Commits
e1c91c2d
Commit
e1c91c2d
authored
Nov 12, 2020
by
qinhaitao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf:
⚡
️ 优化结构
parent
ff6eea1d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
16 deletions
+18
-16
generate.js
v2.0/compileServer/generate.js
+18
-16
No files found.
v2.0/compileServer/generate.js
View file @
e1c91c2d
...
...
@@ -139,6 +139,7 @@ const run = async (gulp, nunjucksRender, rename, nunjucksRenderConfig) => {
//编译controller.common
for
(
let
commonController
in
config
.
controllers
.
common
)
{
const
controller
=
config
.
controllers
.
common
[
commonController
]
await
gulp
.
src
(
`
${
serverTemplatePath
}
/controller.njk`
)
.
pipe
(
...
...
@@ -146,14 +147,14 @@ const run = async (gulp, nunjucksRender, rename, nunjucksRenderConfig) => {
...
nunjucksRenderConfig
,
data
:
{
name
:
commonController
,
model
:
con
fig
.
controllers
.
common
[
commonController
]
,
...
controllerImport
(
con
fig
.
controllers
.
common
[
commonController
]
),
commmonDecorators
:
getDecorators
(
con
fig
.
controllers
.
common
[
commonController
]
,
'common'
),
customDecorators
:
getDecorators
(
con
fig
.
controllers
.
common
[
commonController
]
,
'custom'
),
commonPreChecks
:
getPreChecks
(
con
fig
.
controllers
.
common
[
commonController
]
,
'common'
),
customPreChecks
:
getPreChecks
(
con
fig
.
controllers
.
common
[
commonController
]
,
'custom'
),
commonPreUpdates
:
getPreUpdates
(
con
fig
.
controllers
.
common
[
commonController
]
,
'common'
),
customPreUpdates
:
getPreUpdates
(
con
fig
.
controllers
.
common
[
commonController
]
,
'custom'
)
model
:
con
troller
,
...
controllerImport
(
con
troller
),
commmonDecorators
:
getDecorators
(
con
troller
,
'common'
),
customDecorators
:
getDecorators
(
con
troller
,
'custom'
),
commonPreChecks
:
getPreChecks
(
con
troller
,
'common'
),
customPreChecks
:
getPreChecks
(
con
troller
,
'custom'
),
commonPreUpdates
:
getPreUpdates
(
con
troller
,
'common'
),
customPreUpdates
:
getPreUpdates
(
con
troller
,
'custom'
)
}
})
)
...
...
@@ -162,6 +163,7 @@ const run = async (gulp, nunjucksRender, rename, nunjucksRenderConfig) => {
}
//编译controller.custom
for
(
let
customController
in
config
.
controllers
.
custom
)
{
const
controller
=
config
.
controllers
.
custom
[
customController
]
await
gulp
.
src
(
`
${
serverTemplatePath
}
/controller.njk`
)
.
pipe
(
...
...
@@ -169,14 +171,14 @@ const run = async (gulp, nunjucksRender, rename, nunjucksRenderConfig) => {
...
nunjucksRenderConfig
,
data
:
{
name
:
customController
,
model
:
con
fig
.
controllers
.
custom
[
customController
]
,
...
controllerImport
(
con
fig
.
controllers
.
custom
[
customController
]
),
commmonDecorators
:
getDecorators
(
con
fig
.
controllers
.
custom
[
customController
]
,
'common'
),
customDecorators
:
getDecorators
(
con
fig
.
controllers
.
custom
[
customController
]
,
'custom'
),
commonPreChecks
:
getPreChecks
(
con
fig
.
controllers
.
custom
[
customController
]
,
'common'
),
customPreChecks
:
getPreChecks
(
con
fig
.
controllers
.
custom
[
customController
]
,
'custom'
),
commonPreUpdates
:
getPreUpdates
(
con
fig
.
controllers
.
custom
[
customController
]
,
'common'
),
customPreUpdates
:
getPreUpdates
(
con
fig
.
controllers
.
custom
[
customController
]
,
'custom'
)
model
:
con
troller
,
...
controllerImport
(
con
troller
),
commmonDecorators
:
getDecorators
(
con
troller
,
'common'
),
customDecorators
:
getDecorators
(
con
troller
,
'custom'
),
commonPreChecks
:
getPreChecks
(
con
troller
,
'common'
),
customPreChecks
:
getPreChecks
(
con
troller
,
'custom'
),
commonPreUpdates
:
getPreUpdates
(
con
troller
,
'common'
),
customPreUpdates
:
getPreUpdates
(
con
troller
,
'custom'
)
}
})
)
...
...
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