Commit ac0991b4 authored by Maxym Borodenko's avatar Maxym Borodenko
Browse files

Initial code for GG-CE API client

parent b9873fa9
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.gringlobal</groupId>
<artifactId>ggce-client</artifactId>
<version>2021.10-SNAPSHOT</version>
</parent>
<artifactId>ggce-client-parent</artifactId>
<packaging>pom</packaging>
<name>GG-CE API client parent</name>
<description>Parent POM to build a module</description>
<properties>
<skip.deploy.artifact>true</skip.deploy.artifact>
</properties>
<build>
<plugins>
<plugin>
<groupId>io.swagger.codegen.v3</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<version>${swagger-codegen.version}</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
<configuration>
<inputSpec>${project.basedir}/../ggce-api.json</inputSpec>
<language>${swagger-codegen.language}</language>
<library>${swagger-codegen.library}</library>
<modelPackage>org.gringlobal.client.model</modelPackage>
<apiPackage>org.gringlobal.client.api</apiPackage>
<invokerPackage>org.gringlobal.client.invoker</invokerPackage>
<output>${generated-sources-path}</output>
<generateApiTests>false</generateApiTests>
<generateModelTests>false</generateModelTests>
<configOptions>
<withXml>false</withXml>
<java8>true</java8>
<dateLibrary>java8</dateLibrary>
<sourceFolder>${generated-sources-java-path}</sourceFolder>
<groupId>org.gringlobal</groupId>
<artifactId>ggce-client-${swagger-codegen.library}</artifactId>
<artifactVersion>2021.10-SNAPSHOT</artifactVersion>
<artifactUrl>https://gitlab.croptrust.org/grin-global/ggce-client</artifactUrl>
<artifactDescription>Java API client for GG-CE ${swagger-codegen.library}</artifactDescription>
<scmConnection>git@gitlab.croptrust.org:grin-global/ggce-client.git</scmConnection>
<scmDeveloperConnection>git@gitlab.croptrust.org:grin-global/ggce-client.git</scmDeveloperConnection>
<scmUrl>https://gitlab.croptrust.org/grin-global/ggce-client.git</scmUrl>
<developerName>Matija Obreza</developerName>
<developerEmail>matija.obreza@croptrust.org</developerEmail>
<developerOrganization>Global Crop Diversity Trust</developerOrganization>
<developerOrganizationUrl>https://www.croptrust.org</developerOrganizationUrl>
<licenseName>Apache 2.0</licenseName>
<licenseUrl>http://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl>
</configOptions>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.9.1</version>
<executions>
<!-- TODO for eclipse/m2e users: install the m2e connector 'buildhelper' by selecting 'Discover new m2e connectors' while hovering over the follwoing execution tag -->
<execution>
<id>add-generated-source</id>
<phase>initialize</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${generated-sources-path}/${generated-sources-java-path}</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<!-- <plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.7</version>
<executions>
<execution>
<id>copy-docs</id>
<phase>compile</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/docs</outputDirectory>
<resources>
<resource>
<directory>${generated-sources-path}/docs</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin> -->
</plugins>
<!-- the following is only necessary if you are using eclipse and m2e -->
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>io.swagger</groupId>
<artifactId>swagger-codegen-maven-plugin</artifactId>
<versionRange>[${swagger-codegen.version},)</versionRange>
<goals>
<goal>generate</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<profiles>
<profile>
<id>normal</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<profile>
<id>release</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>${maven-gpg-plugin.version}</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<!-- gpg: signing failed: No such file or directory -->
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<pluginRepositories>
<pluginRepository>
<id>sonatype-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.gringlobal</groupId>
<artifactId>ggce-java</artifactId>
<version>2021.10-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>
<artifactId>ggce-client</artifactId>
<name>GG-CE API client</name>
<packaging>pom</packaging>
<url>https://gitlab.croptrust.org/grin-global/grin-global-server</url>
<properties>
<slf4j.version>1.7.31</slf4j.version>
<skip.deploy.artifact>true</skip.deploy.artifact>
<skipTests>true</skipTests>
<java.version>11</java.version>
<maven.compiler.source>${java.version}</maven.compiler.source>
<maven.compiler.target>${java.version}</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<swagger-core.version>2.1.10</swagger-core.version>
<swagger-codegen.version>3.0.27</swagger-codegen.version>
<junit-version>4.13.2</junit-version>
<generated-sources-path>${project.build.directory}/generated-sources/swagger</generated-sources-path>
<generated-sources-java-path>src/main/java</generated-sources-java-path>
</properties>
<modules>
<module>resttemplate</module>
</modules>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<version>1.2.7</version>
<configuration>
<flattenMode>ossrh</flattenMode>
</configuration>
<executions>
<!-- enable flattening -->
<execution>
<id>flatten</id>
<phase>process-resources</phase>
<goals>
<goal>flatten</goal>
</goals>
</execution>
<!-- ensure proper cleanup -->
<execution>
<id>flatten.clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${slf4j.version}</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<distributionManagement>
<repository>
<id>ossrh</id>
<name>Sonatype Releases</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
</repository>
<snapshotRepository>
<id>ossrh</id>
<name>Sonatype Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<uniqueVersion>true</uniqueVersion>
</snapshotRepository>
</distributionManagement>
</project>
# GG-CE API Client
## Maven users
Add this dependency to your project's POM:
```xml
<dependency>
<groupId>org.gringlobal</groupId>
<artifactId>ggce-client-resttemplate</artifactId>
<version>2021.10-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
```
## Gradle users
Add this dependency to your project's build file:
```groovy
compile "org.gringlobal:ggce-client-resttemplate:2021.10-SNAPSHOT"
```
\ No newline at end of file
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.gringlobal</groupId>
<artifactId>ggce-client-parent</artifactId>
<version>2021.10-SNAPSHOT</version>
<relativePath>../parent</relativePath>
</parent>
<artifactId>ggce-client-resttemplate</artifactId>
<packaging>jar</packaging>
<name>GG-CE API client (spring-resttemplate)</name>
<description>API client for GG-CE with Spring REST template</description>
<properties>
<swagger-codegen.language>java</swagger-codegen.language>
<swagger-codegen.library>resttemplate</swagger-codegen.library>
<spring-web-version>5.3.8</spring-web-version>
<jackson-version>2.12.3</jackson-version>
</properties>
<dependencies>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>com.sun.activation</groupId>
<artifactId>javax.activation</artifactId>
<version>1.2.0</version>
</dependency>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-annotations</artifactId>
<version>${swagger-core.version}</version>
</dependency>
<!-- HTTP client: Spring RestTemplate -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring-web-version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring-web-version}</version>
</dependency>
<!-- JSON processing: jackson -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-json-provider</artifactId>
<version>${jackson-version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>${jackson-version}</version>
</dependency>
<!-- XML processing: Jackson -->
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
<version>${jackson-version}</version>
</dependency>
<!-- logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${slf4j.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>${slf4j.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
</plugins>
</build>
</project>
......@@ -69,7 +69,7 @@
<module>parent</module>
<module>commons</module>
<module>server</module>
<!-- <module>client</module> -->
<module>client</module>
<module>coverage</module>
</modules>
......
......@@ -62,6 +62,7 @@ public class AppController extends ApiBaseController {
@Autowired
private LanguageService languageService;
@Operation(hidden = true) //FIXME
@GetMapping(value = "/codes", produces = { MediaType.APPLICATION_JSON_VALUE })
public LookupMap<String, String, CodeValueInfo> codeValuesList() {
......@@ -80,6 +81,7 @@ public class AppController extends ApiBaseController {
return languageService.listAll();
}
@Operation(hidden = true) //FIXME
@GetMapping(value = "/resources/{appName}", produces = { MediaType.APPLICATION_JSON_VALUE })
public LookupMap<String, String, AppResourceInfo> appResourcesList(@PathVariable("appName") String appName) {
......
......@@ -23,6 +23,7 @@ import java.util.Set;
import java.util.SortedMap;
import com.fasterxml.jackson.annotation.JsonView;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.apache.commons.lang3.StringUtils;
import org.genesys.blocks.model.JsonViews;
......@@ -168,6 +169,7 @@ public class KPIController {
return run;
}
@Operation(hidden = true) //FIXME see https://github.com/swagger-api/swagger-codegen/issues/11084
@PostMapping(value = "/executions/{name:.+}/diff")
public SortedMap<Date, List<Observation>> executionRuns(final @PathVariable String name, @RequestParam(value="days", required = false) final Integer days, @RequestParam(value="from", required = false) @DateTimeFormat(pattern="yyyy-MM-dd") Date from,
@RequestParam(value="to", required = false) @DateTimeFormat(pattern="yyyy-MM-dd") Date to, @RequestBody(required = false) final Map<String, Set<String>> keys) {
......
Supports Markdown
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