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);
|
}
|
|
|
}
|