| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- package com.example.hrlab.config;
- import java.time.Duration;
- import org.springframework.boot.context.properties.ConfigurationProperties;
- @ConfigurationProperties(prefix = "app")
- public record AppProperties(
- String name,
- String version,
- Jwt jwt,
- Security security,
- Tasks tasks,
- Storage storage,
- Lab lab) {
- public record Jwt(String issuer, String secret, long accessTokenMinutes, long refreshTokenDays) {
- public Duration accessDuration() {
- return Duration.ofMinutes(accessTokenMinutes);
- }
- public Duration refreshDuration() {
- return Duration.ofDays(refreshTokenDays);
- }
- }
- public record Security(int loginFailureThreshold, long lockMinutes, String webhookSecret) {
- public Duration lockDuration() {
- return Duration.ofMinutes(lockMinutes);
- }
- }
- public record Tasks(boolean inline, String exchange, String payrollQueue, String exportQueue, String importQueue, String webhookQueue) {
- }
- public record Storage(String exportDir, String importDir) {
- }
- public record Lab(boolean enabled, String fixedClock, Seed seed, Failpoint failpoint) {
- }
- public record Seed(boolean enabled, long randomSeed, int employeeCount, int candidateCount, int attendanceDays) {
- }
- public record Failpoint(boolean enabled, long exportDelayMs, long payrollExtraDelayMs, boolean webhookForce5xx,
- boolean mqRequeueOnce, boolean formulaException, boolean cacheDisabled) {
- }
- }
|