package com.iplatform.chat.config;
|
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
|
@ConfigurationProperties(prefix = "iplatform.chat.mongo")
|
public class MongoChatProperties {
|
|
public String getIp() {
|
return ip;
|
}
|
|
public void setIp(String ip) {
|
this.ip = ip;
|
}
|
|
public int getPort() {
|
return port;
|
}
|
|
public void setPort(int port) {
|
this.port = port;
|
}
|
|
public String getDatabase() {
|
return database;
|
}
|
|
public void setDatabase(String database) {
|
this.database = database;
|
}
|
|
public String getUserName() {
|
return userName;
|
}
|
|
public void setUserName(String userName) {
|
this.userName = userName;
|
}
|
|
public String getPassword() {
|
return password;
|
}
|
|
public void setPassword(String password) {
|
this.password = password;
|
}
|
|
public int getMaxSize() {
|
return maxSize;
|
}
|
|
public void setMaxSize(int maxSize) {
|
this.maxSize = maxSize;
|
}
|
|
public int getMinSize() {
|
return minSize;
|
}
|
|
public void setMinSize(int minSize) {
|
this.minSize = minSize;
|
}
|
|
public long getMaxIdleTimeSeconds() {
|
return maxIdleTimeSeconds;
|
}
|
|
public void setMaxIdleTimeSeconds(long maxIdleTimeSeconds) {
|
this.maxIdleTimeSeconds = maxIdleTimeSeconds;
|
}
|
|
public long getMaxWaitTimeSeconds() {
|
return maxWaitTimeSeconds;
|
}
|
|
public void setMaxWaitTimeSeconds(long maxWaitTimeSeconds) {
|
this.maxWaitTimeSeconds = maxWaitTimeSeconds;
|
}
|
|
private String ip;
|
private int port = 27017;
|
private String database;
|
private String userName;
|
private String password;
|
private int maxSize = 100;
|
private int minSize = 10;
|
private long maxIdleTimeSeconds = 1200; // 连接最大空闲时间,20分钟
|
private long maxWaitTimeSeconds = 10; // 连接等待最大时间,10秒
|
|
@Override
|
public String toString() {
|
return "MongoChatProperties{" +
|
"ip='" + ip + '\'' +
|
", port=" + port +
|
", database='" + database + '\'' +
|
", userName='" + userName + '\'' +
|
", password='" + password + '\'' +
|
", maxSize=" + maxSize +
|
", minSize=" + minSize +
|
", maxIdleTimeSeconds=" + maxIdleTimeSeconds +
|
", maxWaitTimeSeconds=" + maxWaitTimeSeconds +
|
'}';
|
}
|
}
|