This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Commit 6ed6ed81 authored by Michael Breu's avatar Michael Breu 💬
Browse files

Update to V0.1.5: correct serialization of Instant

parent 4e999000
......@@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.codeability.sharing</groupId>
<artifactId>SharingPluginPlatformAPI</artifactId>
<version>0.1.4</version>
<version>0.1.5</version>
<name>SharingPluginPlatformAPI</name>
<description>CodeAbility Sharing Plugin Platform API</description>
<packaging>jar</packaging>
......@@ -39,6 +39,7 @@
<artifactId>jackson-module-jaxb-annotations</artifactId>
<version>2.10.4</version>
</dependency>
</dependencies>
<distributionManagement>
<repository>
......
......@@ -7,4 +7,5 @@ module sharingPluginPlatform {
exports org.codeability.sharing.plugins.api;
exports org.codeability.sharing.plugins.api.search;
requires com.fasterxml.jackson.annotation;
requires com.fasterxml.jackson.databind;
}
\ No newline at end of file
package org.codeability.sharing.plugins.api.jsonSupport;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.type.TypeFactory;
import com.fasterxml.jackson.databind.util.Converter;
public final class NoUTCInstantDeserializer implements Converter<LocalDateTime, Instant> {
@Override
public Instant convert(LocalDateTime value) {
return value.toInstant(ZoneOffset.UTC);
}
@Override
public JavaType getInputType(TypeFactory typeFactory) {
return typeFactory.constructType(LocalDateTime.class);
}
@Override
public JavaType getOutputType(TypeFactory typeFactory) {
return typeFactory.constructType(Instant.class);
}
}
\ No newline at end of file
package org.codeability.sharing.plugins.api.jsonSupport;
import java.time.Instant;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.type.TypeFactory;
import com.fasterxml.jackson.databind.util.Converter;
public final class UTCInstantSerializer implements Converter<Instant, String> {
@Override
public String convert(Instant instant) {
return instant.toString();
}
@Override
public JavaType getInputType(TypeFactory typeFactory) {
return typeFactory.constructType(Instant.class);
}
@Override
public JavaType getOutputType(TypeFactory typeFactory) {
return typeFactory.constructType(String.class);
}
}
\ No newline at end of file
......@@ -5,6 +5,12 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import org.codeability.sharing.plugins.api.jsonSupport.NoUTCInstantDeserializer;
import org.codeability.sharing.plugins.api.jsonSupport.UTCInstantSerializer;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
public class SearchResultDTO {
public static class PluginActionInfo {
......@@ -178,6 +184,8 @@ public class SearchResultDTO {
private String main_group;
private String sub_group;
private String url;
@JsonDeserialize(converter = NoUTCInstantDeserializer.class)
@JsonSerialize(converter = UTCInstantSerializer.class)
private Instant last_activity_at;
public int getProject_id() {
......@@ -319,6 +327,8 @@ public class SearchResultDTO {
private String filename;
private String path;
private String commit_id;
@JsonDeserialize(converter = NoUTCInstantDeserializer.class)
@JsonSerialize(converter = UTCInstantSerializer.class)
private Instant indexing_date;
public String getFilename() {
......
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.codeability.sharing</groupId>
<artifactId>SharingPluginPlatformAPI</artifactId>
<version>0.1.5</version>
<name>SharingPluginPlatformAPI</name>
<description>CodeAbility Sharing Plugin Platform API</description>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- Plugin versions -->
<maven-clean-plugin.version>3.1.0</maven-clean-plugin.version>
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
<maven-javadoc-plugin.version>3.2.0</maven-javadoc-plugin.version>
<maven-eclipse-plugin.version>2.10</maven-eclipse-plugin.version>
<maven-enforcer-plugin.version>3.0.0-M3</maven-enforcer-plugin.version>
<maven-failsafe-plugin.version>3.0.0-M4</maven-failsafe-plugin.version>
<maven-idea-plugin.version>2.2.1</maven-idea-plugin.version>
<maven-resources-plugin.version>3.1.0</maven-resources-plugin.version>
<maven-surefire-plugin.version>3.0.0-M4</maven-surefire-plugin.version>
<maven-war-plugin.version>3.2.3</maven-war-plugin.version>
<maven-checkstyle.version>3.1.1</maven-checkstyle.version>
<checkstyle.version>8.32</checkstyle.version>
<spring-nohttp-checkstyle.version>0.0.4.RELEASE</spring-nohttp-checkstyle.version>
<frontend-maven-plugin.version>1.10.0</frontend-maven-plugin.version>
<git-commit-id-plugin.version>4.0.0</git-commit-id-plugin.version>
<jacoco-maven-plugin.version>0.8.5</jacoco-maven-plugin.version>
<jib-maven-plugin.version>2.4.0</jib-maven-plugin.version>
<lifecycle-mapping.version>1.0.0</lifecycle-mapping.version>
<properties-maven-plugin.version>1.0.0</properties-maven-plugin.version>
<sonar-maven-plugin.version>3.7.0.1746</sonar-maven-plugin.version>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.module/jackson-module-jaxb-annotations -->
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-jaxb-annotations</artifactId>
<version>2.10.4</version>
</dependency>
</dependencies>
<distributionManagement>
<repository>
<id>target</id>
<name>Local target repository, to be promoted to git</name>
<url>file://${project.basedir}/target</url>
<layout>default</layout>
</repository>
</distributionManagement>
<build>
<defaultGoal>package</defaultGoal>
<sourceDirectory>src</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>11</source>
<target>11</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${maven-checkstyle.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<executions>
<execution>
<id>attach-javadocs</id>
<phase>deploy</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>${maven-eclipse-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven-failsafe-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-idea-plugin</artifactId>
<version>${maven-idea-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven-resources-plugin.version}</version>
<!-- unused <executions> <execution> <id>deploy-to-local-directory</id>
<phase>install</phase> <goals> <goal>copy-resources</goal> </goals> <configuration>
<outputDirectory>./target</outputDirectory> <resources> <resource> <directory>${project.build.directory}</directory>
<includes> <include>${project.build.finalName}.jar</include> </includes>
<filtering>false</filtering> </resource> </resources> </configuration> </execution>
</executions> -->
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<phase>deploy</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven-surefire-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>${sonar-maven-plugin.version}</version>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
......@@ -3,7 +3,7 @@
<groupId>org.codeability.sharing</groupId>
<artifactId>SharingPluginPlatformAPI</artifactId>
<versioning>
<release>0.1.4</release>
<release>0.1.5</release>
<versions>
<version>0.0.1</version>
<version>0.0.2</version>
......@@ -14,7 +14,8 @@
<version>0.1.3-SNAPSHOT</version>
<version>0.1.3</version>
<version>0.1.4</version>
<version>0.1.5</version>
</versions>
<lastUpdated>20210622100527</lastUpdated>
<lastUpdated>20210622124442</lastUpdated>
</versioning>
</metadata>
cf6877ab9dea502ca468e8e0c044ebcf
\ No newline at end of file
e10af7d7b59fecaeee794871ebdfef1d
\ No newline at end of file
577b3834c35a4ac668f4e60ce9603893c9e499e4
\ No newline at end of file
fa0d1cb00059a87695823c494f74a5777fe00fdf
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment