hejianhao
2026-08-28 16a57a8fc6868cea9171a1119698572407a2fc03
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
package com.tcm.training.admin.app.auth.config;
 
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
 
/**
 * APP 短信验证码登录配置。
 */
@Component
@ConfigurationProperties(prefix = "app.auth.sms")
public class AppSmsAuthProperties {
 
    /**
     * 短信验证码有效期,默认 300 秒,即 5 分钟。
     */
    private int expireSeconds = 300;
    private DebugScene login = new DebugScene();
    private DebugScene register = new DebugScene();
    private DebugScene passwordReset = new DebugScene();
    private DebugScene phoneChange = new DebugScene();
 
    /**
     * 获取验证码有效期秒数。
     */
    public int getExpireSeconds() {
        return expireSeconds;
    }
 
    /**
     * 设置验证码有效期秒数。
     */
    public void setExpireSeconds(int expireSeconds) {
        this.expireSeconds = expireSeconds;
    }
 
    /**
     * 获取短信登录调试验证码配置。
     */
    public DebugScene getLogin() {
        return login;
    }
 
    /**
     * 设置短信登录调试验证码配置。
     */
    public void setLogin(DebugScene login) {
        this.login = login;
    }
 
    /**
     * 获取注册调试验证码配置。
     */
    public DebugScene getRegister() {
        return register;
    }
 
    /**
     * 设置注册调试验证码配置。
     */
    public void setRegister(DebugScene register) {
        this.register = register;
    }
 
    /**
     * 获取重置密码调试验证码配置。
     */
    public DebugScene getPasswordReset() {
        return passwordReset;
    }
 
    /**
     * 设置重置密码调试验证码配置。
     */
    public void setPasswordReset(DebugScene passwordReset) {
        this.passwordReset = passwordReset;
    }
 
    /**
     * 获取修改手机号调试验证码配置。
     */
    public DebugScene getPhoneChange() {
        return phoneChange;
    }
 
    /**
     * 设置修改手机号调试验证码配置。
     */
    public void setPhoneChange(DebugScene phoneChange) {
        this.phoneChange = phoneChange;
    }
 
    /**
     * 单个短信验证码场景的调试配置。
     */
    public static class DebugScene {
 
        private boolean enabled = false;
        private String code = "";
 
        /**
         * 获取当前场景是否启用调试验证码。
         */
        public boolean isEnabled() {
            return enabled;
        }
 
        /**
         * 设置当前场景是否启用调试验证码。
         */
        public void setEnabled(boolean enabled) {
            this.enabled = enabled;
        }
 
        /**
         * 获取当前场景调试验证码。
         */
        public String getCode() {
            return code;
        }
 
        /**
         * 设置当前场景调试验证码。
         */
        public void setCode(String code) {
            this.code = code;
        }
    }
}