package com.vci.starter.web.properties;
|
|
import com.vci.starter.web.annotation.config.VciConfigField;
|
import com.vci.starter.web.enumpck.DataBaseEnum;
|
import com.vci.starter.web.enumpck.LangCodeEnum;
|
import com.vci.starter.web.enumpck.SessionStorageTypeEnum;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.context.annotation.Configuration;
|
|
/**
|
* 会话相关的配置
|
* @author weidy
|
* @date 2020/2/27
|
*/
|
@Configuration
|
@ConfigurationProperties(prefix = "session")
|
public class VciSessionProperties {
|
|
/**
|
* 系统空闲时间,根据保密要求默认是10分钟
|
*/
|
private int sessionIdlTime = 10;
|
|
/**
|
* 会话信息存储的方式
|
*/
|
private String sessionInfoStorageType = SessionStorageTypeEnum.REDIS.getValue();
|
|
/**
|
* 数据库的类型,是在ObjectService中设置的,
|
*/
|
@VciConfigField(name = "databasePlatform",title = "数据库的类型",model = "public")
|
private String databasePlatform = DataBaseEnum.ORACLE.getValue();
|
|
/**
|
* 启动服务时是否清空会话信息,登录为当前平台控制时需要添加为true,登录是其他系统控制时设置为false
|
*/
|
private Boolean clearSessionOnStart = false;
|
|
/**
|
* 默认的语言编码
|
*/
|
private String defaultLangCode = LangCodeEnum.ZH_CN.getValue();
|
|
/**
|
* 是否开启客户端检查
|
*/
|
private boolean checkSessionTimeout;
|
|
/**
|
* 客户端判断超时轮询时间,单位为秒
|
*/
|
private int sessionInterval;
|
|
/**
|
* 超时提醒时间,单位为分钟
|
*/
|
private int sessionRemind;
|
|
/**
|
* 定时器里是否清除会话
|
*/
|
private boolean deleteSessionInTimer = false;
|
|
|
public int getSessionIdlTime() {
|
return sessionIdlTime;
|
}
|
|
public void setSessionIdlTime(int sessionIdlTime) {
|
this.sessionIdlTime = sessionIdlTime;
|
}
|
|
public String getSessionInfoStorageType() {
|
return sessionInfoStorageType;
|
}
|
|
public void setSessionInfoStorageType(String sessionInfoStorageType) {
|
this.sessionInfoStorageType = sessionInfoStorageType;
|
}
|
|
public String getDatabasePlatform() {
|
return databasePlatform;
|
}
|
|
public void setDatabasePlatform(String databasePlatform) {
|
this.databasePlatform = databasePlatform;
|
}
|
|
public String getDefaultLangCode() {
|
return defaultLangCode;
|
}
|
|
public void setDefaultLangCode(String defaultLangCode) {
|
this.defaultLangCode = defaultLangCode;
|
}
|
|
public boolean isClearSessionOnStart() {
|
return clearSessionOnStart;
|
}
|
|
public void setClearSessionOnStart(boolean clearSessionOnStart) {
|
this.clearSessionOnStart = clearSessionOnStart;
|
}
|
|
public boolean isCheckSessionTimeout() {
|
return checkSessionTimeout;
|
}
|
|
public void setCheckSessionTimeout(boolean checkSessionTimeout) {
|
this.checkSessionTimeout = checkSessionTimeout;
|
}
|
|
public int getSessionInterval() {
|
return sessionInterval;
|
}
|
|
public void setSessionInterval(int sessionInterval) {
|
this.sessionInterval = sessionInterval;
|
}
|
|
public int getSessionRemind() {
|
return sessionRemind;
|
}
|
|
public void setSessionRemind(int sessionRemind) {
|
this.sessionRemind = sessionRemind;
|
}
|
|
public boolean isDeleteSessionInTimer() {
|
return deleteSessionInTimer;
|
}
|
|
public void setDeleteSessionInTimer(boolean deleteSessionInTimer) {
|
this.deleteSessionInTimer = deleteSessionInTimer;
|
}
|
|
@Override
|
public String toString() {
|
return "VciSessionProperties{" +
|
"sessionIdlTime=" + sessionIdlTime +
|
", sessionInfoStorageType='" + sessionInfoStorageType + '\'' +
|
", databasePlatform='" + databasePlatform + '\'' +
|
", clearSessionOnStart=" + clearSessionOnStart +
|
", defaultLangCode='" + defaultLangCode + '\'' +
|
'}';
|
}
|
}
|