From f564c3db22cf6394218dc2bb690da7e21c38ca29 Mon Sep 17 00:00:00 2001 From: hoelee Date: Tue, 17 Mar 2026 09:00:00 +0800 Subject: [PATCH] feat(java-cache): add CacheProperties() --- .../com/hoelee/platform/cache/CacheProperties.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/platform/java-cache/src/main/java/com/hoelee/platform/cache/CacheProperties.java b/platform/java-cache/src/main/java/com/hoelee/platform/cache/CacheProperties.java index 3ff66ada..3d00ba31 100644 --- a/platform/java-cache/src/main/java/com/hoelee/platform/cache/CacheProperties.java +++ b/platform/java-cache/src/main/java/com/hoelee/platform/cache/CacheProperties.java @@ -6,3 +6,13 @@ import java.time.Duration; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.validation.annotation.Validated; +/** + * @version v2, 2024-10-29 09:05:00PM + * @author hoelee + * Learning note: cache limits are configuration rather than magic numbers, so operations can tune them safely. + */ +@Validated +@ConfigurationProperties(prefix = "app.cache") +public record CacheProperties(@Min(1) int maximumSize, @NotNull Duration ttl) { +} +