package com.simuwang.base.config;

import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.List;

@Setter
@Getter
@Configuration
@ConfigurationProperties(prefix = DaqProperties.DAQ_CONFIG_PREFIX)
public class DaqProperties {
    public static final String DAQ_CONFIG_PREFIX = "simuwang";

    /**
     * 是否启用操作日志记录功能
     */
    private Boolean enableLogging = Boolean.TRUE;
    /**
     * 默认的密码
     */
    private String defaultPwd = "QWER1234!@#$";
    /**
     * token 过期时间
     */
    private Long tokenExpire = 60 * 60 * 24L;
    /**
     * token 的秘钥（长度为64）
     */
    private String tokenSecret = "qwertyuiopasdfghjklzxcvbnm1234567890qwertyuiopasdfghjklzxcvbnm12";
    /**
     * 基于rsa的加解密方式
     */
    private SecurityRsa securityRsa;
    /**
     * 自定义token过滤器的拦截白名单
     */
    private List<String> whitelist;

    @Setter
    @Getter
    public static class SecurityRsa {
        private String publicKey;
        private String privateKey;
    }
}
