admin
2021-11-19 7511509c68bd2892aad48a0612d497387660214d
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
package test;
 
import com.yeshi.location.app.Application;
import com.yeshi.location.app.entity.SystemEnum;
import com.yeshi.location.app.entity.config.SystemConfig;
import com.yeshi.location.app.entity.config.SystemConfigKey;
import com.yeshi.location.app.service.inter.config.SystemConfigService;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
 
import javax.annotation.Resource;
 
/**
 * @author hxh
 * @title: ConfigTest
 * @description: TODO
 * @date 2021/11/16 14:08
 */
@SpringBootTest(classes = Application.class)
public class ConfigTest {
 
    @Resource
    private SystemConfigService systemConfigService;
 
    @Test
    public void addConfig() throws Exception {
        SystemConfig config = new SystemConfig();
        config.setKey(SystemConfigKey.defaultNickNamePrefix);
        config.setName(config.getKey().getDesc());
        config.setSystem(SystemEnum.location);
        config.setValue("定位_");
        systemConfigService.save(config);
 
        config = new SystemConfig();
        config.setKey(SystemConfigKey.defaultPortrait);
        config.setName(config.getKey().getDesc());
        config.setSystem(SystemEnum.location);
        config.setValue("https://location-1255749512.cos.ap-nanjing.myqcloud.com/resource/img/default_img.png");
        systemConfigService.save(config);
 
 
        config = new SystemConfig();
        config.setKey(SystemConfigKey.aliyunOneKeyAuthAcessKey);
        config.setName(config.getKey().getDesc());
        config.setSystem(SystemEnum.location);
        config.setValue("LTAI4FwmTxVCuzTaoZtDiV8z");
        systemConfigService.save(config);
 
        config = new SystemConfig();
        config.setKey(SystemConfigKey.aliyunOneKeyAuthAcessSecret);
        config.setName(config.getKey().getDesc());
        config.setSystem(SystemEnum.location);
        config.setValue("ixWg90QbYFKP6ae5xpAo2P1qwIyll5");
        systemConfigService.save(config);
 
        config = new SystemConfig();
        config.setKey(SystemConfigKey.tencentSMSAppId);
        config.setName(config.getKey().getDesc());
        config.setSystem(SystemEnum.location);
        config.setValue("1400598415");
        systemConfigService.save(config);
 
 
        config = new SystemConfig();
        config.setKey(SystemConfigKey.tencentSMSAppKey);
        config.setName(config.getKey().getDesc());
        config.setSystem(SystemEnum.location);
        config.setValue("1f61c060b36c5b5f2e8f5291cfdb964c");
        systemConfigService.save(config);
 
 
 
        config = new SystemConfig();
        config.setKey(SystemConfigKey.signKey);
        config.setName(config.getKey().getDesc());
        config.setSystem(SystemEnum.location);
        config.setValue("@#$^234AB&c&fg&.==888");
        systemConfigService.save(config);
 
 
        config = new SystemConfig();
        config.setKey(SystemConfigKey.tencentVerifySMSTemplate);
        config.setName(config.getKey().getDesc());
        config.setSystem(SystemEnum.location);
        config.setValue("【智在千里】验证码:{验证码},2分钟内有效。为了保护您的账号安全,验证短信请勿转发他人。");
        systemConfigService.save(config);
 
    }
 
}