Skip to content

Commit

Permalink
Ignore consul request bean sonarlint check.
Browse files Browse the repository at this point in the history
  • Loading branch information
sunquakes committed Oct 19, 2024
1 parent cb14194 commit 89602bd
Showing 1 changed file with 29 additions and 45 deletions.
74 changes: 29 additions & 45 deletions src/main/java/com/sunquakes/jsonrpc4j/discovery/Consul.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.sunquakes.jsonrpc4j.discovery;

import com.alibaba.fastjson2.annotation.JSONField;
import com.sunquakes.jsonrpc4j.JsonRpcProtocol;
import com.sunquakes.jsonrpc4j.utils.AddressUtils;
import com.sunquakes.jsonrpc4j.utils.JSONUtils;
Expand Down Expand Up @@ -86,9 +85,9 @@ private void checkRegister(String protocol, String hostname, int port, String na
Check serviceCheck = new Check();
serviceCheck.setName(name);
if (protocol.equals(JsonRpcProtocol.TCP.name())) {
serviceCheck.setTcp(AddressUtils.getUrl(hostname, port));
serviceCheck.setTCP(AddressUtils.getUrl(hostname, port));
} else {
serviceCheck.setHttp(String.format("%s://%s:%d", protocol, hostname, port));
serviceCheck.setHTTP(String.format("%s://%s:%d", protocol, hostname, port));
}
serviceCheck.setInterval(checkInterval);
// Set the init status passing
Expand Down Expand Up @@ -156,81 +155,66 @@ private NettyHttpClient getClient() {
@Data
@AllArgsConstructor
@NoArgsConstructor
public class HealthService {
@SuppressWarnings({"java:S116"})
static public class HealthService {

@JSONField(name = "AggregatedStatus")
private String aggregatedStatus;
private String AggregatedStatus;

@JSONField(name = "Service")
private NewService service;
private NewService Service;
}

@Data
@AllArgsConstructor
@NoArgsConstructor
public class NewService {
@SuppressWarnings({"java:S116"})
static public class NewService {

@JSONField(name = "ID")
private String id;
private String ID;

@JSONField(name = "Service")
private String service;
private String Service;

@JSONField(name = "Port")
private Integer port;
private Integer Port;

@JSONField(name = "Address")
private String address;
private String Address;
}

@Data
@AllArgsConstructor
@NoArgsConstructor
public class RegisterService {
@SuppressWarnings({"java:S116"})
static public class RegisterService {

@JSONField(name = "ID")
private String id;
private String ID;

@JSONField(name = "Name")
private String name;
private String Name;

@JSONField(name = "Port")
private Integer port;
private Integer Port;

@JSONField(name = "Address")
private String address;
private String Address;
}

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Check {
@SuppressWarnings({"java:S116"})
static public class Check {

@JSONField(name = "ID")
private String id;
private String ID;

@JSONField(name = "Name")
private String name;
private String Name;

@JSONField(name = "Status")
private String status;
private String Status;

@JSONField(name = "ServiceID")
private String serviceID;
private String ServiceID;

@JSONField(name = "HTTP")
private String http;
private String HTTP;

@JSONField(name = "Method")
private String method;
private String Method;

@JSONField(name = "TCP")
private String tcp;
private String TCP;

@JSONField(name = "Interval")
private String interval;
private String Interval;

@JSONField(name = "Timeout")
private String timeout;
private String Timeout;
}
}

0 comments on commit 89602bd

Please sign in to comment.