add ServerInfo DTO
This commit is contained in:
49
src/main/java/mc/protocol/dto/ServerInfo.java
Normal file
49
src/main/java/mc/protocol/dto/ServerInfo.java
Normal file
@@ -0,0 +1,49 @@
|
||||
package mc.protocol.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonRawValue;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@Data
|
||||
public class ServerInfo {
|
||||
|
||||
private Version version;
|
||||
|
||||
@JsonProperty("players")
|
||||
private PlayersInfo playersInfo;
|
||||
|
||||
//TODO необходимо реализовать объект типа Chat (см. https://wiki.vg/index.php?title=Chat&oldid=8329)
|
||||
private JsonNode description;
|
||||
|
||||
@JsonProperty("favicon")
|
||||
private String faviconBase64;
|
||||
|
||||
@Data
|
||||
public static class Version {
|
||||
private String name;
|
||||
private int protocol;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class PlayersInfo {
|
||||
|
||||
private int max;
|
||||
|
||||
private int online;
|
||||
|
||||
@JsonProperty("sample")
|
||||
private List<SamplePlayer> samplePlayers;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class SamplePlayer {
|
||||
private UUID id;
|
||||
private String name;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user