|
|
@@ -61,9 +61,9 @@ public class ${ClassName}Controller {
|
|
|
@Operation(summary = "分页查询" , description = "分页查询" )
|
|
|
@GetMapping("/page" )
|
|
|
#if($isSpringBoot3)
|
|
|
- @HasPermission("${moduleName}_${functionName}_view")
|
|
|
+ @HasPermission("$str.toLowerCase(${moduleName}_${functionName}_view)")
|
|
|
#else
|
|
|
- @PreAuthorize("@pms.hasPermission('${moduleName}_${functionName}_view')" )
|
|
|
+ @PreAuthorize("@pms.hasPermission('$str.toLowerCase(${moduleName}_${functionName}_view)')" )
|
|
|
#end
|
|
|
public R get${ClassName}Page(@ParameterObject Page page, @ParameterObject ${ClassName}Entity ${className}) {
|
|
|
LambdaQueryWrapper<${ClassName}Entity> wrapper = Wrappers.lambdaQuery();
|
|
|
@@ -111,9 +111,9 @@ public class ${ClassName}Controller {
|
|
|
@Operation(summary = "通过条件查询" , description = "通过条件查询对象" )
|
|
|
@GetMapping("/details" )
|
|
|
#if($isSpringBoot3)
|
|
|
- @HasPermission("${moduleName}_${functionName}_view")
|
|
|
+ @HasPermission("$str.toLowerCase(${moduleName}_${functionName}_view)")
|
|
|
#else
|
|
|
- @PreAuthorize("@pms.hasPermission('${moduleName}_${functionName}_view')" )
|
|
|
+ @PreAuthorize("@pms.hasPermission('$str.toLowerCase(${moduleName}_${functionName}_view)')" )
|
|
|
#end
|
|
|
public R getDetails(@ParameterObject ${ClassName}Entity ${className}) {
|
|
|
return R.ok(${className}Service.listDeep(Wrappers.query(${className})));
|
|
|
@@ -128,9 +128,9 @@ public class ${ClassName}Controller {
|
|
|
@SysLog("新增${tableComment}" )
|
|
|
@PostMapping
|
|
|
#if($isSpringBoot3)
|
|
|
- @HasPermission("${moduleName}_${functionName}_add")
|
|
|
+ @HasPermission("$str.toLowerCase(${moduleName}_${functionName}_add)")
|
|
|
#else
|
|
|
- @PreAuthorize("@pms.hasPermission('${moduleName}_${functionName}_add')" )
|
|
|
+ @PreAuthorize("@pms.hasPermission('$str.toLowerCase(${moduleName}_${functionName}_add)')" )
|
|
|
#end
|
|
|
public R save(@RequestBody ${ClassName}Entity ${className}) {
|
|
|
return R.ok(${className}Service.saveDeep(${className}));
|
|
|
@@ -145,9 +145,9 @@ public class ${ClassName}Controller {
|
|
|
@SysLog("修改${tableComment}" )
|
|
|
@PutMapping
|
|
|
#if($isSpringBoot3)
|
|
|
- @HasPermission("${moduleName}_${functionName}_edit")
|
|
|
+ @HasPermission("$str.toLowerCase(${moduleName}_${functionName}_edit)")
|
|
|
#else
|
|
|
- @PreAuthorize("@pms.hasPermission('${moduleName}_${functionName}_edit')" )
|
|
|
+ @PreAuthorize("@pms.hasPermission('$str.toLowerCase(${moduleName}_${functionName}_edit)')" )
|
|
|
#end
|
|
|
public R updateById(@RequestBody ${ClassName}Entity ${className}) {
|
|
|
return R.ok(${className}Service.updateDeep(${className}));
|
|
|
@@ -162,9 +162,9 @@ public class ${ClassName}Controller {
|
|
|
@SysLog("通过id删除${tableComment}" )
|
|
|
@DeleteMapping
|
|
|
#if($isSpringBoot3)
|
|
|
- @HasPermission("${moduleName}_${functionName}_del")
|
|
|
+ @HasPermission("$str.toLowerCase(${moduleName}_${functionName}_del)")
|
|
|
#else
|
|
|
- @PreAuthorize("@pms.hasPermission('${moduleName}_${functionName}_del')" )
|
|
|
+ @PreAuthorize("@pms.hasPermission('$str.toLowerCase(${moduleName}_${functionName}_del)')" )
|
|
|
#end
|
|
|
public R removeById(@RequestBody ${pk.attrType}[] ids) {
|
|
|
return R.ok(${className}Service.removeDeep(ids));
|
|
|
@@ -179,9 +179,9 @@ public class ${ClassName}Controller {
|
|
|
@SysLog("通过id删除${tableComment}子表数据" )
|
|
|
@DeleteMapping("/child")
|
|
|
#if($isSpringBoot3)
|
|
|
- @HasPermission("${moduleName}_${functionName}_del")
|
|
|
+ @HasPermission("$str.toLowerCase(${moduleName}_${functionName}_del)")
|
|
|
#else
|
|
|
- @PreAuthorize("@pms.hasPermission('${moduleName}_${functionName}_del')" )
|
|
|
+ @PreAuthorize("@pms.hasPermission('$str.toLowerCase(${moduleName}_${functionName}_del)')" )
|
|
|
#end
|
|
|
public R removeChild(@RequestBody ${pk.attrType}[] ids) {
|
|
|
return R.ok(${className}Service.removeChild(ids));
|
|
|
@@ -196,9 +196,9 @@ public class ${ClassName}Controller {
|
|
|
@ResponseExcel
|
|
|
@GetMapping("/export")
|
|
|
#if($isSpringBoot3)
|
|
|
- @HasPermission("${moduleName}_${functionName}_export")
|
|
|
+ @HasPermission("$str.toLowerCase(${moduleName}_${functionName}_export)")
|
|
|
#else
|
|
|
- @PreAuthorize("@pms.hasPermission('${moduleName}_${functionName}_export')" )
|
|
|
+ @PreAuthorize("@pms.hasPermission('$str.toLowerCase(${moduleName}_${functionName}_export)')" )
|
|
|
#end
|
|
|
public List<${ClassName}Entity> exportExcel(${ClassName}Entity ${className},${pk.attrType}[] ids) {
|
|
|
return ${className}Service.list(Wrappers.lambdaQuery(${className}).in(ArrayUtil.isNotEmpty(ids), ${ClassName}Entity::$str.getProperty($pk.attrName), ids));
|
|
|
@@ -212,9 +212,9 @@ public class ${ClassName}Controller {
|
|
|
*/
|
|
|
@PostMapping("/import")
|
|
|
#if($isSpringBoot3)
|
|
|
- @HasPermission("${moduleName}_${functionName}_export")
|
|
|
+ @HasPermission("$str.toLowerCase(${moduleName}_${functionName}_export)")
|
|
|
#else
|
|
|
- @PreAuthorize("@pms.hasPermission('${moduleName}_${functionName}_export')" )
|
|
|
+ @PreAuthorize("@pms.hasPermission('$str.toLowerCase(${moduleName}_${functionName}_export)')" )
|
|
|
#end
|
|
|
public R importExcel(@RequestExcel List<${ClassName}Entity> ${className}List, BindingResult bindingResult) {
|
|
|
return R.ok(${className}Service.saveBatch(${className}List));
|