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