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) => {
...
@@ -139,6 +139,7 @@ const run = async (gulp, nunjucksRender, rename, nunjucksRenderConfig) => {
//编译controller.common
//编译controller.common
for
(
let
commonController
in
config
.
controllers
.
common
)
{
for
(
let
commonController
in
config
.
controllers
.
common
)
{
const
controller
=
config
.
controllers
.
common
[
commonController
]
await
gulp
await
gulp
.
src
(
`
${
serverTemplatePath
}
/controller.njk`
)
.
src
(
`
${
serverTemplatePath
}
/controller.njk`
)
.
pipe
(
.
pipe
(
...
@@ -146,14 +147,14 @@ const run = async (gulp, nunjucksRender, rename, nunjucksRenderConfig) => {
...
@@ -146,14 +147,14 @@ const run = async (gulp, nunjucksRender, rename, nunjucksRenderConfig) => {
...
nunjucksRenderConfig
,
...
nunjucksRenderConfig
,
data
:
{
data
:
{
name
:
commonController
,
name
:
commonController
,
model
:
con
fig
.
controllers
.
common
[
commonController
]
,
model
:
con
troller
,
...
controllerImport
(
con
fig
.
controllers
.
common
[
commonController
]
),
...
controllerImport
(
con
troller
),
commmonDecorators
:
getDecorators
(
con
fig
.
controllers
.
common
[
commonController
]
,
'common'
),
commmonDecorators
:
getDecorators
(
con
troller
,
'common'
),
customDecorators
:
getDecorators
(
con
fig
.
controllers
.
common
[
commonController
]
,
'custom'
),
customDecorators
:
getDecorators
(
con
troller
,
'custom'
),
commonPreChecks
:
getPreChecks
(
con
fig
.
controllers
.
common
[
commonController
]
,
'common'
),
commonPreChecks
:
getPreChecks
(
con
troller
,
'common'
),
customPreChecks
:
getPreChecks
(
con
fig
.
controllers
.
common
[
commonController
]
,
'custom'
),
customPreChecks
:
getPreChecks
(
con
troller
,
'custom'
),
commonPreUpdates
:
getPreUpdates
(
con
fig
.
controllers
.
common
[
commonController
]
,
'common'
),
commonPreUpdates
:
getPreUpdates
(
con
troller
,
'common'
),
customPreUpdates
:
getPreUpdates
(
con
fig
.
controllers
.
common
[
commonController
]
,
'custom'
)
customPreUpdates
:
getPreUpdates
(
con
troller
,
'custom'
)
}
}
})
})
)
)
...
@@ -162,6 +163,7 @@ const run = async (gulp, nunjucksRender, rename, nunjucksRenderConfig) => {
...
@@ -162,6 +163,7 @@ const run = async (gulp, nunjucksRender, rename, nunjucksRenderConfig) => {
}
}
//编译controller.custom
//编译controller.custom
for
(
let
customController
in
config
.
controllers
.
custom
)
{
for
(
let
customController
in
config
.
controllers
.
custom
)
{
const
controller
=
config
.
controllers
.
custom
[
customController
]
await
gulp
await
gulp
.
src
(
`
${
serverTemplatePath
}
/controller.njk`
)
.
src
(
`
${
serverTemplatePath
}
/controller.njk`
)
.
pipe
(
.
pipe
(
...
@@ -169,14 +171,14 @@ const run = async (gulp, nunjucksRender, rename, nunjucksRenderConfig) => {
...
@@ -169,14 +171,14 @@ const run = async (gulp, nunjucksRender, rename, nunjucksRenderConfig) => {
...
nunjucksRenderConfig
,
...
nunjucksRenderConfig
,
data
:
{
data
:
{
name
:
customController
,
name
:
customController
,
model
:
con
fig
.
controllers
.
custom
[
customController
]
,
model
:
con
troller
,
...
controllerImport
(
con
fig
.
controllers
.
custom
[
customController
]
),
...
controllerImport
(
con
troller
),
commmonDecorators
:
getDecorators
(
con
fig
.
controllers
.
custom
[
customController
]
,
'common'
),
commmonDecorators
:
getDecorators
(
con
troller
,
'common'
),
customDecorators
:
getDecorators
(
con
fig
.
controllers
.
custom
[
customController
]
,
'custom'
),
customDecorators
:
getDecorators
(
con
troller
,
'custom'
),
commonPreChecks
:
getPreChecks
(
con
fig
.
controllers
.
custom
[
customController
]
,
'common'
),
commonPreChecks
:
getPreChecks
(
con
troller
,
'common'
),
customPreChecks
:
getPreChecks
(
con
fig
.
controllers
.
custom
[
customController
]
,
'custom'
),
customPreChecks
:
getPreChecks
(
con
troller
,
'custom'
),
commonPreUpdates
:
getPreUpdates
(
con
fig
.
controllers
.
custom
[
customController
]
,
'common'
),
commonPreUpdates
:
getPreUpdates
(
con
troller
,
'common'
),
customPreUpdates
:
getPreUpdates
(
con
fig
.
controllers
.
custom
[
customController
]
,
'custom'
)
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