Sfoglia il codice sorgente

@IPU_FIXBUG_2021@使用迅捷redis

weihf 4 anni fa
parent
commit
40fc9039b9

+ 5 - 5
ipu-rest-demo/src/main/java/com/ai/ipu/server/demo/control/cache/RedisController.java

@ -51,7 +51,7 @@ public class RedisController {
51 51
    @RequestMapping("/get")
52 52
    public JMap get(JMap param) throws Exception {
53 53
		JMap result = new JsonMap();
54
		final String CACHE_KEY = "com:ai:ipu:rest-scaffold:test";
54
		final String CACHE_KEY = "com:ai:ipu:rest-demo:test";
55 55
		final String DEFAULT_CONN_NAME = "ssn";
56 56
		String connName = param.getString("connName", DEFAULT_CONN_NAME);
57 57
		String key = param.getString("key", CACHE_KEY);
@ -75,9 +75,9 @@ public class RedisController {
75 75
	
76 76
	@ResponseBody
77 77
    @RequestMapping("/put")
78
    public JMap syncIpuConfigUsingIpuNosql(JMap param) throws Exception {
78
    public JMap put(JMap param) throws Exception {
79 79
		JMap result = new JsonMap();
80
		final String CACHE_KEY = "com:ai:ipu:rest-scaffold:test";
80
		final String CACHE_KEY = "com:ai:ipu:rest-demo:test";
81 81
		final String CACHE_VALUE = "123";
82 82
		final String DEFAULT_CONN_NAME = "ssn";
83 83
		String connName = param.getString("connName", DEFAULT_CONN_NAME);
@ -103,9 +103,9 @@ public class RedisController {
103 103
	
104 104
	@ResponseBody
105 105
    @RequestMapping("/delete")
106
    public JMap syncIpuConfigUsingIpuS3(JMap param) throws Exception {
106
    public JMap delete(JMap param) throws Exception {
107 107
		JMap result = new JsonMap();
108
		final String CACHE_KEY = "com:ai:ipu:rest-scaffold:test";
108
		final String CACHE_KEY = "com:ai:ipu:rest-demo:test";
109 109
		final String DEFAULT_CONN_NAME = "ssn";
110 110
		String connName = param.getString("connName", DEFAULT_CONN_NAME);
111 111
		String key = param.getString("key", CACHE_KEY);

+ 3 - 1
ipu-rest-demo/src/main/resources/dev/ipu-cache.xml

@ -4,7 +4,9 @@
4 4
	<cache name="ssn" type="redis">
5 5
		<servers>
6 6
	        <!-- 如果不是cluster,则只使用第一个redis -->
7
	        <server ip="192.168.128.132" port="6370" />
7
	        <server ip="47.105.160.21" port="7101" />
8
	        <server ip="47.105.160.21" port="7102" />
9
	        <server ip="47.105.160.21" port="7103" />
8 10
	    </servers>
9 11
		<!-- 客户端类型:Jedis,JedisCluster,JedisSentinel -->
10 12
	    <config name="clientType" value="Jedis"/>