提交 f513eb61 编写于 作者: rushui.chen's avatar rushui.chen

Merge branch 'release' of...

Merge branch 'release' of 192.168.110.53:com.pica.cloud.account/pica-cloud-account into dev-20191224-registerSource
流水线 #19540 已失败 于阶段
in 0 second
...@@ -57,19 +57,15 @@ ...@@ -57,19 +57,15 @@
<dependency> <dependency>
<groupId>com.pica.cloud.foundation</groupId> <groupId>com.pica.cloud.foundation</groupId>
<artifactId>pica-cloud-service-starter</artifactId> <artifactId>pica-cloud-service-starter</artifactId>
<version>1.2.5-SNAPSHOT</version> <version>1.2.6-SNAPSHOT</version>
<exclusions> <exclusions>
<exclusion> <exclusion>
<groupId>com.pica.cloud.foundation</groupId>
<artifactId>pica-cloud-redis</artifactId> <artifactId>pica-cloud-redis</artifactId>
<groupId>com.pica.cloud.foundation</groupId>
</exclusion> </exclusion>
<exclusion> <exclusion>
<groupId>com.xuxueli</groupId> <artifactId>pica-cloud-entity</artifactId>
<artifactId>xxl-job-core</artifactId> <groupId>com.pica.cloud.foundation</groupId>
</exclusion>
<exclusion>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-stream-rabbit</artifactId>
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
...@@ -94,25 +90,7 @@ ...@@ -94,25 +90,7 @@
<dependency> <dependency>
<groupId>com.pica.cloud.foundation</groupId> <groupId>com.pica.cloud.foundation</groupId>
<artifactId>pica-cloud-utils</artifactId> <artifactId>pica-cloud-utils</artifactId>
<version>2.0.1-SNAPSHOT</version> <version>1.3.2-OLD</version>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</exclusion>
<exclusion>
<groupId>com.dianping.cat</groupId>
<artifactId>cat-client</artifactId>
</exclusion>
<exclusion>
<groupId>com.pica.cloud.foundation</groupId>
<artifactId>pica-cloud-entity</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<dependency> <dependency>
......
...@@ -52,9 +52,8 @@ public class AccountController extends AccountBaseController { ...@@ -52,9 +52,8 @@ public class AccountController extends AccountBaseController {
private AccountService accountService; private AccountService accountService;
@Autowired @Autowired
private CaptchaService captchaService; private CaptchaService captchaService;
@Autowired @Autowired
@Qualifier("cacheMigrateClient")
private ICacheClient redisClient; private ICacheClient redisClient;
@GetMapping("/test") @GetMapping("/test")
......
...@@ -54,7 +54,6 @@ public class AutoCodeController extends AccountBaseController { ...@@ -54,7 +54,6 @@ public class AutoCodeController extends AccountBaseController {
private AccountService accountService; private AccountService accountService;
@Autowired @Autowired
@Qualifier("cacheMigrateClient")
private ICacheClient cacheClient; private ICacheClient cacheClient;
......
...@@ -33,7 +33,6 @@ public class LoginController extends AccountBaseController { ...@@ -33,7 +33,6 @@ public class LoginController extends AccountBaseController {
private LoginService loginService; private LoginService loginService;
@Autowired @Autowired
@Qualifier("cacheMigrateClient")
private ICacheClient redisClient; private ICacheClient redisClient;
@Autowired @Autowired
......
package com.pica.cloud.account.account.server.controller;
import com.alibaba.fastjson.JSON;
import com.pica.cloud.foundation.entity.PicaResponse;
import com.pica.cloud.foundation.entity.PicaUser;
import com.pica.cloud.foundation.redis.ICacheClient;
import com.pica.cloud.foundation.service.starter.common.BaseController;
import com.pica.cloud.foundation.service.starter.interceptor.LoginPermission;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisSentinelPool;
import java.util.*;
@RestController
public class RedisTestController extends BaseController {
@Autowired
private ICacheClient redisClient;
@RequestMapping(value = "/redis", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
@LoginPermission
public PicaResponse<Map<String, String>> redis() {
// http://localhost:11501/hospital/hospitals/redis
// cluster
String token = getTokenFromHeader();
Map<String, String> map = new HashMap<>();
map.put("id", "1111111");
map.put("token", token);
map.put("sysCode", getSysCodeFromHeader());
try {
token = redisClient.saveToken(map, 3600);
} catch (Exception ex) {
// nothing to do
}
System.out.println(token);
Map<String, String> map1 = redisClient.getToken(token);
System.out.println(JSON.toJSON(map1));
PicaUser user = fetchPicaUser();
System.out.println(JSON.toJSON(user));
// sentinel
Set<String> set1 = new HashSet<>();
set1.add("192.168.140.27:17000");
set1.add("192.168.140.28:17000");
set1.add("192.168.140.29:17000");
JedisSentinelPool pool1 = new JedisSentinelPool("master01", set1, "Uu49Kz1olY85HQBu");
Jedis jedis1 = pool1.getResource();
System.out.println("sentinel dev - " + jedis1.get("token-" + token));
Set<String> set2 = new HashSet<>();
set2.add("192.168.110.68:17000");
set2.add("192.168.110.69:17001");
set2.add("192.168.110.70:17002");
JedisSentinelPool pool2 = new JedisSentinelPool("master01", set2, "Uu49Kz1olY85HQBu");
Jedis jedis2 = pool2.getResource();
System.out.println("sentinel test - " + jedis2.get("token-" + token));
Set<String> set3 = new HashSet<>();
set3.add("192.168.110.177:17000");
set3.add("192.168.110.178:17000");
set3.add("192.168.110.179:17000");
JedisSentinelPool pool3 = new JedisSentinelPool("master01", set3, "Uu49Kz1olY85HQBu");
Jedis jedis3 = pool3.getResource();
System.out.println("sentinel uat - " + jedis3.get("token-" + token));
redisClient.deleteToken(token);
try {
PicaUser user1 = fetchPicaUser();
} catch (Exception ex) {
System.out.println("Exception -> the user has been deleted");
}
Map<String, String> map2 = new HashMap<>();
map2.put("id", "1111111");
map2.put("token", token);
map2.put("sysCode", getSysCodeFromHeader());
try {
token = redisClient.saveToken(map2, 3600);
} catch (Exception ex) {
// nothing to do
}
String clusterKey = "cluster-key-001";
String clusterValue = "cluster-value-001";
redisClient.set(clusterKey, clusterValue);
System.out.println("cluster -> " + redisClient.get(clusterKey));
System.out.println("dev get cluster value -> " + pool1.getResource().get(clusterKey));
System.out.println("test1 get cluster value -> " + pool2.getResource().get(clusterKey));
System.out.println("uat get cluster value -> " + pool3.getResource().get(clusterKey));
String sentKey = "sent-key-001";
String sentValue = "sent-value-001";
pool1.getResource().set(sentKey, sentValue);
System.out.println("dev sentinel -> " + pool1.getResource().get(sentKey));
pool2.getResource().set(sentKey, sentValue);
System.out.println("test1 sentinel -> " + pool2.getResource().get(sentKey));
pool3.getResource().set(sentKey, sentValue);
System.out.println("uat sentinel -> " + pool3.getResource().get(sentKey));
return PicaResponse.toResponse(token);
}
}
...@@ -24,9 +24,6 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -24,9 +24,6 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/register") @RequestMapping("/register")
public class RegisterController extends AccountBaseController { public class RegisterController extends AccountBaseController {
@Autowired @Autowired
private RegisterService registerService; private RegisterService registerService;
...@@ -34,7 +31,6 @@ public class RegisterController extends AccountBaseController { ...@@ -34,7 +31,6 @@ public class RegisterController extends AccountBaseController {
private AccountUtils accountUtils; private AccountUtils accountUtils;
@Autowired @Autowired
@Qualifier("cacheMigrateClient")
private ICacheClient redisClient; private ICacheClient redisClient;
@ApiOperation("PC端,移动端注册接口") @ApiOperation("PC端,移动端注册接口")
......
...@@ -22,7 +22,7 @@ public class DoctorRepeatDataJob { ...@@ -22,7 +22,7 @@ public class DoctorRepeatDataJob {
private Logger logger = LoggerFactory.getLogger(this.getClass()); private Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired @Autowired
@Qualifier("cacheMigrateClient")
private ICacheClient cacheClient; private ICacheClient cacheClient;
@Autowired @Autowired
......
...@@ -38,7 +38,7 @@ public class AccountServiceImpl implements AccountService { ...@@ -38,7 +38,7 @@ public class AccountServiceImpl implements AccountService {
@Autowired @Autowired
private AccountInfoDetailMapper accountInfoDetailMapper; private AccountInfoDetailMapper accountInfoDetailMapper;
@Autowired @Autowired
@Qualifier("cacheMigrateClient")
private ICacheClient cacheClient; private ICacheClient cacheClient;
@Value("${doubleWritingMode}") @Value("${doubleWritingMode}")
......
...@@ -67,7 +67,7 @@ public class LoginServiceImpl implements LoginService { ...@@ -67,7 +67,7 @@ public class LoginServiceImpl implements LoginService {
private DoctorService doctorService; private DoctorService doctorService;
@Autowired @Autowired
@Qualifier("cacheMigrateClient")
private ICacheClient redisClient; private ICacheClient redisClient;
@Value("${doubleWritingMode}") @Value("${doubleWritingMode}")
......
...@@ -66,7 +66,7 @@ public class RegisterServiceImpl implements RegisterService { ...@@ -66,7 +66,7 @@ public class RegisterServiceImpl implements RegisterService {
private AgreementLogEntityMapper agreementLogEntityMapper; private AgreementLogEntityMapper agreementLogEntityMapper;
@Autowired @Autowired
@Qualifier("cacheMigrateClient")
private ICacheClient redisClient; private ICacheClient redisClient;
/** /**
......
...@@ -26,7 +26,7 @@ import static com.pica.cloud.foundation.utils.utils.json.Object2Map.objectToMapS ...@@ -26,7 +26,7 @@ import static com.pica.cloud.foundation.utils.utils.json.Object2Map.objectToMapS
public class TokenServiceImpl implements TokenService { public class TokenServiceImpl implements TokenService {
@Autowired @Autowired
@Qualifier("cacheMigrateClient")
private ICacheClient redisClient; private ICacheClient redisClient;
@Override @Override
......
...@@ -25,7 +25,7 @@ import org.springframework.stereotype.Component; ...@@ -25,7 +25,7 @@ import org.springframework.stereotype.Component;
public class AccountUtils { public class AccountUtils {
@Autowired @Autowired
@Qualifier("cacheMigrateClient")
private ICacheClient cacheClient; private ICacheClient cacheClient;
private Logger logger = LoggerFactory.getLogger(AccountController.class); private Logger logger = LoggerFactory.getLogger(AccountController.class);
......
...@@ -26,7 +26,7 @@ public class TokenUtils { ...@@ -26,7 +26,7 @@ public class TokenUtils {
private Logger logger = LoggerFactory.getLogger(this.getClass()); private Logger logger = LoggerFactory.getLogger(this.getClass());
@Autowired @Autowired
@Qualifier("cacheMigrateClient")
private ICacheClient cacheClient; private ICacheClient cacheClient;
@Autowired @Autowired
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册