ClientConfig
程序员文章站
2022-07-10 13:34:22
...
package com.pingan.ff.btoam.demo.service;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@Component
public class ClientConfig {
@Value("${client.connectTimeout}")
private String connectTimeout;
@Value("${client.readTimeout}")
private String readTimeout = "60000";
@Value("${client.privateKey}")
private String privateKey;
@Value("${server.aesKey}")
private String aesKey;
@Value("${server.url}")
private String gateWayUrl;
@Value("${server.publicKey}")
private String publicKey;
public String getConnectTimeout() {
if(StringUtils.isEmpty(connectTimeout)){
return "60000";
}
return connectTimeout;
}
public String getReadTimeout() {
if(StringUtils.isEmpty(readTimeout)){
return "60000";
}
return readTimeout;
}
public String getAesKey() {
return aesKey;
}
public String getGateWayUrl() {
return gateWayUrl;
}
public String getPublicKey() {
return publicKey;
}
public String getPrivateKey() {
return privateKey;
}
public void setConnectTimeout(String connectTimeout) {
this.connectTimeout = connectTimeout;
}
public void setReadTimeout(String readTimeout) {
this.readTimeout = readTimeout;
}
public void setPrivateKey(String privateKey) {
this.privateKey = privateKey;
}
public void setAesKey(String aesKey) {
this.aesKey = aesKey;
}
public void setGateWayUrl(String gateWayUrl) {
this.gateWayUrl = gateWayUrl;
}
public void setPublicKey(String publicKey) {
this.publicKey = publicKey;
}
}
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
@Component
public class ClientConfig {
@Value("${client.connectTimeout}")
private String connectTimeout;
@Value("${client.readTimeout}")
private String readTimeout = "60000";
@Value("${client.privateKey}")
private String privateKey;
@Value("${server.aesKey}")
private String aesKey;
@Value("${server.url}")
private String gateWayUrl;
@Value("${server.publicKey}")
private String publicKey;
public String getConnectTimeout() {
if(StringUtils.isEmpty(connectTimeout)){
return "60000";
}
return connectTimeout;
}
public String getReadTimeout() {
if(StringUtils.isEmpty(readTimeout)){
return "60000";
}
return readTimeout;
}
public String getAesKey() {
return aesKey;
}
public String getGateWayUrl() {
return gateWayUrl;
}
public String getPublicKey() {
return publicKey;
}
public String getPrivateKey() {
return privateKey;
}
public void setConnectTimeout(String connectTimeout) {
this.connectTimeout = connectTimeout;
}
public void setReadTimeout(String readTimeout) {
this.readTimeout = readTimeout;
}
public void setPrivateKey(String privateKey) {
this.privateKey = privateKey;
}
public void setAesKey(String aesKey) {
this.aesKey = aesKey;
}
public void setGateWayUrl(String gateWayUrl) {
this.gateWayUrl = gateWayUrl;
}
public void setPublicKey(String publicKey) {
this.publicKey = publicKey;
}
}
上一篇: 2K高刷+骁龙870!小米平板5系列将登陆欧洲市场:涨价上千元
下一篇: 测试一下
推荐阅读