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
package com.everyday.word;
 
import com.everyday.word.entity.SystemEnum;
import com.everyday.word.entity.config.SystemConfig;
import com.everyday.word.entity.config.SystemConfigKeyEnum;
import com.everyday.word.exception.ParamsException;
import com.everyday.word.service.inter.config.SystemConfigService;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.yeshi.utils.tencentcloud.COSManager;
 
import javax.annotation.Resource;
import java.io.File;
 
/**
 * @author hxh
 * @title: RedisTest
 * @description: COS测试
 * @date 2025/2/13 10:11
 */
@SpringBootTest
public class ConfigTest {
 
    @Resource
    private SystemConfigService systemConfigService;
 
    @Test
    public void test() throws ParamsException {
        SystemConfig config = SystemConfig.builder()
                .system(SystemEnum.everyday_words)
                .key(SystemConfigKeyEnum.wxAppId.name())
                .value("wx82f0e543363453c6")
                .name(SystemConfigKeyEnum.wxAppId.getName())
                .build();
        systemConfigService.save(config);
 
        config = SystemConfig.builder()
                .system(SystemEnum.everyday_words)
                .key(SystemConfigKeyEnum.wxAppSecret.name())
                .value("8a6164408b9190d0b824f799ce0975b4")
                .name(SystemConfigKeyEnum.wxAppSecret.getName())
                .build();
        systemConfigService.save(config);
    }
 
 
}