🎨 Improving structure / format of the code.

This commit is contained in:
lbw 2022-04-22 15:33:12 +08:00
parent 7bac3d9702
commit 570064a588

View File

@ -51,9 +51,9 @@ public class MachineRegistryController {
if (StringUtil.isBlank(ip) || ip.length() > 128) { if (StringUtil.isBlank(ip) || ip.length() > 128) {
return Result.ofFail(-1, "invalid ip: " + ip); return Result.ofFail(-1, "invalid ip: " + ip);
} }
if (!InetAddressUtils.isIPv4Address(ip) && !InetAddressUtils.isIPv6Address(ip)) { if (!InetAddressUtils.isIPv4Address(ip) && !InetAddressUtils.isIPv6Address(ip)) {
return Result.ofFail(-1, "invalid ip: " + ip); return Result.ofFail(-1, "invalid ip: " + ip);
} }
if (port == null || port < -1) { if (port == null || port < -1) {
return Result.ofFail(-1, "invalid port"); return Result.ofFail(-1, "invalid port");
} }