feat: Spring Boot示例项目

- 基础Spring Boot配置
- Docker支持
This commit is contained in:
likingcode
2026-03-07 05:43:15 +00:00
commit 539dc41868
47 changed files with 2746 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
package com.example.demo.aop;
import java.lang.annotation.*;
/**
* 限流注解 - 自定义注解配合 AOP 使用
*
* 学习点:
* - 自定义注解定义
* - @Retention 保留策略
* - @Target 目标元素
* - 注解 + AOP 实现声明式功能
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
@Documented
public @interface RateLimited {
/**
* 每分钟最大请求数
*/
long value() default 100;
/**
* 限流提示消息
*/
String message() default "请求过于频繁,请稍后再试";
}