新增声明包
This commit is contained in:
parent
ff57ed324f
commit
31cb9c5b55
23
pom.xml
23
pom.xml
|
@ -53,6 +53,11 @@
|
|||
<thymeleaf.version>3.0.9.RELEASE</thymeleaf.version>
|
||||
<thymeleaf-layout-dialect.version>2.3.0</thymeleaf-layout-dialect.version>
|
||||
<thymeleaf-extras-springsecurity4.version>3.0.2.RELEASE</thymeleaf-extras-springsecurity4.version>
|
||||
|
||||
<reflectasm.version>1.09</reflectasm.version>
|
||||
<!--dubbo-->
|
||||
<dubbo-spring-boot-starter.version>0.2.0</dubbo-spring-boot-starter.version>
|
||||
<mybatis-plus.version>3.0.3</mybatis-plus.version>
|
||||
</properties>
|
||||
<!-- 声明包版本 继承项目自引入 -->
|
||||
<dependencyManagement>
|
||||
|
@ -176,6 +181,24 @@
|
|||
<classifier>jar-with-dependencies</classifier>
|
||||
</dependency>
|
||||
|
||||
<!-- copy对象 -->
|
||||
<dependency>
|
||||
<groupId>com.esotericsoftware.reflectasm</groupId>
|
||||
<artifactId>reflectasm</artifactId>
|
||||
<version>${reflectasm.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba.boot</groupId>
|
||||
<artifactId>dubbo-spring-boot-starter</artifactId>
|
||||
<version>${dubbo-spring-boot-starter.version}</version>
|
||||
</dependency>
|
||||
<!-- springboot mybatis-plus-->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<version>${mybatis-plus.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.yexuejc.springboot.base.test;
|
|||
|
||||
import com.yexuejc.base.util.JsonUtil;
|
||||
import com.yexuejc.springboot.base.ApplicationRun;
|
||||
import com.yexuejc.springboot.base.autoconfigure.MutiRedisAutoConfiguration;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -25,30 +26,33 @@ import java.util.concurrent.TimeUnit;
|
|||
@SpringBootTest(classes = ApplicationRun.class)
|
||||
public class RedisTest {
|
||||
@Autowired
|
||||
@Qualifier(RedisAutoConfiguration.BEAN_REDIS_TEMPLATE0)
|
||||
@Qualifier(MutiRedisAutoConfiguration.BEAN_REDIS_TEMPLATE0)
|
||||
RedisTemplate redisTemplate;
|
||||
|
||||
@Test
|
||||
public void insert() {
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("a","b");
|
||||
map.put("c",1);
|
||||
map.put("aac",true);
|
||||
map.put("q","asdb");
|
||||
redisTemplate.opsForHash().putAll("test.redis",map);
|
||||
redisTemplate.expire("test.redis",10, TimeUnit.MINUTES);
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("a", "b");
|
||||
map.put("c", 1);
|
||||
map.put("aac", true);
|
||||
map.put("q", "asdb");
|
||||
redisTemplate.opsForHash().putAll("test.redis", map);
|
||||
redisTemplate.expire("test.redis", 10, TimeUnit.MINUTES);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void get() {
|
||||
Map<String,Object> map = redisTemplate.opsForHash().entries("test.redis");
|
||||
Map<String, Object> map = redisTemplate.opsForHash().entries("test.redis");
|
||||
System.out.println(JsonUtil.obj2Json(map));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void update() {
|
||||
Map<String,Object> map = redisTemplate.opsForHash().entries("test.redis");
|
||||
redisTemplate.opsForHash().put("test.redis","q","123456798");
|
||||
Map<String, Object> map = redisTemplate.opsForHash().entries("test.redis");
|
||||
redisTemplate.opsForHash().put("test.redis", "q", "123456798");
|
||||
System.out.println(JsonUtil.obj2Json(map));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void del() {
|
||||
Boolean delete = redisTemplate.delete("test.redis");
|
||||
|
|
Loading…
Reference in New Issue