配置是否开启恩科组会功能

This commit is contained in:
wangliwen 2022-12-10 16:09:53 +08:00
parent ac188e41eb
commit 14bbde1103
2 changed files with 21 additions and 7 deletions

View File

@ -11,11 +11,13 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import sw.vc3term.contingencyplan.ContingencyPlanUtil;
import javax.annotation.PostConstruct;
import java.io.UnsupportedEncodingException;
import java.net.Inet4Address;
import java.net.InetAddress;
@ -39,19 +41,27 @@ public class EnkeController {
private static final String videoConfernceIp = "35.1.190.62";
private static final int videoConferncePort = 8756;
private static final ContingencyPlanUtil cp;
private static ContingencyPlanUtil cp = null;
private static final Logger logger = LoggerFactory.getLogger(ActHistoryService.class);
@Autowired
private EnkeService enkeService;
@Value("#{new Boolean(${enke.enable})}")
private Boolean enke; // 是否进行恩科会议组会
static {
cp = ContingencyPlanUtil.getInstance();
// 初始化会议
cp.init(videoConfernceIp, videoConferncePort);
List<String> ips = getLocalIP();
cp.setLocalAddress(CollectionUtils.isEmpty(ips) ? "0.0.0.0" : ips.get(0), ContingencyPlanUtil.LOCAL_PORT);
@PostConstruct
public void init() {
if (enke) {
cp = ContingencyPlanUtil.getInstance();
// 初始化会议
cp.init(videoConfernceIp, videoConferncePort);
List<String> ips = getLocalIP();
cp.setLocalAddress(CollectionUtils.isEmpty(ips) ? "0.0.0.0" : ips.get(0), ContingencyPlanUtil.LOCAL_PORT);
logger.info("开启组会功能成功!");
} else {
logger.info("不开启组会功能");
}
}
/**
@ -112,6 +122,7 @@ public class EnkeController {
}
}
}
logger.info("本机ip:" + ips);
return ips;
}
}

View File

@ -179,4 +179,7 @@ shangdongtong:
reminders:
# 催办间隔天数
interval: 7
# 恩科会议
enke:
enable: true