skyouc
4 天以前 14ddde5c41d8d98fc9b67ebae72b6cdbca73330b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
package com.vincent.rsf.server.common.config;
 
import com.vincent.rsf.common.enums.SystemModeType;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
 
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
 
/**
 * 系统配置属性
 *
 * @author vincent
 * @since 2021-08-30 17:58:16
 */
@Data
@Configuration
@ConfigurationProperties(prefix = "config")
public class ConfigProperties {
 
    /**
     * token过期时间, 单位秒
     */
    private Long tokenExpireTime = (long) (60 * 60 * 24 * 7);
 
    /**
     * token快要过期自动刷新时间, 单位分钟
     */
    private int tokenRefreshTime = 30;
 
    /**
     * 生成token的密钥Key的base64字符
     */
    private String tokenKey;
 
    /**
     * 系统名称
     */
    private String systemName;
 
    /**
     * 系统版本
     */
    private String systemVersion;
 
    /**
     * 系统模式( ONLINE / OFFLINE )
     */
    private String systemMode;
 
    /**
     * 超级管理员
     */
    private String superUsername;
 
    /**
     * 验证码长度
     */
    private Integer codeLength = 4;
 
    /**
     * 验证码有效期 ( 秒 )
     */
    private Integer codeTime = 300;
 
    /**
     * 超级验证码
     */
    private String securityCode;
 
    public List<String> getSuperUserList() {
        return Arrays.stream(superUsername.split(",")).collect(Collectors.toList());
    }
 
    public SystemModeType getSystemMode() {
        return SystemModeType.valueOf(systemMode);
    }
 
}