Introduced a rate-limiting feature using Spring AOP and a custom `RateLimit` annotation. Includes `InMemoryRateLimiterService`, `RateLimitAspect`, and related classes for controlling request limits. Applied rate limiting to specific API controllers to enhance system stability and prevent abuse.
96 lines
2.6 KiB
Plaintext
96 lines
2.6 KiB
Plaintext
plugins {
|
|
java
|
|
id("org.springframework.boot") version "3.4.4"
|
|
id("io.spring.dependency-management") version "1.1.7"
|
|
// id("com.github.johnrengelman.shadow") version "8.1.1"
|
|
}
|
|
|
|
group = "com.alttd.altitudeweb"
|
|
version = "0.0.1-SNAPSHOT"
|
|
|
|
java {
|
|
toolchain {
|
|
languageVersion = JavaLanguageVersion.of(21)
|
|
}
|
|
}
|
|
|
|
configurations {
|
|
compileOnly {
|
|
extendsFrom(configurations.annotationProcessor.get())
|
|
}
|
|
}
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
}
|
|
|
|
dependencies {
|
|
implementation(project(":open_api"))
|
|
implementation(project(":database"))
|
|
implementation("org.springframework.boot:spring-boot-starter-web")
|
|
annotationProcessor("org.projectlombok:lombok")
|
|
testImplementation("org.springframework.boot:spring-boot-starter-test")
|
|
implementation("com.mysql:mysql-connector-j:8.0.32")
|
|
implementation("org.mybatis:mybatis:3.5.13")
|
|
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
|
|
implementation("org.springframework.boot:spring-boot-configuration-processor")
|
|
implementation("org.springframework.boot:spring-boot-starter-hateoas")
|
|
|
|
//AOP
|
|
implementation("org.aspectj:aspectjrt:1.9.19")
|
|
implementation("org.aspectj:aspectjweaver:1.9.19")
|
|
implementation("org.springframework:spring-aop")
|
|
implementation("org.springframework:spring-aspects")
|
|
|
|
}
|
|
|
|
tasks.withType<Test> {
|
|
useJUnitPlatform()
|
|
}
|
|
|
|
tasks.bootJar {
|
|
mainClass.set("com.alttd.altitudeweb.AltitudeWebApplication")
|
|
archiveBaseName.set("altitudeweb")
|
|
archiveClassifier.set("")
|
|
}
|
|
|
|
|
|
//tasks.withType<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar> {
|
|
// mergeServiceFiles()
|
|
// dependencies {
|
|
// include(dependency("com.mysql:mysql-connector-j"))
|
|
// }
|
|
//}
|
|
|
|
//tasks.withType<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar> {
|
|
// manifest {
|
|
// attributes["Main-Class"] = "com.alttd.altitudeweb.AltitudeWebApplication"
|
|
// }
|
|
// archiveBaseName.set("altitudeweb")
|
|
// archiveClassifier.set("")
|
|
// mergeServiceFiles()
|
|
//
|
|
// // Include everything
|
|
// from(sourceSets.main.get().output)
|
|
//
|
|
// // Include all project dependencies
|
|
// configurations = listOf(project.configurations.runtimeClasspath.get())
|
|
//
|
|
// // Ensure MySQL is included (even though it should be part of runtimeClasspath already)
|
|
// dependencies {
|
|
// include(dependency("com.mysql:mysql-connector-j"))
|
|
// }
|
|
//
|
|
// // Enable zip64 mode for large JARs
|
|
// isZip64 = true
|
|
//}
|
|
//
|
|
//// Make the shadowJar task the default jar task
|
|
//tasks.named("jar") {
|
|
// enabled = false
|
|
//}
|
|
//
|
|
//tasks.named("assemble") {
|
|
// dependsOn("shadowJar")
|
|
//}
|