💬 修改生成文本和校验错误信息
This commit is contained in:
parent
245771e311
commit
66466df713
|
@ -7,9 +7,9 @@ import lombok.NoArgsConstructor;
|
|||
import lombok.ToString;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@NoArgsConstructor
|
||||
@Getter
|
||||
@ToString
|
||||
@NoArgsConstructor
|
||||
@Slf4j
|
||||
public class AuthenticSecurityException extends RuntimeException {
|
||||
// 状态码
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
package com.auth.common.exception;
|
||||
|
||||
import com.auth.common.model.common.result.ResultCodeEnum;
|
||||
import lombok.Getter;
|
||||
import lombok.ToString;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
|
||||
/**
|
||||
* 自定义未认证异常
|
||||
*/
|
||||
@Getter
|
||||
@ToString
|
||||
@Slf4j
|
||||
public class AuthenticationFailException extends AuthenticationException {
|
||||
// 状态码
|
||||
Integer code;
|
||||
|
||||
// 描述信息
|
||||
String message = "服务异常";
|
||||
|
||||
// 返回结果状态
|
||||
ResultCodeEnum resultCodeEnum;
|
||||
|
||||
/**
|
||||
* Constructs an {@code AuthenticationException} with the specified message and root
|
||||
* cause.
|
||||
*
|
||||
* @param msg the detail message
|
||||
* @param cause the root cause
|
||||
*/
|
||||
public AuthenticationFailException(String msg, Throwable cause) {
|
||||
super(msg, cause);
|
||||
}
|
||||
|
||||
public AuthenticationFailException(ResultCodeEnum codeEnum) {
|
||||
super(codeEnum.getMessage());
|
||||
this.code = codeEnum.getCode();
|
||||
this.message = codeEnum.getMessage();
|
||||
this.resultCodeEnum = codeEnum;
|
||||
}
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
package com.auth.common.exception;
|
||||
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
|
||||
/**
|
||||
* 自定义未认证异常
|
||||
*/
|
||||
public class MyAuthenticationException extends AuthenticationException {
|
||||
/**
|
||||
* Constructs an {@code AuthenticationException} with the specified message and root
|
||||
* cause.
|
||||
*
|
||||
* @param msg the detail message
|
||||
* @param cause the root cause
|
||||
*/
|
||||
public MyAuthenticationException(String msg, Throwable cause) {
|
||||
super(msg, cause);
|
||||
}
|
||||
}
|
|
@ -75,7 +75,7 @@ public enum ResultCodeEnum {
|
|||
|
||||
// 系统错误 500
|
||||
UNKNOWN_EXCEPTION(500, "服务异常"),
|
||||
SERVICE_ERROR(500, "服务异常"),
|
||||
AUTHENTICATION_FAILED(500, "身份验证失败"),
|
||||
UPLOAD_ERROR(500, "上传失败"),
|
||||
FAIL(500, "失败"),
|
||||
;
|
||||
|
|
|
@ -77,6 +77,9 @@ public class VmsTBaseTemplateGenerator extends AbstractTemplateGenerator {
|
|||
// 设置包名称
|
||||
context.put("package", dto.getPackageName());
|
||||
|
||||
// 前端基础生成路径
|
||||
context.put("webBasePath", dto.getWebBasePath());
|
||||
|
||||
// 将类名称转成小驼峰
|
||||
String lowerCamelCase = CamelCaseNameConvertUtil.convertToCamelCase(cleanTableName, false);
|
||||
context.put("classLowercaseName", lowerCamelCase);
|
||||
|
|
|
@ -30,6 +30,9 @@ public class VmsArgumentDto {
|
|||
@Schema(name = "tablePrefixes", description = "去除表前缀")
|
||||
private String tablePrefixes = "";
|
||||
|
||||
@Schema(name = "webBasePath", description = "前端基础生成路径")
|
||||
private String webBasePath;
|
||||
|
||||
@Schema(name = "path", description = "路径")
|
||||
@NotEmpty(message = "表名称不能为空")
|
||||
private List<String> path;
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
package com.auth.module.generator.service.helper;
|
||||
|
||||
import com.auth.module.generator.model.dto.VmsArgumentDto;
|
||||
import com.auth.module.generator.utils.CamelCaseNameConvertUtil;
|
||||
import com.google.common.base.CaseFormat;
|
||||
import org.apache.velocity.shaded.commons.io.FilenameUtils;
|
||||
|
||||
import java.nio.file.Paths;
|
||||
|
||||
/**
|
||||
* 代码生成工具类
|
||||
|
@ -13,23 +17,31 @@ public class VmsGeneratorPathHelper {
|
|||
*
|
||||
* @param path 原始模板路径
|
||||
* @param tableName 数据库表名
|
||||
* @param dto 生成代码请求参数
|
||||
* @return 处理后的文件路径
|
||||
*/
|
||||
public static String processVmPath(String path, String tableName) {
|
||||
public static String processVmPath(String path, String tableName, VmsArgumentDto dto) {
|
||||
String lowerCamelCase = CamelCaseNameConvertUtil.convertToCamelCase(tableName, false);
|
||||
String webBasePath = dto.getWebBasePath();
|
||||
|
||||
if (lowerCamelCase != null) {
|
||||
String[] pathParts = path.replace("$className", lowerCamelCase).split("/");
|
||||
// 处理文件名
|
||||
pathParts[pathParts.length - 1] = processFilename(
|
||||
pathParts[pathParts.length - 1],
|
||||
lowerCamelCase
|
||||
);
|
||||
|
||||
return String.join("/", pathParts);
|
||||
if (lowerCamelCase != null && path.contains("$className")) {
|
||||
// 💡 替换文件中的 特殊名称
|
||||
path = path.replace("$className", lowerCamelCase);
|
||||
}
|
||||
|
||||
return path;
|
||||
if (webBasePath != null && path.contains("$webBasePath")) {
|
||||
webBasePath = webBasePath.replace("/", "");
|
||||
// 💡 替换文件中的 特殊名称
|
||||
path = path.replace("$webBasePath", webBasePath);
|
||||
}
|
||||
|
||||
// 获取当前路径的文件名
|
||||
String filename = Paths.get(path).getFileName().toString();
|
||||
|
||||
// 处理文件名
|
||||
String processedFilename = processFilename(filename, tableName);
|
||||
|
||||
return path.replace(filename, processedFilename);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,9 +49,8 @@ public class VmsGeneratorPathHelper {
|
|||
*/
|
||||
private static String processFilename(String filename, String tableName) {
|
||||
filename = filename.replace(".vm", "");
|
||||
String[] parts = filename.split("\\.");
|
||||
String baseName = parts[0];
|
||||
String extension = parts.length > 1 ? parts[1] : "";
|
||||
String baseName = FilenameUtils.getBaseName(filename);
|
||||
String extension = FilenameUtils.getExtension(filename);
|
||||
|
||||
String upperCamelCase = CamelCaseNameConvertUtil.convertToCamelCase(tableName, true);
|
||||
String lowerCamelCase = CamelCaseNameConvertUtil.convertToCamelCase(tableName, false);
|
||||
|
|
|
@ -154,7 +154,7 @@ public class GeneratorServiceImpl implements GeneratorService {
|
|||
|
||||
// 生成好的模板
|
||||
String code = generator.generateCode(tableMeta, columns).toString();
|
||||
String processVmPath = VmsGeneratorPathHelper.processVmPath(path, tableMeta.getCleanTableName());
|
||||
String processVmPath = VmsGeneratorPathHelper.processVmPath(path, tableMeta.getCleanTableName(), dto);
|
||||
|
||||
return GeneratorVo.builder()
|
||||
.id(UUID.randomUUID().toString())
|
||||
|
|
|
@ -61,6 +61,10 @@ const DatabaseForm = {
|
|||
<div class="invalid-feedback">
|
||||
{{ errors.tablePrefixes || '请输入去除开头前缀' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4 mb-3 has-validation">
|
||||
<label class="form-label fw-medium" for="webBasePath">前端基础生成路径</label>
|
||||
<input class="form-control border-secondary" id="webBasePath" placeholder="格式:/system" v-model="form.webBasePath" type="text">
|
||||
</div>
|
||||
|
||||
<!-- 已选择的表 -->
|
||||
|
|
|
@ -100,6 +100,8 @@
|
|||
simpleDateFormat: "yyyy-MM-dd HH:mm:ss",
|
||||
// 去除开头前缀
|
||||
tablePrefixes: "t_,sys_,qrtz_,log_",
|
||||
// 前端基础生成路径
|
||||
webBasePath: "/system",
|
||||
// 生成代码路径
|
||||
path: [],
|
||||
}),
|
||||
|
|
|
@ -34,6 +34,7 @@ public class ${classUppercaseName}Controller {
|
|||
|
||||
private final ${classUppercaseName}Service ${classLowercaseName}Service;
|
||||
|
||||
@PreAuthorize("auth.decide('${classLowercaseName}:query')")
|
||||
@Operation(summary = "分页查询${comment}", description = "分页查询${comment}")
|
||||
@GetMapping()
|
||||
public Result<PageResult<${classUppercaseName}Vo>> get${classUppercaseName}Page(${classUppercaseName}Dto dto) {
|
||||
|
@ -42,6 +43,7 @@ public class ${classUppercaseName}Controller {
|
|||
return Result.success(pageResult);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('${classLowercaseName}:query')")
|
||||
@Operation(summary = "根据id查询${comment}详情", description = "根据id查询${comment}详情")
|
||||
@GetMapping("{id}")
|
||||
public Result<${classUppercaseName}Vo> getById(@PathVariable("id") Long id) {
|
||||
|
@ -50,6 +52,7 @@ public class ${classUppercaseName}Controller {
|
|||
return Result.success(${classLowercaseName}Vo);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('${classLowercaseName}:create')")
|
||||
@Operation(summary = "添加${comment}", description = "添加${comment}")
|
||||
@PostMapping()
|
||||
public Result<String> create(@Valid @RequestBody ${classUppercaseName}Dto dto) {
|
||||
|
@ -57,6 +60,7 @@ public class ${classUppercaseName}Controller {
|
|||
return Result.success(ResultCodeEnum.ADD_SUCCESS);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('${classLowercaseName}:update')")
|
||||
@Operation(summary = "更新${comment}", description = "更新${comment}")
|
||||
@PutMapping()
|
||||
public Result<String> update(@Valid @RequestBody ${classUppercaseName}Dto dto) {
|
||||
|
@ -64,6 +68,7 @@ public class ${classUppercaseName}Controller {
|
|||
return Result.success(ResultCodeEnum.UPDATE_SUCCESS);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('${classLowercaseName}:delete')")
|
||||
@Operation(summary = "删除${comment}", description = "删除${comment}")
|
||||
@DeleteMapping()
|
||||
public Result<String> batchDelete(@RequestBody List<Long> ids) {
|
||||
|
|
|
@ -1,28 +1,28 @@
|
|||
import type { ResultPage, Result } from "@/types/base";
|
||||
import type { ${classUppercaseName}ListItem } from "@/types/${classLowercaseName}/${classLowercaseName}DataType.ts";
|
||||
import type { ${classUppercaseName}ListItem } from "@/types${webBasePath}/${classLowercaseName}/${classLowercaseName}DataType.ts";
|
||||
import { http } from "@/utils/http";
|
||||
|
||||
/** ${comment}---获取${comment}列表 */
|
||||
export const query${classUppercaseName}Page = (params: any) => {
|
||||
return http.request<ResultPage<${classUppercaseName}ListItem>>('get', `${classLowercaseName}`, {params});
|
||||
return http.request<ResultPage<${classUppercaseName}ListItem>>('get', `${requestMapping}/${classLowercaseName}`, {params});
|
||||
};
|
||||
|
||||
/** 部门表---获取${comment}详情 */
|
||||
export const get${classUppercaseName}Detail = (params: any) => {
|
||||
return http.request<Result<${classUppercaseName}ListItem>>("get", `${classLowercaseName}/${params.id}`);
|
||||
return http.request<Result<${classUppercaseName}ListItem>>("get", `${requestMapping}/${classLowercaseName}/${params.id}`);
|
||||
};
|
||||
|
||||
/** ${comment}---添加${comment} */
|
||||
export const create${classUppercaseName} = (data: any) => {
|
||||
return http.request<Result<string>>('post', '${classLowercaseName}', {data});
|
||||
return http.request<Result<string>>('post', '${requestMapping}/${classLowercaseName}', {data});
|
||||
};
|
||||
|
||||
/** ${comment}---更新${comment} */
|
||||
export const update${classUppercaseName}ById = (data: any) => {
|
||||
return http.request<Result<string>>('put', '${classLowercaseName}', {data});
|
||||
return http.request<Result<string>>('put', '${requestMapping}/${classLowercaseName}', {data});
|
||||
};
|
||||
|
||||
/** ${comment}---删除${comment} */
|
||||
export const batchDelete${classUppercaseName} = (data: any) => {
|
||||
return http.request<Result<string>>('delete', '${classLowercaseName}', {data});
|
||||
return http.request<Result<string>>('delete', '${requestMapping}/${classLowercaseName}', {data});
|
||||
};
|
|
@ -1,5 +1,5 @@
|
|||
import {defineStore} from 'pinia';
|
||||
import {query${classUppercaseName}Page,get${classUppercaseName}Detail, create${classUppercaseName}, update${classUppercaseName}ById,batchDelete${classUppercaseName}} from '@/api/${classLowercaseName}';
|
||||
import {query${classUppercaseName}Page,get${classUppercaseName}Detail, create${classUppercaseName}, update${classUppercaseName}ById,batchDelete${classUppercaseName}} from '@/api${webBasePath}/${classLowercaseName}';
|
||||
import {storeMessage} from '@/utils/message';
|
||||
import { storePagination } from "@/utils/pageResultUtil";
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
<script lang="ts" setup>
|
||||
import {ref} from 'vue';
|
||||
import {FormInstance} from 'element-plus';
|
||||
import { ${classUppercaseName}Info } from '@/types/${classLowercaseName}/${classLowercaseName}DataType.ts';
|
||||
import { ${classUppercaseName}Info } from '@/types${webBasePath}/${classLowercaseName}/${classLowercaseName}DataType';
|
||||
import { rules } from '../utils/${classLowercaseName}-columns';
|
||||
import {FormInline} from './utils/hook';
|
||||
import {FormInline} from '../utils/hook';
|
||||
|
||||
const props = withDefaults(defineProps<FormInline>(), {
|
||||
formInline: () => ({
|
||||
|
|
|
@ -9,7 +9,8 @@ import AddFill from '~icons/ri/add-circle-line';
|
|||
import { selectUserinfo } from '@/components/RePureTableBar/Userinfo/columns';
|
||||
import { deleteIds, onSearch, onDeleteBatch, onAdd, onDelete, onUpdate,FormInline } from './utils/hook';
|
||||
import { columns } from './utils/${classLowercaseName}-columns';
|
||||
import { use${classUppercaseName}Store } from '@/store/modules/${classLowercaseName}';
|
||||
import { use${classUppercaseName}Store } from '@/store/modules${webBasePath}/${classLowercaseName}';
|
||||
import { PureTableBar } from '@/components/RePureTableBar/index';
|
||||
|
||||
const tableRef = ref();
|
||||
const formRef = ref();
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import { addDialog } from '@/components/ReDialog/index';
|
||||
import {h, ref} from 'vue';
|
||||
import {message, messageBox} from '@/utils/message';
|
||||
import DeleteBatchDialog from "@/components/Table/DeleteBatchDialog.vue";
|
||||
import { use${classUppercaseName}Store } from '@/store/modules/${classLowercaseName}';
|
||||
import DeleteBatchDialog from "@/components/RePureTableBar/DeleteBatchDialog.vue";
|
||||
import { use${classUppercaseName}Store } from '@/store/modules${webBasePath}/${classLowercaseName}';
|
||||
import ${classUppercaseName}Dialog from '../components/${classLowercaseName}-dialog.vue';
|
||||
import type { ${classUppercaseName}Info } from '@/types/${classLowercaseName}/${classLowercaseName}DataType';
|
||||
import type { ${classUppercaseName}Info } from '@/types${webBasePath}/${classLowercaseName}/${classLowercaseName}DataType';
|
||||
import type { FormItemProps } from 'element-plus';
|
||||
|
||||
export interface FormInline {
|
||||
|
|
|
@ -3,7 +3,7 @@ package com.auth.module.security.filter;
|
|||
|
||||
import com.auth.common.context.BaseContext;
|
||||
import com.auth.common.exception.AuthenticSecurityException;
|
||||
import com.auth.common.exception.MyAuthenticationException;
|
||||
import com.auth.common.exception.AuthenticationFailException;
|
||||
import com.auth.common.model.common.result.ResultCodeEnum;
|
||||
import com.auth.module.security.config.properties.SecurityConfigProperties;
|
||||
import com.auth.module.security.handler.SecurityAuthenticationEntryPoint;
|
||||
|
@ -67,17 +67,12 @@ public class JwtAuthenticationFilter extends OncePerRequestFilter {
|
|||
filterChain.doFilter(request, response);
|
||||
} catch (AuthenticSecurityException e) {
|
||||
// 直接处理认证异常,不再调用filterChain.doFilter()
|
||||
securityAuthenticationEntryPoint.commence(
|
||||
request,
|
||||
response,
|
||||
new MyAuthenticationException(e.getMessage(), e)
|
||||
);
|
||||
AuthenticationFailException authException = new AuthenticationFailException(ResultCodeEnum.AUTHENTICATION_EXPIRED);
|
||||
securityAuthenticationEntryPoint.commence(request, response, authException);
|
||||
|
||||
} catch (RuntimeException e) {
|
||||
securityAuthenticationEntryPoint.commence(
|
||||
request,
|
||||
response,
|
||||
new MyAuthenticationException("Authentication failed", e)
|
||||
);
|
||||
AuthenticationFailException authException = new AuthenticationFailException(ResultCodeEnum.AUTHENTICATION_FAILED);
|
||||
securityAuthenticationEntryPoint.commence(request, response, authException);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package com.auth.module.security.handler;
|
||||
|
||||
import com.auth.common.exception.MyAuthenticationException;
|
||||
import com.auth.common.exception.AuthenticationFailException;
|
||||
import com.auth.common.model.common.result.Result;
|
||||
import com.auth.common.model.common.result.ResultCodeEnum;
|
||||
import com.auth.common.utils.ResponseUtil;
|
||||
|
@ -17,12 +17,15 @@ public class SecurityAuthenticationEntryPoint implements AuthenticationEntryPoin
|
|||
|
||||
@Override
|
||||
public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) {
|
||||
log.error("SecurityAuthenticationEntryPoint:{}", authException.getLocalizedMessage());
|
||||
String localizedMessage = authException.getLocalizedMessage();
|
||||
log.error("SecurityAuthenticationEntryPoint:{}", localizedMessage);
|
||||
Result<Object> result;
|
||||
|
||||
// 自定义认证异常
|
||||
if (authException instanceof MyAuthenticationException) {
|
||||
result = Result.error(null, authException.getMessage());
|
||||
if (authException instanceof AuthenticationFailException authenticationFailException) {
|
||||
String message = authenticationFailException.getMessage();
|
||||
Integer code = authenticationFailException.getCode();
|
||||
result = Result.error(localizedMessage, code, message);
|
||||
ResponseUtil.out(response, result);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.auth.service.base.controller;
|
||||
|
||||
|
||||
import com.auth.common.model.common.result.PageResult;
|
||||
import com.auth.common.model.common.result.Result;
|
||||
import com.auth.common.model.common.result.ResultCodeEnum;
|
||||
|
@ -13,6 +12,7 @@ import io.swagger.v3.oas.annotations.Operation;
|
|||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -23,7 +23,7 @@ import java.util.List;
|
|||
* </p>
|
||||
*
|
||||
* @author AuthoritySystem
|
||||
* @since 2025-07-22 21:40:38
|
||||
* @since 2025-07-22 23:14:35
|
||||
*/
|
||||
@Tag(name = "系统授权日志表", description = "系统授权日志表相关接口")
|
||||
@RestController
|
||||
|
@ -33,6 +33,7 @@ public class AuthLogController {
|
|||
|
||||
private final AuthLogService authLogService;
|
||||
|
||||
@PreAuthorize("auth.decide('authLog:query')")
|
||||
@Operation(summary = "分页查询系统授权日志表", description = "分页查询系统授权日志表")
|
||||
@GetMapping()
|
||||
public Result<PageResult<AuthLogVo>> getAuthLogPage(AuthLogDto dto) {
|
||||
|
@ -41,6 +42,7 @@ public class AuthLogController {
|
|||
return Result.success(pageResult);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('authLog:query')")
|
||||
@Operation(summary = "根据id查询系统授权日志表详情", description = "根据id查询系统授权日志表详情")
|
||||
@GetMapping("{id}")
|
||||
public Result<AuthLogVo> getById(@PathVariable("id") Long id) {
|
||||
|
@ -49,6 +51,7 @@ public class AuthLogController {
|
|||
return Result.success(authLogVo);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('authLog:create')")
|
||||
@Operation(summary = "添加系统授权日志表", description = "添加系统授权日志表")
|
||||
@PostMapping()
|
||||
public Result<String> create(@Valid @RequestBody AuthLogDto dto) {
|
||||
|
@ -56,6 +59,7 @@ public class AuthLogController {
|
|||
return Result.success(ResultCodeEnum.ADD_SUCCESS);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('authLog:update')")
|
||||
@Operation(summary = "更新系统授权日志表", description = "更新系统授权日志表")
|
||||
@PutMapping()
|
||||
public Result<String> update(@Valid @RequestBody AuthLogDto dto) {
|
||||
|
@ -63,6 +67,7 @@ public class AuthLogController {
|
|||
return Result.success(ResultCodeEnum.UPDATE_SUCCESS);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('authLog:delete')")
|
||||
@Operation(summary = "删除系统授权日志表", description = "删除系统授权日志表")
|
||||
@DeleteMapping()
|
||||
public Result<String> batchDelete(@RequestBody List<Long> ids) {
|
||||
|
|
|
@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.Operation;
|
|||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -22,7 +23,7 @@ import java.util.List;
|
|||
* </p>
|
||||
*
|
||||
* @author AuthoritySystem
|
||||
* @since 2025-07-22 21:40:38
|
||||
* @since 2025-07-22 23:14:35
|
||||
*/
|
||||
@Tag(name = "部门表", description = "部门表相关接口")
|
||||
@RestController
|
||||
|
@ -32,6 +33,7 @@ public class DeptController {
|
|||
|
||||
private final DeptService deptService;
|
||||
|
||||
@PreAuthorize("auth.decide('dept:query')")
|
||||
@Operation(summary = "分页查询部门表", description = "分页查询部门表")
|
||||
@GetMapping()
|
||||
public Result<PageResult<DeptVo>> getDeptPage(DeptDto dto) {
|
||||
|
@ -40,6 +42,7 @@ public class DeptController {
|
|||
return Result.success(pageResult);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('dept:query')")
|
||||
@Operation(summary = "根据id查询部门表详情", description = "根据id查询部门表详情")
|
||||
@GetMapping("{id}")
|
||||
public Result<DeptVo> getById(@PathVariable("id") Long id) {
|
||||
|
@ -48,6 +51,7 @@ public class DeptController {
|
|||
return Result.success(deptVo);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('dept:create')")
|
||||
@Operation(summary = "添加部门表", description = "添加部门表")
|
||||
@PostMapping()
|
||||
public Result<String> create(@Valid @RequestBody DeptDto dto) {
|
||||
|
@ -55,6 +59,7 @@ public class DeptController {
|
|||
return Result.success(ResultCodeEnum.ADD_SUCCESS);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('dept:update')")
|
||||
@Operation(summary = "更新部门表", description = "更新部门表")
|
||||
@PutMapping()
|
||||
public Result<String> update(@Valid @RequestBody DeptDto dto) {
|
||||
|
@ -62,6 +67,7 @@ public class DeptController {
|
|||
return Result.success(ResultCodeEnum.UPDATE_SUCCESS);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('dept:delete')")
|
||||
@Operation(summary = "删除部门表", description = "删除部门表")
|
||||
@DeleteMapping()
|
||||
public Result<String> batchDelete(@RequestBody List<Long> ids) {
|
||||
|
|
|
@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.Operation;
|
|||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -22,7 +23,7 @@ import java.util.List;
|
|||
* </p>
|
||||
*
|
||||
* @author AuthoritySystem
|
||||
* @since 2025-07-22 21:40:38
|
||||
* @since 2025-07-22 23:14:35
|
||||
*/
|
||||
@Tag(name = "系统数据字典", description = "系统数据字典相关接口")
|
||||
@RestController
|
||||
|
@ -32,6 +33,7 @@ public class DictController {
|
|||
|
||||
private final DictService dictService;
|
||||
|
||||
@PreAuthorize("auth.decide('dict:query')")
|
||||
@Operation(summary = "分页查询系统数据字典", description = "分页查询系统数据字典")
|
||||
@GetMapping()
|
||||
public Result<PageResult<DictVo>> getDictPage(DictDto dto) {
|
||||
|
@ -40,6 +42,7 @@ public class DictController {
|
|||
return Result.success(pageResult);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('dict:query')")
|
||||
@Operation(summary = "根据id查询系统数据字典详情", description = "根据id查询系统数据字典详情")
|
||||
@GetMapping("{id}")
|
||||
public Result<DictVo> getById(@PathVariable("id") Long id) {
|
||||
|
@ -48,6 +51,7 @@ public class DictController {
|
|||
return Result.success(dictVo);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('dict:create')")
|
||||
@Operation(summary = "添加系统数据字典", description = "添加系统数据字典")
|
||||
@PostMapping()
|
||||
public Result<String> create(@Valid @RequestBody DictDto dto) {
|
||||
|
@ -55,6 +59,7 @@ public class DictController {
|
|||
return Result.success(ResultCodeEnum.ADD_SUCCESS);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('dict:update')")
|
||||
@Operation(summary = "更新系统数据字典", description = "更新系统数据字典")
|
||||
@PutMapping()
|
||||
public Result<String> update(@Valid @RequestBody DictDto dto) {
|
||||
|
@ -62,6 +67,7 @@ public class DictController {
|
|||
return Result.success(ResultCodeEnum.UPDATE_SUCCESS);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('dict:delete')")
|
||||
@Operation(summary = "删除系统数据字典", description = "删除系统数据字典")
|
||||
@DeleteMapping()
|
||||
public Result<String> batchDelete(@RequestBody List<Long> ids) {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.auth.service.base.controller;
|
||||
|
||||
|
||||
import com.auth.common.model.common.result.PageResult;
|
||||
import com.auth.common.model.common.result.Result;
|
||||
import com.auth.common.model.common.result.ResultCodeEnum;
|
||||
|
@ -13,6 +12,7 @@ import io.swagger.v3.oas.annotations.Operation;
|
|||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -23,7 +23,7 @@ import java.util.List;
|
|||
* </p>
|
||||
*
|
||||
* @author AuthoritySystem
|
||||
* @since 2025-07-22 21:40:38
|
||||
* @since 2025-07-22 23:14:35
|
||||
*/
|
||||
@Tag(name = "系统邮件服务器配置", description = "系统邮件服务器配置相关接口")
|
||||
@RestController
|
||||
|
@ -33,6 +33,7 @@ public class EmailConfigController {
|
|||
|
||||
private final EmailConfigService emailConfigService;
|
||||
|
||||
@PreAuthorize("auth.decide('emailConfig:query')")
|
||||
@Operation(summary = "分页查询系统邮件服务器配置", description = "分页查询系统邮件服务器配置")
|
||||
@GetMapping()
|
||||
public Result<PageResult<EmailConfigVo>> getEmailConfigPage(EmailConfigDto dto) {
|
||||
|
@ -41,6 +42,7 @@ public class EmailConfigController {
|
|||
return Result.success(pageResult);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('emailConfig:query')")
|
||||
@Operation(summary = "根据id查询系统邮件服务器配置详情", description = "根据id查询系统邮件服务器配置详情")
|
||||
@GetMapping("{id}")
|
||||
public Result<EmailConfigVo> getById(@PathVariable("id") Long id) {
|
||||
|
@ -49,6 +51,7 @@ public class EmailConfigController {
|
|||
return Result.success(emailConfigVo);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('emailConfig:create')")
|
||||
@Operation(summary = "添加系统邮件服务器配置", description = "添加系统邮件服务器配置")
|
||||
@PostMapping()
|
||||
public Result<String> create(@Valid @RequestBody EmailConfigDto dto) {
|
||||
|
@ -56,6 +59,7 @@ public class EmailConfigController {
|
|||
return Result.success(ResultCodeEnum.ADD_SUCCESS);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('emailConfig:update')")
|
||||
@Operation(summary = "更新系统邮件服务器配置", description = "更新系统邮件服务器配置")
|
||||
@PutMapping()
|
||||
public Result<String> update(@Valid @RequestBody EmailConfigDto dto) {
|
||||
|
@ -63,6 +67,7 @@ public class EmailConfigController {
|
|||
return Result.success(ResultCodeEnum.UPDATE_SUCCESS);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('emailConfig:delete')")
|
||||
@Operation(summary = "删除系统邮件服务器配置", description = "删除系统邮件服务器配置")
|
||||
@DeleteMapping()
|
||||
public Result<String> batchDelete(@RequestBody List<Long> ids) {
|
||||
|
|
|
@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.Operation;
|
|||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -22,7 +23,7 @@ import java.util.List;
|
|||
* </p>
|
||||
*
|
||||
* @author AuthoritySystem
|
||||
* @since 2025-07-22 21:40:38
|
||||
* @since 2025-07-22 23:14:35
|
||||
*/
|
||||
@Tag(name = "邮件模板表", description = "邮件模板表相关接口")
|
||||
@RestController
|
||||
|
@ -32,6 +33,7 @@ public class EmailTemplateController {
|
|||
|
||||
private final EmailTemplateService emailTemplateService;
|
||||
|
||||
@PreAuthorize("auth.decide('emailTemplate:query')")
|
||||
@Operation(summary = "分页查询邮件模板表", description = "分页查询邮件模板表")
|
||||
@GetMapping()
|
||||
public Result<PageResult<EmailTemplateVo>> getEmailTemplatePage(EmailTemplateDto dto) {
|
||||
|
@ -40,6 +42,7 @@ public class EmailTemplateController {
|
|||
return Result.success(pageResult);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('emailTemplate:query')")
|
||||
@Operation(summary = "根据id查询邮件模板表详情", description = "根据id查询邮件模板表详情")
|
||||
@GetMapping("{id}")
|
||||
public Result<EmailTemplateVo> getById(@PathVariable("id") Long id) {
|
||||
|
@ -48,6 +51,7 @@ public class EmailTemplateController {
|
|||
return Result.success(emailTemplateVo);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('emailTemplate:create')")
|
||||
@Operation(summary = "添加邮件模板表", description = "添加邮件模板表")
|
||||
@PostMapping()
|
||||
public Result<String> create(@Valid @RequestBody EmailTemplateDto dto) {
|
||||
|
@ -55,6 +59,7 @@ public class EmailTemplateController {
|
|||
return Result.success(ResultCodeEnum.ADD_SUCCESS);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('emailTemplate:update')")
|
||||
@Operation(summary = "更新邮件模板表", description = "更新邮件模板表")
|
||||
@PutMapping()
|
||||
public Result<String> update(@Valid @RequestBody EmailTemplateDto dto) {
|
||||
|
@ -62,6 +67,7 @@ public class EmailTemplateController {
|
|||
return Result.success(ResultCodeEnum.UPDATE_SUCCESS);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('emailTemplate:delete')")
|
||||
@Operation(summary = "删除邮件模板表", description = "删除邮件模板表")
|
||||
@DeleteMapping()
|
||||
public Result<String> batchDelete(@RequestBody List<Long> ids) {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.auth.service.base.controller;
|
||||
|
||||
|
||||
import com.auth.common.model.common.result.PageResult;
|
||||
import com.auth.common.model.common.result.Result;
|
||||
import com.auth.common.model.common.result.ResultCodeEnum;
|
||||
|
@ -12,6 +13,7 @@ import io.swagger.v3.oas.annotations.Operation;
|
|||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -22,7 +24,7 @@ import java.util.List;
|
|||
* </p>
|
||||
*
|
||||
* @author AuthoritySystem
|
||||
* @since 2025-07-22 21:40:38
|
||||
* @since 2025-07-22 23:14:35
|
||||
*/
|
||||
@Tag(name = "系统文件存储", description = "系统文件存储相关接口")
|
||||
@RestController
|
||||
|
@ -32,6 +34,7 @@ public class FileController {
|
|||
|
||||
private final FileService fileService;
|
||||
|
||||
@PreAuthorize("auth.decide('file:query')")
|
||||
@Operation(summary = "分页查询系统文件存储", description = "分页查询系统文件存储")
|
||||
@GetMapping()
|
||||
public Result<PageResult<FileVo>> getFilePage(FileDto dto) {
|
||||
|
@ -40,6 +43,7 @@ public class FileController {
|
|||
return Result.success(pageResult);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('file:query')")
|
||||
@Operation(summary = "根据id查询系统文件存储详情", description = "根据id查询系统文件存储详情")
|
||||
@GetMapping("{id}")
|
||||
public Result<FileVo> getById(@PathVariable("id") Long id) {
|
||||
|
@ -48,6 +52,7 @@ public class FileController {
|
|||
return Result.success(fileVo);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('file:create')")
|
||||
@Operation(summary = "添加系统文件存储", description = "添加系统文件存储")
|
||||
@PostMapping()
|
||||
public Result<String> create(@Valid @RequestBody FileDto dto) {
|
||||
|
@ -55,6 +60,7 @@ public class FileController {
|
|||
return Result.success(ResultCodeEnum.ADD_SUCCESS);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('file:update')")
|
||||
@Operation(summary = "更新系统文件存储", description = "更新系统文件存储")
|
||||
@PutMapping()
|
||||
public Result<String> update(@Valid @RequestBody FileDto dto) {
|
||||
|
@ -62,6 +68,7 @@ public class FileController {
|
|||
return Result.success(ResultCodeEnum.UPDATE_SUCCESS);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('file:delete')")
|
||||
@Operation(summary = "删除系统文件存储", description = "删除系统文件存储")
|
||||
@DeleteMapping()
|
||||
public Result<String> batchDelete(@RequestBody List<Long> ids) {
|
||||
|
|
|
@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.Operation;
|
|||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -22,7 +23,7 @@ import java.util.List;
|
|||
* </p>
|
||||
*
|
||||
* @author AuthoritySystem
|
||||
* @since 2025-07-22 21:40:38
|
||||
* @since 2025-07-22 23:14:35
|
||||
*/
|
||||
@Tag(name = "系统用户登录日志", description = "系统用户登录日志相关接口")
|
||||
@RestController
|
||||
|
@ -32,6 +33,7 @@ public class LoginLogController {
|
|||
|
||||
private final LoginLogService loginLogService;
|
||||
|
||||
@PreAuthorize("auth.decide('loginLog:query')")
|
||||
@Operation(summary = "分页查询系统用户登录日志", description = "分页查询系统用户登录日志")
|
||||
@GetMapping()
|
||||
public Result<PageResult<LoginLogVo>> getLoginLogPage(LoginLogDto dto) {
|
||||
|
@ -40,6 +42,7 @@ public class LoginLogController {
|
|||
return Result.success(pageResult);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('loginLog:query')")
|
||||
@Operation(summary = "根据id查询系统用户登录日志详情", description = "根据id查询系统用户登录日志详情")
|
||||
@GetMapping("{id}")
|
||||
public Result<LoginLogVo> getById(@PathVariable("id") Long id) {
|
||||
|
@ -48,6 +51,7 @@ public class LoginLogController {
|
|||
return Result.success(loginLogVo);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('loginLog:create')")
|
||||
@Operation(summary = "添加系统用户登录日志", description = "添加系统用户登录日志")
|
||||
@PostMapping()
|
||||
public Result<String> create(@Valid @RequestBody LoginLogDto dto) {
|
||||
|
@ -55,6 +59,7 @@ public class LoginLogController {
|
|||
return Result.success(ResultCodeEnum.ADD_SUCCESS);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('loginLog:update')")
|
||||
@Operation(summary = "更新系统用户登录日志", description = "更新系统用户登录日志")
|
||||
@PutMapping()
|
||||
public Result<String> update(@Valid @RequestBody LoginLogDto dto) {
|
||||
|
@ -62,6 +67,7 @@ public class LoginLogController {
|
|||
return Result.success(ResultCodeEnum.UPDATE_SUCCESS);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('loginLog:delete')")
|
||||
@Operation(summary = "删除系统用户登录日志", description = "删除系统用户登录日志")
|
||||
@DeleteMapping()
|
||||
public Result<String> batchDelete(@RequestBody List<Long> ids) {
|
||||
|
|
|
@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.Operation;
|
|||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -22,7 +23,7 @@ import java.util.List;
|
|||
* </p>
|
||||
*
|
||||
* @author AuthoritySystem
|
||||
* @since 2025-07-22 21:40:38
|
||||
* @since 2025-07-22 23:14:35
|
||||
*/
|
||||
@Tag(name = "系统菜单权限", description = "系统菜单权限相关接口")
|
||||
@RestController
|
||||
|
@ -32,6 +33,7 @@ public class MenuController {
|
|||
|
||||
private final MenuService menuService;
|
||||
|
||||
@PreAuthorize("auth.decide('menu:query')")
|
||||
@Operation(summary = "分页查询系统菜单权限", description = "分页查询系统菜单权限")
|
||||
@GetMapping()
|
||||
public Result<PageResult<MenuVo>> getMenuPage(MenuDto dto) {
|
||||
|
@ -40,6 +42,7 @@ public class MenuController {
|
|||
return Result.success(pageResult);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('menu:query')")
|
||||
@Operation(summary = "根据id查询系统菜单权限详情", description = "根据id查询系统菜单权限详情")
|
||||
@GetMapping("{id}")
|
||||
public Result<MenuVo> getById(@PathVariable("id") Long id) {
|
||||
|
@ -48,6 +51,7 @@ public class MenuController {
|
|||
return Result.success(menuVo);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('menu:create')")
|
||||
@Operation(summary = "添加系统菜单权限", description = "添加系统菜单权限")
|
||||
@PostMapping()
|
||||
public Result<String> create(@Valid @RequestBody MenuDto dto) {
|
||||
|
@ -55,6 +59,7 @@ public class MenuController {
|
|||
return Result.success(ResultCodeEnum.ADD_SUCCESS);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('menu:update')")
|
||||
@Operation(summary = "更新系统菜单权限", description = "更新系统菜单权限")
|
||||
@PutMapping()
|
||||
public Result<String> update(@Valid @RequestBody MenuDto dto) {
|
||||
|
@ -62,6 +67,7 @@ public class MenuController {
|
|||
return Result.success(ResultCodeEnum.UPDATE_SUCCESS);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('menu:delete')")
|
||||
@Operation(summary = "删除系统菜单权限", description = "删除系统菜单权限")
|
||||
@DeleteMapping()
|
||||
public Result<String> batchDelete(@RequestBody List<Long> ids) {
|
||||
|
|
|
@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.Operation;
|
|||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -22,7 +23,7 @@ import java.util.List;
|
|||
* </p>
|
||||
*
|
||||
* @author AuthoritySystem
|
||||
* @since 2025-07-22 21:40:38
|
||||
* @since 2025-07-22 23:14:35
|
||||
*/
|
||||
@Tag(name = "系统菜单角色关联", description = "系统菜单角色关联相关接口")
|
||||
@RestController
|
||||
|
@ -32,6 +33,7 @@ public class MenuRoleController {
|
|||
|
||||
private final MenuRoleService menuRoleService;
|
||||
|
||||
@PreAuthorize("auth.decide('menuRole:query')")
|
||||
@Operation(summary = "分页查询系统菜单角色关联", description = "分页查询系统菜单角色关联")
|
||||
@GetMapping()
|
||||
public Result<PageResult<MenuRoleVo>> getMenuRolePage(MenuRoleDto dto) {
|
||||
|
@ -40,6 +42,7 @@ public class MenuRoleController {
|
|||
return Result.success(pageResult);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('menuRole:query')")
|
||||
@Operation(summary = "根据id查询系统菜单角色关联详情", description = "根据id查询系统菜单角色关联详情")
|
||||
@GetMapping("{id}")
|
||||
public Result<MenuRoleVo> getById(@PathVariable("id") Long id) {
|
||||
|
@ -48,6 +51,7 @@ public class MenuRoleController {
|
|||
return Result.success(menuRoleVo);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('menuRole:create')")
|
||||
@Operation(summary = "添加系统菜单角色关联", description = "添加系统菜单角色关联")
|
||||
@PostMapping()
|
||||
public Result<String> create(@Valid @RequestBody MenuRoleDto dto) {
|
||||
|
@ -55,6 +59,7 @@ public class MenuRoleController {
|
|||
return Result.success(ResultCodeEnum.ADD_SUCCESS);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('menuRole:update')")
|
||||
@Operation(summary = "更新系统菜单角色关联", description = "更新系统菜单角色关联")
|
||||
@PutMapping()
|
||||
public Result<String> update(@Valid @RequestBody MenuRoleDto dto) {
|
||||
|
@ -62,6 +67,7 @@ public class MenuRoleController {
|
|||
return Result.success(ResultCodeEnum.UPDATE_SUCCESS);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('menuRole:delete')")
|
||||
@Operation(summary = "删除系统菜单角色关联", description = "删除系统菜单角色关联")
|
||||
@DeleteMapping()
|
||||
public Result<String> batchDelete(@RequestBody List<Long> ids) {
|
||||
|
|
|
@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.Operation;
|
|||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -22,7 +23,7 @@ import java.util.List;
|
|||
* </p>
|
||||
*
|
||||
* @author AuthoritySystem
|
||||
* @since 2025-07-22 21:40:38
|
||||
* @since 2025-07-22 23:14:35
|
||||
*/
|
||||
@Tag(name = "系统操作日志", description = "系统操作日志相关接口")
|
||||
@RestController
|
||||
|
@ -32,6 +33,7 @@ public class OperationLogController {
|
|||
|
||||
private final OperationLogService operationLogService;
|
||||
|
||||
@PreAuthorize("auth.decide('operationLog:query')")
|
||||
@Operation(summary = "分页查询系统操作日志", description = "分页查询系统操作日志")
|
||||
@GetMapping()
|
||||
public Result<PageResult<OperationLogVo>> getOperationLogPage(OperationLogDto dto) {
|
||||
|
@ -40,6 +42,7 @@ public class OperationLogController {
|
|||
return Result.success(pageResult);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('operationLog:query')")
|
||||
@Operation(summary = "根据id查询系统操作日志详情", description = "根据id查询系统操作日志详情")
|
||||
@GetMapping("{id}")
|
||||
public Result<OperationLogVo> getById(@PathVariable("id") Long id) {
|
||||
|
@ -48,6 +51,7 @@ public class OperationLogController {
|
|||
return Result.success(operationLogVo);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('operationLog:create')")
|
||||
@Operation(summary = "添加系统操作日志", description = "添加系统操作日志")
|
||||
@PostMapping()
|
||||
public Result<String> create(@Valid @RequestBody OperationLogDto dto) {
|
||||
|
@ -55,6 +59,7 @@ public class OperationLogController {
|
|||
return Result.success(ResultCodeEnum.ADD_SUCCESS);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('operationLog:update')")
|
||||
@Operation(summary = "更新系统操作日志", description = "更新系统操作日志")
|
||||
@PutMapping()
|
||||
public Result<String> update(@Valid @RequestBody OperationLogDto dto) {
|
||||
|
@ -62,6 +67,7 @@ public class OperationLogController {
|
|||
return Result.success(ResultCodeEnum.UPDATE_SUCCESS);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('operationLog:delete')")
|
||||
@Operation(summary = "删除系统操作日志", description = "删除系统操作日志")
|
||||
@DeleteMapping()
|
||||
public Result<String> batchDelete(@RequestBody List<Long> ids) {
|
||||
|
|
|
@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.Operation;
|
|||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -22,7 +23,7 @@ import java.util.List;
|
|||
* </p>
|
||||
*
|
||||
* @author AuthoritySystem
|
||||
* @since 2025-07-22 21:40:38
|
||||
* @since 2025-07-22 23:14:35
|
||||
*/
|
||||
@Tag(name = "系统权限表", description = "系统权限表相关接口")
|
||||
@RestController
|
||||
|
@ -32,6 +33,7 @@ public class PermissionController {
|
|||
|
||||
private final PermissionService permissionService;
|
||||
|
||||
@PreAuthorize("auth.decide('permission:query')")
|
||||
@Operation(summary = "分页查询系统权限表", description = "分页查询系统权限表")
|
||||
@GetMapping()
|
||||
public Result<PageResult<PermissionVo>> getPermissionPage(PermissionDto dto) {
|
||||
|
@ -40,6 +42,7 @@ public class PermissionController {
|
|||
return Result.success(pageResult);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('permission:query')")
|
||||
@Operation(summary = "根据id查询系统权限表详情", description = "根据id查询系统权限表详情")
|
||||
@GetMapping("{id}")
|
||||
public Result<PermissionVo> getById(@PathVariable("id") Long id) {
|
||||
|
@ -48,6 +51,7 @@ public class PermissionController {
|
|||
return Result.success(permissionVo);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('permission:create')")
|
||||
@Operation(summary = "添加系统权限表", description = "添加系统权限表")
|
||||
@PostMapping()
|
||||
public Result<String> create(@Valid @RequestBody PermissionDto dto) {
|
||||
|
@ -55,6 +59,7 @@ public class PermissionController {
|
|||
return Result.success(ResultCodeEnum.ADD_SUCCESS);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('permission:update')")
|
||||
@Operation(summary = "更新系统权限表", description = "更新系统权限表")
|
||||
@PutMapping()
|
||||
public Result<String> update(@Valid @RequestBody PermissionDto dto) {
|
||||
|
@ -62,6 +67,7 @@ public class PermissionController {
|
|||
return Result.success(ResultCodeEnum.UPDATE_SUCCESS);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('permission:delete')")
|
||||
@Operation(summary = "删除系统权限表", description = "删除系统权限表")
|
||||
@DeleteMapping()
|
||||
public Result<String> batchDelete(@RequestBody List<Long> ids) {
|
||||
|
|
|
@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.Operation;
|
|||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -22,7 +23,7 @@ import java.util.List;
|
|||
* </p>
|
||||
*
|
||||
* @author AuthoritySystem
|
||||
* @since 2025-07-22 21:40:38
|
||||
* @since 2025-07-22 23:14:35
|
||||
*/
|
||||
@Tag(name = "系统角色表", description = "系统角色表相关接口")
|
||||
@RestController
|
||||
|
@ -32,6 +33,7 @@ public class RoleController {
|
|||
|
||||
private final RoleService roleService;
|
||||
|
||||
@PreAuthorize("auth.decide('role:query')")
|
||||
@Operation(summary = "分页查询系统角色表", description = "分页查询系统角色表")
|
||||
@GetMapping()
|
||||
public Result<PageResult<RoleVo>> getRolePage(RoleDto dto) {
|
||||
|
@ -40,6 +42,7 @@ public class RoleController {
|
|||
return Result.success(pageResult);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('role:query')")
|
||||
@Operation(summary = "根据id查询系统角色表详情", description = "根据id查询系统角色表详情")
|
||||
@GetMapping("{id}")
|
||||
public Result<RoleVo> getById(@PathVariable("id") Long id) {
|
||||
|
@ -48,6 +51,7 @@ public class RoleController {
|
|||
return Result.success(roleVo);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('role:create')")
|
||||
@Operation(summary = "添加系统角色表", description = "添加系统角色表")
|
||||
@PostMapping()
|
||||
public Result<String> create(@Valid @RequestBody RoleDto dto) {
|
||||
|
@ -55,6 +59,7 @@ public class RoleController {
|
|||
return Result.success(ResultCodeEnum.ADD_SUCCESS);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('role:update')")
|
||||
@Operation(summary = "更新系统角色表", description = "更新系统角色表")
|
||||
@PutMapping()
|
||||
public Result<String> update(@Valid @RequestBody RoleDto dto) {
|
||||
|
@ -62,6 +67,7 @@ public class RoleController {
|
|||
return Result.success(ResultCodeEnum.UPDATE_SUCCESS);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('role:delete')")
|
||||
@Operation(summary = "删除系统角色表", description = "删除系统角色表")
|
||||
@DeleteMapping()
|
||||
public Result<String> batchDelete(@RequestBody List<Long> ids) {
|
||||
|
|
|
@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.Operation;
|
|||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -22,7 +23,7 @@ import java.util.List;
|
|||
* </p>
|
||||
*
|
||||
* @author AuthoritySystem
|
||||
* @since 2025-07-22 21:40:38
|
||||
* @since 2025-07-22 23:14:35
|
||||
*/
|
||||
@Tag(name = "系统角色数据权限范围", description = "系统角色数据权限范围相关接口")
|
||||
@RestController
|
||||
|
@ -32,6 +33,7 @@ public class RoleDataScopeController {
|
|||
|
||||
private final RoleDataScopeService roleDataScopeService;
|
||||
|
||||
@PreAuthorize("auth.decide('roleDataScope:query')")
|
||||
@Operation(summary = "分页查询系统角色数据权限范围", description = "分页查询系统角色数据权限范围")
|
||||
@GetMapping()
|
||||
public Result<PageResult<RoleDataScopeVo>> getRoleDataScopePage(RoleDataScopeDto dto) {
|
||||
|
@ -40,6 +42,7 @@ public class RoleDataScopeController {
|
|||
return Result.success(pageResult);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('roleDataScope:query')")
|
||||
@Operation(summary = "根据id查询系统角色数据权限范围详情", description = "根据id查询系统角色数据权限范围详情")
|
||||
@GetMapping("{id}")
|
||||
public Result<RoleDataScopeVo> getById(@PathVariable("id") Long id) {
|
||||
|
@ -48,6 +51,7 @@ public class RoleDataScopeController {
|
|||
return Result.success(roleDataScopeVo);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('roleDataScope:create')")
|
||||
@Operation(summary = "添加系统角色数据权限范围", description = "添加系统角色数据权限范围")
|
||||
@PostMapping()
|
||||
public Result<String> create(@Valid @RequestBody RoleDataScopeDto dto) {
|
||||
|
@ -55,6 +59,7 @@ public class RoleDataScopeController {
|
|||
return Result.success(ResultCodeEnum.ADD_SUCCESS);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('roleDataScope:update')")
|
||||
@Operation(summary = "更新系统角色数据权限范围", description = "更新系统角色数据权限范围")
|
||||
@PutMapping()
|
||||
public Result<String> update(@Valid @RequestBody RoleDataScopeDto dto) {
|
||||
|
@ -62,6 +67,7 @@ public class RoleDataScopeController {
|
|||
return Result.success(ResultCodeEnum.UPDATE_SUCCESS);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('roleDataScope:delete')")
|
||||
@Operation(summary = "删除系统角色数据权限范围", description = "删除系统角色数据权限范围")
|
||||
@DeleteMapping()
|
||||
public Result<String> batchDelete(@RequestBody List<Long> ids) {
|
||||
|
|
|
@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.Operation;
|
|||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -22,7 +23,7 @@ import java.util.List;
|
|||
* </p>
|
||||
*
|
||||
* @author AuthoritySystem
|
||||
* @since 2025-07-22 21:40:38
|
||||
* @since 2025-07-22 23:14:35
|
||||
*/
|
||||
@Tag(name = "系统角色权限表", description = "系统角色权限表相关接口")
|
||||
@RestController
|
||||
|
@ -32,6 +33,7 @@ public class RolePermissionController {
|
|||
|
||||
private final RolePermissionService rolePermissionService;
|
||||
|
||||
@PreAuthorize("auth.decide('rolePermission:query')")
|
||||
@Operation(summary = "分页查询系统角色权限表", description = "分页查询系统角色权限表")
|
||||
@GetMapping()
|
||||
public Result<PageResult<RolePermissionVo>> getRolePermissionPage(RolePermissionDto dto) {
|
||||
|
@ -40,6 +42,7 @@ public class RolePermissionController {
|
|||
return Result.success(pageResult);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('rolePermission:query')")
|
||||
@Operation(summary = "根据id查询系统角色权限表详情", description = "根据id查询系统角色权限表详情")
|
||||
@GetMapping("{id}")
|
||||
public Result<RolePermissionVo> getById(@PathVariable("id") Long id) {
|
||||
|
@ -48,6 +51,7 @@ public class RolePermissionController {
|
|||
return Result.success(rolePermissionVo);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('rolePermission:create')")
|
||||
@Operation(summary = "添加系统角色权限表", description = "添加系统角色权限表")
|
||||
@PostMapping()
|
||||
public Result<String> create(@Valid @RequestBody RolePermissionDto dto) {
|
||||
|
@ -55,6 +59,7 @@ public class RolePermissionController {
|
|||
return Result.success(ResultCodeEnum.ADD_SUCCESS);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('rolePermission:update')")
|
||||
@Operation(summary = "更新系统角色权限表", description = "更新系统角色权限表")
|
||||
@PutMapping()
|
||||
public Result<String> update(@Valid @RequestBody RolePermissionDto dto) {
|
||||
|
@ -62,6 +67,7 @@ public class RolePermissionController {
|
|||
return Result.success(ResultCodeEnum.UPDATE_SUCCESS);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('rolePermission:delete')")
|
||||
@Operation(summary = "删除系统角色权限表", description = "删除系统角色权限表")
|
||||
@DeleteMapping()
|
||||
public Result<String> batchDelete(@RequestBody List<Long> ids) {
|
||||
|
|
|
@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.Operation;
|
|||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -22,7 +23,7 @@ import java.util.List;
|
|||
* </p>
|
||||
*
|
||||
* @author AuthoritySystem
|
||||
* @since 2025-07-22 21:40:38
|
||||
* @since 2025-07-22 23:14:35
|
||||
*/
|
||||
@Tag(name = "用户信息", description = "用户信息相关接口")
|
||||
@RestController
|
||||
|
@ -32,6 +33,7 @@ public class UserController {
|
|||
|
||||
private final UserService userService;
|
||||
|
||||
@PreAuthorize("auth.decide('user:query')")
|
||||
@Operation(summary = "分页查询用户信息", description = "分页查询用户信息")
|
||||
@GetMapping()
|
||||
public Result<PageResult<UserVo>> getUserPage(UserDto dto) {
|
||||
|
@ -40,6 +42,7 @@ public class UserController {
|
|||
return Result.success(pageResult);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('user:query')")
|
||||
@Operation(summary = "根据id查询用户信息详情", description = "根据id查询用户信息详情")
|
||||
@GetMapping("{id}")
|
||||
public Result<UserVo> getById(@PathVariable("id") Long id) {
|
||||
|
@ -48,6 +51,7 @@ public class UserController {
|
|||
return Result.success(userVo);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('user:create')")
|
||||
@Operation(summary = "添加用户信息", description = "添加用户信息")
|
||||
@PostMapping()
|
||||
public Result<String> create(@Valid @RequestBody UserDto dto) {
|
||||
|
@ -55,6 +59,7 @@ public class UserController {
|
|||
return Result.success(ResultCodeEnum.ADD_SUCCESS);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('user:update')")
|
||||
@Operation(summary = "更新用户信息", description = "更新用户信息")
|
||||
@PutMapping()
|
||||
public Result<String> update(@Valid @RequestBody UserDto dto) {
|
||||
|
@ -62,6 +67,7 @@ public class UserController {
|
|||
return Result.success(ResultCodeEnum.UPDATE_SUCCESS);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('user:delete')")
|
||||
@Operation(summary = "删除用户信息", description = "删除用户信息")
|
||||
@DeleteMapping()
|
||||
public Result<String> batchDelete(@RequestBody List<Long> ids) {
|
||||
|
|
|
@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.Operation;
|
|||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -22,7 +23,7 @@ import java.util.List;
|
|||
* </p>
|
||||
*
|
||||
* @author AuthoritySystem
|
||||
* @since 2025-07-22 21:40:38
|
||||
* @since 2025-07-22 23:14:35
|
||||
*/
|
||||
@Tag(name = "部门用户关系表", description = "部门用户关系表相关接口")
|
||||
@RestController
|
||||
|
@ -32,6 +33,7 @@ public class UserDeptController {
|
|||
|
||||
private final UserDeptService userDeptService;
|
||||
|
||||
@PreAuthorize("auth.decide('userDept:query')")
|
||||
@Operation(summary = "分页查询部门用户关系表", description = "分页查询部门用户关系表")
|
||||
@GetMapping()
|
||||
public Result<PageResult<UserDeptVo>> getUserDeptPage(UserDeptDto dto) {
|
||||
|
@ -40,6 +42,7 @@ public class UserDeptController {
|
|||
return Result.success(pageResult);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('userDept:query')")
|
||||
@Operation(summary = "根据id查询部门用户关系表详情", description = "根据id查询部门用户关系表详情")
|
||||
@GetMapping("{id}")
|
||||
public Result<UserDeptVo> getById(@PathVariable("id") Long id) {
|
||||
|
@ -48,6 +51,7 @@ public class UserDeptController {
|
|||
return Result.success(userDeptVo);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('userDept:create')")
|
||||
@Operation(summary = "添加部门用户关系表", description = "添加部门用户关系表")
|
||||
@PostMapping()
|
||||
public Result<String> create(@Valid @RequestBody UserDeptDto dto) {
|
||||
|
@ -55,6 +59,7 @@ public class UserDeptController {
|
|||
return Result.success(ResultCodeEnum.ADD_SUCCESS);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('userDept:update')")
|
||||
@Operation(summary = "更新部门用户关系表", description = "更新部门用户关系表")
|
||||
@PutMapping()
|
||||
public Result<String> update(@Valid @RequestBody UserDeptDto dto) {
|
||||
|
@ -62,6 +67,7 @@ public class UserDeptController {
|
|||
return Result.success(ResultCodeEnum.UPDATE_SUCCESS);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('userDept:delete')")
|
||||
@Operation(summary = "删除部门用户关系表", description = "删除部门用户关系表")
|
||||
@DeleteMapping()
|
||||
public Result<String> batchDelete(@RequestBody List<Long> ids) {
|
||||
|
|
|
@ -12,6 +12,7 @@ import io.swagger.v3.oas.annotations.Operation;
|
|||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -22,7 +23,7 @@ import java.util.List;
|
|||
* </p>
|
||||
*
|
||||
* @author AuthoritySystem
|
||||
* @since 2025-07-22 21:40:38
|
||||
* @since 2025-07-22 23:14:35
|
||||
*/
|
||||
@Tag(name = "系统用户角色关系表", description = "系统用户角色关系表相关接口")
|
||||
@RestController
|
||||
|
@ -32,6 +33,7 @@ public class UserRoleController {
|
|||
|
||||
private final UserRoleService userRoleService;
|
||||
|
||||
@PreAuthorize("auth.decide('userRole:query')")
|
||||
@Operation(summary = "分页查询系统用户角色关系表", description = "分页查询系统用户角色关系表")
|
||||
@GetMapping()
|
||||
public Result<PageResult<UserRoleVo>> getUserRolePage(UserRoleDto dto) {
|
||||
|
@ -40,6 +42,7 @@ public class UserRoleController {
|
|||
return Result.success(pageResult);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('userRole:query')")
|
||||
@Operation(summary = "根据id查询系统用户角色关系表详情", description = "根据id查询系统用户角色关系表详情")
|
||||
@GetMapping("{id}")
|
||||
public Result<UserRoleVo> getById(@PathVariable("id") Long id) {
|
||||
|
@ -48,6 +51,7 @@ public class UserRoleController {
|
|||
return Result.success(userRoleVo);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('userRole:create')")
|
||||
@Operation(summary = "添加系统用户角色关系表", description = "添加系统用户角色关系表")
|
||||
@PostMapping()
|
||||
public Result<String> create(@Valid @RequestBody UserRoleDto dto) {
|
||||
|
@ -55,6 +59,7 @@ public class UserRoleController {
|
|||
return Result.success(ResultCodeEnum.ADD_SUCCESS);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('userRole:update')")
|
||||
@Operation(summary = "更新系统用户角色关系表", description = "更新系统用户角色关系表")
|
||||
@PutMapping()
|
||||
public Result<String> update(@Valid @RequestBody UserRoleDto dto) {
|
||||
|
@ -62,6 +67,7 @@ public class UserRoleController {
|
|||
return Result.success(ResultCodeEnum.UPDATE_SUCCESS);
|
||||
}
|
||||
|
||||
@PreAuthorize("auth.decide('userRole:delete')")
|
||||
@Operation(summary = "删除系统用户角色关系表", description = "删除系统用户角色关系表")
|
||||
@DeleteMapping()
|
||||
public Result<String> batchDelete(@RequestBody List<Long> ids) {
|
||||
|
|
Loading…
Reference in New Issue