1. 替换原始 code 签名
2. 服务与模块生成器,支持指定起始端口批量端口分配
(cherry picked from commit e99da38fd4)
This commit is contained in:
@@ -8,7 +8,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
/**
|
||||
* API 日志使用到 Feign 的配置项
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ZT
|
||||
*/
|
||||
@AutoConfiguration
|
||||
@EnableFeignClients(clients = {ApiAccessLogCommonApi.class, ApiErrorLogCommonApi.class}) // 主要是引入相关的 API 服务
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.lang.annotation.Target;
|
||||
/**
|
||||
* 访问日志注解
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ZT
|
||||
*/
|
||||
@Target({ElementType.METHOD})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
|
||||
@@ -44,7 +44,7 @@ import static cn.iocoder.yudao.framework.common.util.json.JsonUtils.toJsonString
|
||||
*
|
||||
* 目的:记录 API 访问日志到数据库中
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ZT
|
||||
*/
|
||||
@Slf4j
|
||||
public class ApiAccessLogFilter extends ApiRequestFilter {
|
||||
|
||||
@@ -24,7 +24,7 @@ import java.util.stream.IntStream;
|
||||
*
|
||||
* 目的:在非 prod 环境时,打印 request 和 response 两条日志到日志文件(控制台)中。
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ZT
|
||||
*/
|
||||
@Slf4j
|
||||
public class ApiAccessLogInterceptor implements HandlerInterceptor {
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
* 1. API 访问日志:记录用户访问 API 的访问日志,定期归档历史日志。
|
||||
* 2. 异常日志:记录用户访问 API 的系统异常,方便日常排查问题与告警。
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ZT
|
||||
*/
|
||||
package cn.iocoder.yudao.framework.apilog;
|
||||
|
||||
@@ -7,7 +7,7 @@ import org.springframework.context.annotation.Bean;
|
||||
/**
|
||||
* Banner 的自动配置类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ZT
|
||||
*/
|
||||
@AutoConfiguration
|
||||
public class YudaoBannerAutoConfiguration {
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.util.concurrent.TimeUnit;
|
||||
/**
|
||||
* 项目启动成功后,提供文档相关的地址
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ZT
|
||||
*/
|
||||
@Slf4j
|
||||
public class BannerApplicationRunner implements ApplicationRunner {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* Banner 用于在 console 控制台,打印开发文档、接口文档等
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ZT
|
||||
*/
|
||||
package cn.iocoder.yudao.framework.banner;
|
||||
|
||||
@@ -8,7 +8,7 @@ import jakarta.validation.constraints.NotEmpty;
|
||||
/**
|
||||
* Swagger 配置属性
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ZT
|
||||
*/
|
||||
@ConfigurationProperties("yudao.swagger")
|
||||
@Data
|
||||
|
||||
@@ -40,7 +40,7 @@ import static cn.iocoder.yudao.framework.web.core.util.WebFrameworkUtils.HEADER_
|
||||
* 1. Springdoc 文档地址:<a href="https://github.com/springdoc/springdoc-openapi">仓库</a>
|
||||
* 2. Swagger 规范,于 2015 更名为 OpenAPI 规范,本质是一个东西
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ZT
|
||||
*/
|
||||
@AutoConfiguration
|
||||
@ConditionalOnClass({OpenAPI.class})
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* 基于 Swagger + Knife4j 实现 API 接口文档
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ZT
|
||||
*/
|
||||
package cn.iocoder.yudao.framework.swagger;
|
||||
|
||||
@@ -10,7 +10,7 @@ import jakarta.servlet.http.HttpServletRequest;
|
||||
/**
|
||||
* 过滤 /admin-api、/app-api 等 API 请求的过滤器
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ZT
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public abstract class ApiRequestFilter extends OncePerRequestFilter {
|
||||
|
||||
@@ -12,7 +12,7 @@ import java.io.IOException;
|
||||
/**
|
||||
* Request Body 缓存 Filter,实现它的可重复读取
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ZT
|
||||
*/
|
||||
public class CacheRequestBodyFilter extends OncePerRequestFilter {
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ import java.io.InputStreamReader;
|
||||
/**
|
||||
* Request Body 缓存 Wrapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ZT
|
||||
*/
|
||||
public class CacheRequestBodyWrapper extends HttpServletRequestWrapper {
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeC
|
||||
/**
|
||||
* 演示 Filter,禁止用户发起写操作,避免影响测试数据
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ZT
|
||||
*/
|
||||
public class DemoFilter extends OncePerRequestFilter {
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ import static cn.iocoder.yudao.framework.common.exception.enums.GlobalErrorCodeC
|
||||
/**
|
||||
* 全局异常处理器,将 Exception 翻译成 CommonResult + 对应的异常编号
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ZT
|
||||
*/
|
||||
@RestControllerAdvice
|
||||
@AllArgsConstructor
|
||||
|
||||
@@ -16,7 +16,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
/**
|
||||
* 专属于 web 包的工具类
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ZT
|
||||
*/
|
||||
public class WebFrameworkUtils {
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.util.List;
|
||||
/**
|
||||
* Xss 配置属性
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ZT
|
||||
*/
|
||||
@ConfigurationProperties(prefix = "yudao.xss")
|
||||
@Validated
|
||||
|
||||
@@ -15,7 +15,7 @@ import java.io.IOException;
|
||||
/**
|
||||
* Xss 过滤器
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ZT
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
public class XssFilter extends OncePerRequestFilter {
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.util.Map;
|
||||
/**
|
||||
* Xss 请求 Wrapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
* @author ZT
|
||||
*/
|
||||
public class XssRequestWrapper extends HttpServletRequestWrapper {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user