|
@@ -6,9 +6,7 @@ import org.eco.common.core.constant.Constants;
|
|
|
import org.eco.common.core.exception.BusinessException;
|
|
|
import org.eco.common.core.utils.StringUtils;
|
|
|
import org.eco.common.core.utils.file.FileUploadUtils;
|
|
|
-import org.eco.system.config.ServerConfig;
|
|
|
import org.eco.system.service.ICommonService;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
@@ -27,10 +25,6 @@ public class CommonService implements ICommonService {
|
|
|
@Value("${server.port:8080}")
|
|
|
private Long port;
|
|
|
|
|
|
- private static final String FILE_DELIMETER = ",";
|
|
|
- @Autowired
|
|
|
- private ServerConfig serverConfig;
|
|
|
-
|
|
|
@Override
|
|
|
public Map<String, String> uploadFile(MultipartFile file) {
|
|
|
try {
|
|
@@ -60,7 +54,7 @@ public class CommonService implements ICommonService {
|
|
|
Enumeration<NetworkInterface> allNetInterfaces = NetworkInterface.getNetworkInterfaces();
|
|
|
InetAddress ip;
|
|
|
while (allNetInterfaces.hasMoreElements()) {
|
|
|
- NetworkInterface netInterface = (NetworkInterface) allNetInterfaces.nextElement();
|
|
|
+ NetworkInterface netInterface = allNetInterfaces.nextElement();
|
|
|
//用于排除回送接口,非虚拟网卡,未在使用中的网络接口
|
|
|
if (!netInterface.isLoopback() && !netInterface.isVirtual() && netInterface.isUp()) {
|
|
|
//返回和网络接口绑定的所有IP地址
|
|
@@ -74,7 +68,7 @@ public class CommonService implements ICommonService {
|
|
|
}
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
- log.info("IP地址获取失败" + e.getMessage());
|
|
|
+ log.info("IP地址获取失败{}", e.getMessage());
|
|
|
}
|
|
|
return "127.0.0.1";
|
|
|
}
|