com.thebund1st.daming.boot.SmsVerificationCodeProperties Maven / Gradle / Ivy
package com.thebund1st.daming.boot;
import com.thebund1st.daming.core.MobilePhoneNumber;
import lombok.Data;
import org.springframework.boot.convert.DurationUnit;
import java.time.Duration;
import java.util.ArrayList;
import java.util.List;
import static java.time.temporal.ChronoUnit.SECONDS;
import static java.util.stream.Collectors.toList;
@Data
public class SmsVerificationCodeProperties {
@DurationUnit(SECONDS)
private Duration expires = Duration.ofSeconds(60);
private List whitelist = new ArrayList<>();
public List whitelist() {
return getWhitelist().stream().map(MobilePhoneNumber::mobilePhoneNumberOf).collect(toList());
}
}