mirror of
https://github.com/plexusorg/Plex.git
synced 2024-12-22 09:07:37 +00:00
Let's actually remove these files
This commit is contained in:
parent
77be23faf0
commit
00b6473e4d
@ -1,23 +0,0 @@
|
||||
package dev.plex.util.adapter;
|
||||
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonParseException;
|
||||
import dev.plex.Plex;
|
||||
import java.lang.reflect.Type;
|
||||
import java.time.Instant;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
|
||||
public class ZonedDateTimeDeserializer implements JsonDeserializer<ZonedDateTime>
|
||||
{
|
||||
private static final String TIMEZONE = Plex.get().config.getString("server.timezone");
|
||||
|
||||
@Override
|
||||
public ZonedDateTime deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException
|
||||
{
|
||||
Instant instant = Instant.ofEpochMilli(json.getAsJsonPrimitive().getAsLong());
|
||||
return ZonedDateTime.ofInstant(instant, ZoneId.of(TIMEZONE));
|
||||
}
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
package dev.plex.util.adapter;
|
||||
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonPrimitive;
|
||||
import com.google.gson.JsonSerializationContext;
|
||||
import com.google.gson.JsonSerializer;
|
||||
import dev.plex.Plex;
|
||||
import java.lang.reflect.Type;
|
||||
import java.time.ZonedDateTime;
|
||||
|
||||
public class ZonedDateTimeSerializer implements JsonSerializer<ZonedDateTime>
|
||||
{
|
||||
private static final String TIMEZONE = Plex.get().config.getString("server.timezone");
|
||||
|
||||
@Override
|
||||
public JsonElement serialize(ZonedDateTime src, Type typeOfSrc, JsonSerializationContext context)
|
||||
{
|
||||
return new JsonPrimitive(src.toInstant().toEpochMilli());
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user