package com.wgcloud.config; import lombok.Data; import org.apache.commons.lang3.StringUtils; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.context.annotation.Configuration; @Data @Configuration @ConfigurationProperties(prefix = "base") public class CommonConfig { //admin管理员密码 private String account = "admin"; private String accountPwd = "111111"; private String guestAccount = "guest"; private String guestAccountPwd = "111111"; private String wgToken = ""; private String dashView; private String dashViewIpHide; private String dapingView; private Integer dbTableTimes = 3600; private Integer heathTimes = 600; private Integer dceTimes = 900; private Integer snmpTimes = 900; private Integer warnCacheTimes = 7200; private String nodeType = "master"; private Integer historyDataOut = 10; private Integer pageSize = 20; private String copyRight; private String icoUrl = ""; private String logoUrl = ""; private String wgName = ""; private String wgShortName = ""; private String webSsh; private Integer webSshPort = 9998; private String sidebarCollapse; private String showWarnCount; private String shellToRun; private String shellToRunLinuxBlock; private String shellToRunWinBlock; private String sqlInKeys; private String daemonUrl; private String mailTitlePrefix; private String mailContentSuffix; private String hostGroup; private String userInfoManage; public String getAccount() { return account; } public void setAccount(String account) { this.account = account; } public String getAccountPwd() { return accountPwd; } public void setAccountPwd(String accountPwd) { this.accountPwd = accountPwd; } public String getWgToken() { return wgToken; } public void setWgToken(String wgToken) { this.wgToken = wgToken; } public String getDashView() { if (StringUtils.isEmpty(dashView)) { return "true"; } return dashView; } public void setDashView(String dashView) { this.dashView = dashView; } public Integer getDbTableTimes() { if (dbTableTimes == null) { return 3600; } return dbTableTimes; } public void setDbTableTimes(Integer dbTableTimes) { this.dbTableTimes = dbTableTimes; } public Integer getHeathTimes() { if (heathTimes == null) { return 600; } return heathTimes; } public void setHeathTimes(Integer heathTimes) { this.heathTimes = heathTimes; } public String getNodeType() { return nodeType; } public void setNodeType(String nodeType) { this.nodeType = nodeType; } public Integer getHistoryDataOut() { if (historyDataOut == null) { return 10; } return historyDataOut; } public void setHistoryDataOut(Integer historyDataOut) { this.historyDataOut = historyDataOut; } public Integer getWarnCacheTimes() { if (warnCacheTimes == null) { return 3600; } return warnCacheTimes; } public void setWarnCacheTimes(Integer warnCacheTimes) { this.warnCacheTimes = warnCacheTimes; } public String getIcoUrl() { return icoUrl; } public void setIcoUrl(String icoUrl) { this.icoUrl = icoUrl; } public String getLogoUrl() { return logoUrl; } public void setLogoUrl(String logoUrl) { this.logoUrl = logoUrl; } public String getWgName() { return wgName; } public void setWgName(String wgName) { this.wgName = wgName; } public String getWgShortName() { return wgShortName; } public void setWgShortName(String wgShortName) { this.wgShortName = wgShortName; } public String getDapingView() { if (StringUtils.isEmpty(dapingView)) { return "true"; } return dapingView; } public void setDapingView(String dapingView) { this.dapingView = dapingView; } public String getWebSsh() { if (StringUtils.isEmpty(webSsh)) { return "true"; } return webSsh; } public void setWebSsh(String webSsh) { this.webSsh = webSsh; } public Integer getWebSshPort() { if (warnCacheTimes == null) { return 9998; } return webSshPort; } public void setWebSshPort(Integer webSshPort) { this.webSshPort = webSshPort; } public Integer getDceTimes() { if (dceTimes == null) { return 900; } return dceTimes; } public void setDceTimes(Integer dceTimes) { this.dceTimes = dceTimes; } public String getSidebarCollapse() { if (StringUtils.isEmpty(sidebarCollapse) || "true".equals(sidebarCollapse)) { //自动闭合左侧菜单class return "sidebar-mini sidebar-collapse"; } //自动展开左侧菜单class return "hold-transition sidebar-mini layout-fixed"; } public void setSidebarCollapse(String sidebarCollapse) { this.sidebarCollapse = sidebarCollapse; } public String getShellToRun() { if (StringUtils.isEmpty(shellToRun)) { return "false"; } return shellToRun; } public void setShellToRun(String shellToRun) { this.shellToRun = shellToRun; } public String getShellToRunLinuxBlock() { return shellToRunLinuxBlock; } public void setShellToRunLinuxBlock(String shellToRunLinuxBlock) { this.shellToRunLinuxBlock = shellToRunLinuxBlock; } public String getShellToRunWinBlock() { return shellToRunWinBlock; } public void setShellToRunWinBlock(String shellToRunWinBlock) { this.shellToRunWinBlock = shellToRunWinBlock; } public String getDaemonUrl() { if (StringUtils.isEmpty(daemonUrl)) { return "http://localhost:9997"; } return daemonUrl; } public void setDaemonUrl(String daemonUrl) { this.daemonUrl = daemonUrl; } public String getGuestAccount() { return guestAccount; } public void setGuestAccount(String guestAccount) { this.guestAccount = guestAccount; } public String getGuestAccountPwd() { return guestAccountPwd; } public void setGuestAccountPwd(String guestAccountPwd) { this.guestAccountPwd = guestAccountPwd; } public String getMailTitlePrefix() { return mailTitlePrefix; } public void setMailTitlePrefix(String mailTitlePrefix) { this.mailTitlePrefix = mailTitlePrefix; } public String getMailContentSuffix() { return mailContentSuffix; } public void setMailContentSuffix(String mailContentSuffix) { this.mailContentSuffix = mailContentSuffix; } public String getHostGroup() { if (StringUtils.isEmpty(hostGroup)) { return "false"; } return hostGroup; } public void setHostGroup(String hostGroup) { this.hostGroup = hostGroup; } public String getUserInfoManage() { if (StringUtils.isEmpty(userInfoManage)) { return "false"; } return userInfoManage; } public void setUserInfoManage(String userInfoManage) { this.userInfoManage = userInfoManage; } public String getCopyRight() { if (StringUtils.isEmpty(copyRight)) { return "true"; } return copyRight; } public void setCopyRight(String copyRight) { this.copyRight = copyRight; } public Integer getPageSize() { if (pageSize < 10) { pageSize = 10; } return pageSize; } public void setPageSize(Integer pageSize) { this.pageSize = pageSize; } public Integer getSnmpTimes() { if (snmpTimes == null) { return 1200; } return snmpTimes; } public void setSnmpTimes(Integer snmpTimes) { this.snmpTimes = snmpTimes; } public String getSqlInKeys() { if (StringUtils.isEmpty(sqlInKeys)) { return "execute ,delete ,drop ,alter ,rename ,modify "; } return sqlInKeys; } public void setSqlInKeys(String sqlInKeys) { this.sqlInKeys = sqlInKeys; } public String getShowWarnCount() { if (StringUtils.isEmpty(showWarnCount)) { return "false"; } return showWarnCount; } public void setShowWarnCount(String showWarnCount) { this.showWarnCount = showWarnCount; } public String getDashViewIpHide() { if (StringUtils.isEmpty(dashViewIpHide)) { return "true"; } return dashViewIpHide; } public void setDashViewIpHide(String dashViewIpHide) { this.dashViewIpHide = dashViewIpHide; } }