forked from lyj8330328/leyou
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
749048b
commit 8635c76
Showing
20 changed files
with
95 additions
and
98 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ spring: | |
name: gateway | ||
profile: dev | ||
label: master | ||
uri: http://172.31.179.200:10011 | ||
uri: http://127.0.0.1:10011 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ spring: | |
name: auth | ||
profile: dev | ||
label: master | ||
uri: http://172.31.179.200:10011 | ||
uri: http://127.0.0.1:10011 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ spring: | |
name: cart | ||
profile: dev | ||
label: master | ||
uri: http://172.31.179.200:10011 | ||
uri: http://127.0.0.1:10011 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ spring: | |
name: comments | ||
profile: dev | ||
label: master | ||
uri: http://172.31.179.200:10011 | ||
uri: http://127.0.0.1:10011 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ spring: | |
name: goodsweb | ||
profile: dev | ||
label: master | ||
uri: http://172.31.179.200:10011 | ||
uri: http://127.0.0.1:10011 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,63 @@ | ||
//import com.leyou.LyGoodsWebApplication; | ||
//import org.junit.Test; | ||
//import org.junit.runner.RunWith; | ||
//import org.springframework.beans.factory.annotation.Autowired; | ||
//import org.springframework.boot.test.context.SpringBootTest; | ||
//import org.springframework.data.redis.core.BoundHashOperations; | ||
//import org.springframework.data.redis.core.RedisTemplate; | ||
//import org.springframework.data.redis.core.StringRedisTemplate; | ||
//import org.springframework.test.context.junit4.SpringRunner; | ||
// | ||
//import java.util.HashMap; | ||
//import java.util.Map; | ||
//import java.util.concurrent.TimeUnit; | ||
// | ||
///** | ||
// * @Author: 98050 | ||
// * @Time: 2018-10-25 22:58 | ||
// * @Feature: | ||
// */ | ||
//@RunWith(SpringRunner.class) | ||
//@SpringBootTest(classes = LyGoodsWebApplication.class) | ||
//public class RedisTest { | ||
// | ||
// @Autowired | ||
// private StringRedisTemplate stringRedisTemplate; | ||
// | ||
// @Autowired | ||
// private RedisTemplate<String, String> redisTemplate; | ||
// | ||
// private static final String KEY_PREFIX = "leyou:seckill:test"; | ||
// | ||
// @Test | ||
// public void testRedisObj() { | ||
// //redisTemplate.opsForValue().set("111111111","2222221231232222222"); | ||
// //redisTemplate.opsForValue().set("key","1"); | ||
// redisTemplate.opsForValue().increment("key",1); | ||
// } | ||
// | ||
// | ||
// @Test | ||
// public void test(){ | ||
// BoundHashOperations<String,Object,Object> hashOperations = this.stringRedisTemplate.boundHashOps("leyou:goods:detail:1"); | ||
// hashOperations.put("1","22222222"); | ||
// //hashOperations.expire(10, TimeUnit.SECONDS); | ||
// } | ||
// | ||
// @Test | ||
// public void redisTest(){ | ||
// Map<String,String> result = new HashMap<>(); | ||
// BoundHashOperations<String,Object,Object> hashOperations = this.stringRedisTemplate.boundHashOps(KEY_PREFIX); | ||
// hashOperations.put("1", "22"); | ||
// hashOperations.put("2", "22"); | ||
// hashOperations.put("3", "22"); | ||
// | ||
// | ||
// System.out.println("---------------------------------------------------------"); | ||
// hashOperations.entries().forEach((m,n) ->{ | ||
// System.out.println("key:" + m + "," + n); | ||
// }); | ||
// } | ||
//} | ||
import com.leyou.LyGoodsWebApplication; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
import org.springframework.data.redis.core.BoundHashOperations; | ||
import org.springframework.data.redis.core.BoundValueOperations; | ||
import org.springframework.data.redis.core.RedisTemplate; | ||
import org.springframework.data.redis.core.StringRedisTemplate; | ||
import org.springframework.test.context.junit4.SpringRunner; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
/** | ||
* @Author: 98050 | ||
* @Time: 2018-10-25 22:58 | ||
* @Feature: | ||
*/ | ||
@RunWith(SpringRunner.class) | ||
@SpringBootTest(classes = LyGoodsWebApplication.class) | ||
public class RedisTest { | ||
|
||
@Autowired | ||
private StringRedisTemplate stringRedisTemplate; | ||
|
||
@Autowired | ||
private RedisTemplate<String, String> redisTemplate; | ||
|
||
private static final String KEY_PREFIX = "leyou:seckill:test"; | ||
|
||
@Test | ||
public void testRedisObj() { | ||
//redisTemplate.opsForValue().set("111111111","2222221231232222222"); | ||
//redisTemplate.opsForValue().set("key","1"); | ||
redisTemplate.opsForValue().increment("key",1); | ||
} | ||
|
||
|
||
@Test | ||
public void test(){ | ||
BoundHashOperations<String,Object,Long> hashOperations = this.stringRedisTemplate.boundHashOps("leyou:goods:detail:1"); | ||
BoundValueOperations<String, String> valueOperations = this.stringRedisTemplate.boundValueOps("leyou:goods:detail:1"); | ||
valueOperations.set("123", 1); | ||
//hashOperations.increment("123", 2); | ||
//hashOperations.expire(10, TimeUnit.SECONDS); | ||
} | ||
|
||
@Test | ||
public void redisTest(){ | ||
Map<String,String> result = new HashMap<>(); | ||
BoundHashOperations<String,Object,Object> hashOperations = this.stringRedisTemplate.boundHashOps(KEY_PREFIX); | ||
hashOperations.put("1", "22"); | ||
hashOperations.put("2", "22"); | ||
hashOperations.put("3", "22"); | ||
|
||
|
||
System.out.println("---------------------------------------------------------"); | ||
hashOperations.entries().forEach((m,n) ->{ | ||
System.out.println("key:" + m + "," + n); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ spring: | |
name: item | ||
profile: dev | ||
label: master | ||
uri: http://172.31.179.200:10011 | ||
uri: http://127.0.0.1:10011 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ spring: | |
name: order | ||
profile: dev | ||
label: master | ||
uri: http://172.31.179.200:10011 | ||
uri: http://127.0.0.1:10011 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ spring: | |
name: registry | ||
profile: dev | ||
label: master | ||
uri: http://172.31.179.200:10011 | ||
uri: http://127.0.0.1:10011 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ spring: | |
name: search | ||
profile: dev | ||
label: master | ||
uri: http://172.31.179.200:10011 | ||
uri: http://127.0.0.1:10011 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ spring: | |
name: seckill | ||
profile: dev | ||
label: master | ||
uri: http://172.31.179.200:10011 | ||
uri: http://127.0.0.1:10011 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ spring: | |
name: sms | ||
profile: dev | ||
label: master | ||
uri: http://172.31.179.200:10011 | ||
uri: http://127.0.0.1:10011 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ spring: | |
name: upload | ||
profile: dev | ||
label: master | ||
uri: http://172.31.179.200:10011 | ||
uri: http://127.0.0.1:10011 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ spring: | |
name: user | ||
profile: dev | ||
label: master | ||
uri: http://172.31.179.200:10011 | ||
uri: http://127.0.0.1:10011 |