Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
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
fangxinjiang
yifu-mvp
Commits
a5a8f0d7
Commit
a5a8f0d7
authored
Jun 22, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码生成模板调整
parent
542b518f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
7 deletions
+18
-7
Controller.java.vm
...fu-codegen/src/main/resources/template/Controller.java.vm
+18
-7
No files found.
yifu-visual/yifu-codegen/src/main/resources/template/Controller.java.vm
View file @
a5a8f0d7
...
...
@@ -17,6 +17,7 @@
package
${
package
}.${
moduleName
}.
controller
;
import
com
.
baomidou
.
mybatisplus
.
core
.
metadata
.
IPage
;
import
com
.
baomidou
.
mybatisplus
.
core
.
toolkit
.
Wrappers
;
import
com
.
baomidou
.
mybatisplus
.
extension
.
plugins
.
pagination
.
Page
;
import
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
common
.
core
.
util
.
R
;
...
...
@@ -55,11 +56,21 @@ public class ${className}Controller {
*/
@
Operation
(
summary
=
"分页查询"
,
description
=
"分页查询"
)
@
GetMapping
(
"/page"
)
@
PreAuthorize
(
"@pms.hasPermission('${moduleName}_${pathName}_get')"
)
public
R
get
${
className
}
Page
(
Page
page
,
${
className
}
${
classname
})
{
//
@
PreAuthorize
(
"@pms.hasPermission('${moduleName}_${pathName}_get')"
)
public
R
<
IPage
<${
className
}>>
get
${
className
}
Page
(
Page
page
,
${
className
}
${
classname
})
{
return
R
.
ok
(${
classname
}
Service
.
page
(
page
,
Wrappers
.
query
(${
classname
})));
}
/**
*
不分页查询
*
@
param
${
classname
}
${
comments
}
*
@
return
*/
@
Operation
(
summary
=
"不分页查询"
,
description
=
"不分页查询"
)
@
GetMapping
(
"/noPage"
)
//@
PreAuthorize
(
"@pms.hasPermission('${moduleName}_${pathName}_get')"
)
public
R
<
List
<${
className
}>>
get
${
className
}
NoPage
(${
className
}
${
classname
})
{
return
R
.
ok
(${
classname
}
Service
.
list
(
Wrappers
.
query
(${
classname
})));
}
/**
*
通过
id
查询
${
comments
}
...
...
@@ -69,7 +80,7 @@ public class ${className}Controller {
@
Operation
(
summary
=
"通过id查询"
,
description
=
"通过id查询:hasPermission('${moduleName}_${pathName}_get')"
)
@
GetMapping
(
"/{${pk.lowerAttrName}}"
)
@
PreAuthorize
(
"@pms.hasPermission('${moduleName}_${pathName}_get')"
)
public
R
getById
(@
PathVariable
(
"${pk.lowerAttrName}"
)
${
pk
.
attrType
}
${
pk
.
lowerAttrName
})
{
public
R
<${
classname
}>
getById
(@
PathVariable
(
"${pk.lowerAttrName}"
)
${
pk
.
attrType
}
${
pk
.
lowerAttrName
})
{
return
R
.
ok
(${
classname
}
Service
.
getById
(${
pk
.
lowerAttrName
}));
}
...
...
@@ -82,7 +93,7 @@ public class ${className}Controller {
@
SysLog
(
"新增${comments}"
)
@
PostMapping
@
PreAuthorize
(
"@pms.hasPermission('${moduleName}_${pathName}_add')"
)
public
R
save
(@
RequestBody
${
className
}
${
classname
})
{
public
R
<
Boolean
>
save
(@
RequestBody
${
className
}
${
classname
})
{
return
R
.
ok
(${
classname
}
Service
.
save
(${
classname
}));
}
...
...
@@ -95,7 +106,7 @@ public class ${className}Controller {
@
SysLog
(
"修改${comments}"
)
@
PutMapping
@
PreAuthorize
(
"@pms.hasPermission('${moduleName}_${pathName}_edit')"
)
public
R
updateById
(@
RequestBody
${
className
}
${
classname
})
{
public
R
<
Boolean
>
updateById
(@
RequestBody
${
className
}
${
classname
})
{
return
R
.
ok
(${
classname
}
Service
.
updateById
(${
classname
}));
}
...
...
@@ -108,7 +119,7 @@ public class ${className}Controller {
@
SysLog
(
"通过id删除${comments}"
)
@
DeleteMapping
(
"/{${pk.lowerAttrName}}"
)
@
PreAuthorize
(
"@pms.hasPermission('${moduleName}_${pathName}_del')"
)
public
R
removeById
(@
PathVariable
${
pk
.
attrType
}
${
pk
.
lowerAttrName
})
{
public
R
<
Boolean
>
removeById
(@
PathVariable
${
pk
.
attrType
}
${
pk
.
lowerAttrName
})
{
return
R
.
ok
(${
classname
}
Service
.
removeById
(${
pk
.
lowerAttrName
}));
}
...
...
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