chore: 统一代码生成模板权限标识为 list/create/update/delete
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -7,7 +7,7 @@
|
||||
<groupId>com.youlai</groupId>
|
||||
<artifactId>youlai-boot</artifactId>
|
||||
<version>4.0.0</version>
|
||||
<description>基于 Java 17 + SpringBoot 3 + Spring Security 构建的权限管理系统。</description>
|
||||
<description>基于 Java 17 + SpringBoot 4 + Spring Security 构建的权限管理系统。</description>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
||||
@@ -34,7 +34,7 @@ public class ${entityName}Controller {
|
||||
|
||||
@Operation(summary = "$!{businessName}分页列表")
|
||||
@GetMapping
|
||||
@PreAuthorize("@ss.hasPerm('${moduleName}:${entityKebab}:query')")
|
||||
@PreAuthorize("@ss.hasPerm('${moduleName}:${entityKebab}:list')")
|
||||
public PageResult<${entityName}Vo> get${entityName}Page(${entityName}Query queryParams ) {
|
||||
IPage<${entityName}Vo> result = ${entityLowerCamel}Service.get${entityName}Page(queryParams);
|
||||
return PageResult.success(result);
|
||||
@@ -42,7 +42,7 @@ public class ${entityName}Controller {
|
||||
|
||||
@Operation(summary = "新增${businessName}")
|
||||
@PostMapping
|
||||
@PreAuthorize("@ss.hasPerm('${moduleName}:${entityKebab}:add')")
|
||||
@PreAuthorize("@ss.hasPerm('${moduleName}:${entityKebab}:create')")
|
||||
public Result<Void> save${entityName}(@RequestBody @Valid ${entityName}Form formData ) {
|
||||
boolean result = ${entityLowerCamel}Service.save${entityName}(formData);
|
||||
return Result.judge(result);
|
||||
@@ -50,7 +50,7 @@ public class ${entityName}Controller {
|
||||
|
||||
@Operation(summary = "获取${businessName}表单数据")
|
||||
@GetMapping("/{id}/form")
|
||||
@PreAuthorize("@ss.hasPerm('${moduleName}:${entityKebab}:edit')")
|
||||
@PreAuthorize("@ss.hasPerm('${moduleName}:${entityKebab}:update')")
|
||||
public Result<${entityName}Form> get${entityName}Form(
|
||||
@Parameter(description = "$!{businessName}ID") @PathVariable Long id
|
||||
) {
|
||||
@@ -60,7 +60,7 @@ public class ${entityName}Controller {
|
||||
|
||||
@Operation(summary = "修改${businessName}")
|
||||
@PutMapping(value = "/{id}")
|
||||
@PreAuthorize("@ss.hasPerm('${moduleName}:${entityKebab}:edit')")
|
||||
@PreAuthorize("@ss.hasPerm('${moduleName}:${entityKebab}:update')")
|
||||
public Result<Void> update${entityName}(
|
||||
@Parameter(description = "$!{businessName}ID") @PathVariable Long id,
|
||||
@RequestBody @Validated ${entityName}Form formData
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
<el-card shadow="never">
|
||||
<div class="mb-10px">
|
||||
<el-button
|
||||
v-hasPerm="['${moduleName}:${entityKebab}:add']"
|
||||
v-hasPerm="['${moduleName}:${entityKebab}:create']"
|
||||
type="success"
|
||||
icon="plus"
|
||||
@click="handleOpenDialog()"
|
||||
@@ -143,7 +143,7 @@
|
||||
<el-table-column fixed="right" label="操作" width="220">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
v-hasPerm="['${moduleName}:${entityKebab}:edit']"
|
||||
v-hasPerm="['${moduleName}:${entityKebab}:update']"
|
||||
type="primary"
|
||||
size="small"
|
||||
link
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
<el-card shadow="never">
|
||||
<div class="mb-10px">
|
||||
<el-button
|
||||
v-hasPerm="['${moduleName}:${entityKebab}:add']"
|
||||
v-hasPerm="['${moduleName}:${entityKebab}:create']"
|
||||
type="success"
|
||||
icon="plus"
|
||||
@click="handleOpenDialog()"
|
||||
@@ -143,7 +143,7 @@
|
||||
<el-table-column fixed="right" label="操作" width="220">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
v-hasPerm="['${moduleName}:${entityKebab}:edit']"
|
||||
v-hasPerm="['${moduleName}:${entityKebab}:update']"
|
||||
type="primary"
|
||||
size="small"
|
||||
link
|
||||
|
||||
Reference in New Issue
Block a user