package cn.stylefeng.guns.modular.zsx.kb.formula.controller; import cn.stylefeng.guns.modular.zsx.kb.utils.IPUtil; import cn.stylefeng.guns.modular.zsx.pm.salesOrder.service.SalesOrderService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import javax.servlet.http.HttpServletRequest; import java.net.*; import java.util.Enumeration; import java.util.Set; @Controller @RequestMapping("/kb/formulaView") public class FormulaKbController { private String PREFIX = "/modular/kb/formula"; /** * 跳转到主页面 * * @author ruimin * @Date 2023-08-26 */ @RequestMapping("") public String index() { return PREFIX + "/formulaView.html"; } public static void main(String[] args) { try { Enumeration networkInterfaces = NetworkInterface.getNetworkInterfaces(); while (networkInterfaces.hasMoreElements()) { NetworkInterface networkInterface = networkInterfaces.nextElement(); Enumeration inetAddresses = networkInterface.getInetAddresses(); while (inetAddresses.hasMoreElements()) { InetAddress inetAddress = inetAddresses.nextElement(); if (inetAddress instanceof Inet4Address) { // 过滤IPv4地址 System.out.println(inetAddress.getHostAddress()); } } } } catch (SocketException e) { throw new RuntimeException(e); } } }