wexin-java升级4.0.0
springboot升级2.4.1
This commit is contained in:
@ -12,7 +12,7 @@
|
||||
<artifactId>yshop-common</artifactId>
|
||||
<name>公共模块</name>
|
||||
<properties>
|
||||
<weixin-java.version>3.9.0</weixin-java.version>
|
||||
<weixin-java.version>4.0.0</weixin-java.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
|
@ -8,6 +8,7 @@ package co.yixiang.utils;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@ -66,7 +67,7 @@ public class RedisUtil {
|
||||
if(key.length==1){
|
||||
redisTemplate.delete(key[0]);
|
||||
}else{
|
||||
redisTemplate.delete(CollectionUtils.arrayToList(key));
|
||||
redisTemplate.delete((Collection<String>) CollectionUtils.arrayToList(key));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,36 +0,0 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.utils;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
public class EncryptUtilsTest {
|
||||
|
||||
/**
|
||||
* 对称加密
|
||||
*/
|
||||
@Test
|
||||
public void testDesEncrypt() {
|
||||
try {
|
||||
Assert.assertEquals("7772841DC6099402", EncryptUtils.desEncrypt("123456"));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 对称解密
|
||||
*/
|
||||
@Test
|
||||
public void testDesDecrypt() {
|
||||
try {
|
||||
Assert.assertEquals("123456", EncryptUtils.desDecrypt("7772841DC6099402"));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2020
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
|
||||
*/
|
||||
package co.yixiang.utils;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.springframework.mock.web.MockMultipartFile;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
public class FileUtilTest {
|
||||
|
||||
@Test
|
||||
public void testToFile() {
|
||||
long retval = FileUtil.toFile(new MockMultipartFile("foo", (byte[]) null)).getTotalSpace();
|
||||
assertEquals(500695072768L, retval);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetExtensionName() {
|
||||
Assert.assertEquals("foo", FileUtil.getExtensionName("foo"));
|
||||
Assert.assertEquals("exe", FileUtil.getExtensionName("bar.exe"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetFileNameNoEx() {
|
||||
Assert.assertEquals("foo", FileUtil.getFileNameNoEx("foo"));
|
||||
Assert.assertEquals("bar", FileUtil.getFileNameNoEx("bar.txt"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetSize() {
|
||||
Assert.assertEquals("1000B ", FileUtil.getSize(1000));
|
||||
Assert.assertEquals("1.00KB ", FileUtil.getSize(1024));
|
||||
Assert.assertEquals("1.00MB ", FileUtil.getSize(1048576));
|
||||
Assert.assertEquals("1.00GB ", FileUtil.getSize(1073741824));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user