刘光辉
4 小时以前 06f314545ac3514d7ce28939920866ae8188d31c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package jnpf.dmsService;
 
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import java.util.HashSet;
import java.util.Set;
 
/** Explicit rollout: enabled plus all-batches or a tenant:batch allowlist entry. */
@Data
@Component
@ConfigurationProperties(prefix = "dms.invalidation")
public class DmsInvalidationProperties {
    private boolean enabled;
    private boolean allBatches;
    private Set<String> allowedBatches = new HashSet<>();
    public boolean allows(String tenantId, Object batchId) {
        return enabled && (allBatches || allowedBatches.contains(tenantId + ":" + batchId));
    }
}