Skip to content

Commit

Permalink
New response model
Browse files Browse the repository at this point in the history
  • Loading branch information
sondrev committed Oct 29, 2024
1 parent a58c097 commit 9dbc47f
Show file tree
Hide file tree
Showing 7 changed files with 166 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package no.unit.nva.search.resource.response;

import com.fasterxml.jackson.annotation.JsonProperty;

class Affiliation {

@JsonProperty("id")
private String id;

@JsonProperty("type")
private String type;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package no.unit.nva.search.resource.response;

import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

class Contributor {

@JsonProperty("affiliations")
private List<Affiliation> affiliations;

@JsonProperty("correspondingAuthor")
private boolean correspondingAuthor;

@JsonProperty("identity")
private Identity identity;

@JsonProperty("role")
private String role;

@JsonProperty("sequence")
private int sequence;

@JsonProperty("type")
private String type;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package no.unit.nva.search.resource.response;

import com.fasterxml.jackson.annotation.JsonProperty;

class Identity {

@JsonProperty("id")
private String id;

@JsonProperty("type")
private String type;

@JsonProperty("name")
private String name;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package no.unit.nva.search.resource.response;

import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

public class OtherIdentifiers {

@JsonProperty("scopus")
private List<String> scopus;

@JsonProperty("scopus")
private List<String> cristin;

@JsonProperty("scopus")
private List<String> handle;

@JsonProperty("scopus")
private List<String> issn;

@JsonProperty("scopus")
private List<String> isbn;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package no.unit.nva.search.resource.response;

import com.fasterxml.jackson.annotation.JsonProperty;

class PublishingDetails {

@JsonProperty("id")
private String id;

@JsonProperty("type")
private String type;

@JsonProperty("series")
private Series series;

@JsonProperty("name")
private String name;

@JsonProperty("doi")
private String doi;

private class Series {

@JsonProperty("id")
private String id;

@JsonProperty("name")
private String name;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package no.unit.nva.search.resource.response;

import com.fasterxml.jackson.annotation.JsonProperty;

class RecordMetadata {

@JsonProperty("status")
private String status;

@JsonProperty("createdDate")
private String createdDate;

@JsonProperty("modifiedDate")
private String modifiedDate;

@JsonProperty("publishedDate")
private String publishedDate;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package no.unit.nva.search.resource.response;

import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

public class ResourceSearchResponse {

@JsonProperty("id")
private String id;

@JsonProperty("type")
private String type;

@JsonProperty("otherIdentifiers")
private OtherIdentifiers otherIdentifiers;

@JsonProperty("recordMetadata")
private RecordMetadata recordMetadata;

@JsonProperty("mainTitle")
private String mainTitle;

@JsonProperty("abstract")
private String mainLanguageAbstract;

@JsonProperty("description")
private String description;

@JsonProperty("alternativeTitles")
private List<String> alternativeTitles;

@JsonProperty("publicationDate")
private String publicationDate;

@JsonProperty("contributorsPreview")
private List<Contributor> contributorsPreview;

@JsonProperty("contributorsCount")
private int contributorsCount;

@JsonProperty("publishingDetails")
private PublishingDetails publishingDetails;
}

0 comments on commit 9dbc47f

Please sign in to comment.