Commit 07edc08c authored by xiaozhe.chen's avatar xiaozhe.chen

添加修改手机号后台管理接口

parent ff68ae55
......@@ -23,7 +23,7 @@ import java.util.Properties;
@Configuration
@EnableJpaRepositories(basePackages = "cn.quantgroup.customer.repo")
@EnableTransactionManagement
public class DBConfig {
public class DbConfig {
@Value("${data.mysql.jdbc-url}")
private String jdbcUrl;
......
......@@ -28,7 +28,8 @@ import java.util.concurrent.ConcurrentHashMap;
threading = ThreadingBehavior.IMMUTABLE
)
public class HttpRequestRetryHandler extends DefaultHttpRequestRetryHandler {
private static final String POST = "POST";
private static final String TIME_OUT = "Read timed out";
private final Map<String, Boolean> idempotentMethods;
/**
......@@ -79,8 +80,8 @@ public class HttpRequestRetryHandler extends DefaultHttpRequestRetryHandler {
final HttpClientContext clientContext = HttpClientContext.adapt(context);
final HttpRequest request = clientContext.getRequest();
String method = request.getRequestLine().getMethod().toUpperCase(Locale.ROOT);
if ("POST".equals(method)) {
if (!StringUtils.containsIgnoreCase(exception.getMessage(), "Read timed out")) {
if (POST.equals(method)) {
if (!StringUtils.containsIgnoreCase(exception.getMessage(), TIME_OUT)) {
return super.retryRequest(exception, executionCount, context);
} else {
return false;
......
......@@ -24,6 +24,8 @@ import java.util.Objects;
@Component
public class RestTemplateServiceImpl implements IHttpService {
private static final String LEFT_BRACES = "{", RIGHT_BRACES = "}", Q_MARK = "?";
@Autowired
private RestTemplate restTemplate;
......@@ -63,17 +65,17 @@ public class RestTemplateServiceImpl implements IHttpService {
private String buildUrl(String uri, Map<String, ?> parameters) {
StringBuilder builder = new StringBuilder(uri);
if (!parameters.isEmpty()) {
if (uri.indexOf("{") > 0 && uri.indexOf("}") > 0) {
if (uri.indexOf(LEFT_BRACES) > 0 && uri.indexOf(RIGHT_BRACES) > 0) {
//存在匹配不进行处理
} else {
if (uri.indexOf("?") == -1) {
builder.append("?");
} else if (!uri.endsWith("?")) {
builder.append(Q_MARK);
} else if (!uri.endsWith(Q_MARK)) {
builder.append("&");
}
int i = 0, j = parameters.keySet().size();
for (String s : parameters.keySet()) {
builder.append(s).append("={").append(s).append("}");
builder.append(s).append("=").append(LEFT_BRACES).append(s).append(RIGHT_BRACES);
i++;
if (j != i) {
builder.append("&");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment