feat(java-cache): add
This commit is contained in:
1 parent
408f8562d5
commit
d968e15e31
1 file changed
+18
+18
@@ -0,0 +1,18 @@
|
||||
package com.hoelee.platform.cache;
|
||||
|
||||
import jakarta.validation.constraints.Min;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
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) {
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user