-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
689ad51
commit 07b00f3
Showing
8 changed files
with
354 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/main/java/uk/ac/core/oacore4j/journals/JournalsService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package uk.ac.core.oacore4j.journals; | ||
|
||
import retrofit2.Call; | ||
import retrofit2.http.*; | ||
import uk.ac.core.oacore4j.commons.SearchRequest; | ||
import uk.ac.core.oacore4j.journals.response.JournalResponse; | ||
import uk.ac.core.oacore4j.journals.response.JournalSearchResponse; | ||
|
||
import java.util.List; | ||
|
||
|
||
/** | ||
* @author Giorgio Basile | ||
* @since 23/05/2017 | ||
*/ | ||
|
||
public interface JournalsService { | ||
|
||
String QUERY = "query"; | ||
String PAGE = "page"; | ||
String PAGE_SIZE = "pageSize"; | ||
String ISSN = "issn"; | ||
|
||
|
||
@POST("journals/get") | ||
Call<List<JournalResponse>> getJournals(@Body List<String> issnList); | ||
|
||
@GET("journals/get/{issn}") | ||
Call<JournalResponse> getJournal(@Path(ISSN) String issn); | ||
|
||
@POST("journals/search") | ||
Call<List<JournalSearchResponse>> searchJournals(@Body List<SearchRequest> searchRequests); | ||
|
||
@GET("journals/search/{query}") | ||
Call<JournalSearchResponse> searchJournals(@Path(QUERY) String query, | ||
@Query(PAGE) Integer page, | ||
@Query(PAGE_SIZE) Integer pageSize); | ||
|
||
} |
110 changes: 110 additions & 0 deletions
110
src/main/java/uk/ac/core/oacore4j/journals/response/Journal.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
|
||
package uk.ac.core.oacore4j.journals.response; | ||
|
||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
import com.fasterxml.jackson.annotation.JsonAnyGetter; | ||
import com.fasterxml.jackson.annotation.JsonAnySetter; | ||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.annotation.JsonPropertyOrder; | ||
|
||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
@JsonPropertyOrder({ | ||
"title", | ||
"identifiers", | ||
"subjects", | ||
"language", | ||
"rights", | ||
"publisher" | ||
}) | ||
public class Journal { | ||
|
||
@JsonProperty("title") | ||
private String title; | ||
@JsonProperty("identifiers") | ||
private List<String> identifiers = null; | ||
@JsonProperty("subjects") | ||
private List<String> subjects = null; | ||
@JsonProperty("language") | ||
private String language; | ||
@JsonProperty("rights") | ||
private String rights; | ||
@JsonProperty("publisher") | ||
private String publisher; | ||
@JsonIgnore | ||
private Map<String, Object> additionalProperties = new HashMap<String, Object>(); | ||
|
||
@JsonProperty("title") | ||
public String getTitle() { | ||
return title; | ||
} | ||
|
||
@JsonProperty("title") | ||
public void setTitle(String title) { | ||
this.title = title; | ||
} | ||
|
||
@JsonProperty("identifiers") | ||
public List<String> getIdentifiers() { | ||
return identifiers; | ||
} | ||
|
||
@JsonProperty("identifiers") | ||
public void setIdentifiers(List<String> identifiers) { | ||
this.identifiers = identifiers; | ||
} | ||
|
||
@JsonProperty("subjects") | ||
public List<String> getSubjects() { | ||
return subjects; | ||
} | ||
|
||
@JsonProperty("subjects") | ||
public void setSubjects(List<String> subjects) { | ||
this.subjects = subjects; | ||
} | ||
|
||
@JsonProperty("language") | ||
public String getLanguage() { | ||
return language; | ||
} | ||
|
||
@JsonProperty("language") | ||
public void setLanguage(String language) { | ||
this.language = language; | ||
} | ||
|
||
@JsonProperty("rights") | ||
public String getRights() { | ||
return rights; | ||
} | ||
|
||
@JsonProperty("rights") | ||
public void setRights(String rights) { | ||
this.rights = rights; | ||
} | ||
|
||
@JsonProperty("publisher") | ||
public String getPublisher() { | ||
return publisher; | ||
} | ||
|
||
@JsonProperty("publisher") | ||
public void setPublisher(String publisher) { | ||
this.publisher = publisher; | ||
} | ||
|
||
@JsonAnyGetter | ||
public Map<String, Object> getAdditionalProperties() { | ||
return this.additionalProperties; | ||
} | ||
|
||
@JsonAnySetter | ||
public void setAdditionalProperty(String name, Object value) { | ||
this.additionalProperties.put(name, value); | ||
} | ||
|
||
} |
57 changes: 57 additions & 0 deletions
57
src/main/java/uk/ac/core/oacore4j/journals/response/JournalResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
|
||
package uk.ac.core.oacore4j.journals.response; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
import com.fasterxml.jackson.annotation.JsonAnyGetter; | ||
import com.fasterxml.jackson.annotation.JsonAnySetter; | ||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.annotation.JsonPropertyOrder; | ||
|
||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
@JsonPropertyOrder({ | ||
"status", | ||
"journal" | ||
}) | ||
public class JournalResponse { | ||
|
||
@JsonProperty("status") | ||
private String status; | ||
@JsonProperty("data") | ||
private Journal journal; | ||
@JsonIgnore | ||
private Map<String, Object> additionalProperties = new HashMap<>(); | ||
|
||
@JsonProperty("status") | ||
public String getStatus() { | ||
return status; | ||
} | ||
|
||
@JsonProperty("status") | ||
public void setStatus(String status) { | ||
this.status = status; | ||
} | ||
|
||
@JsonProperty("data") | ||
public Journal getJournal() { | ||
return journal; | ||
} | ||
|
||
@JsonProperty("data") | ||
public void setJournal(Journal journal) { | ||
this.journal = journal; | ||
} | ||
|
||
@JsonAnyGetter | ||
public Map<String, Object> getAdditionalProperties() { | ||
return this.additionalProperties; | ||
} | ||
|
||
@JsonAnySetter | ||
public void setAdditionalProperty(String name, Object value) { | ||
this.additionalProperties.put(name, value); | ||
} | ||
|
||
} |
54 changes: 54 additions & 0 deletions
54
src/main/java/uk/ac/core/oacore4j/journals/response/JournalSearchResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
|
||
package uk.ac.core.oacore4j.journals.response; | ||
|
||
import com.fasterxml.jackson.annotation.*; | ||
|
||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
@JsonPropertyOrder({ | ||
"status", | ||
"journal" | ||
}) | ||
public class JournalSearchResponse { | ||
|
||
@JsonProperty("status") | ||
private String status; | ||
@JsonProperty("data") | ||
private List<Journal> journal; | ||
@JsonIgnore | ||
private Map<String, Object> additionalProperties = new HashMap<>(); | ||
|
||
@JsonProperty("status") | ||
public String getStatus() { | ||
return status; | ||
} | ||
|
||
@JsonProperty("status") | ||
public void setStatus(String status) { | ||
this.status = status; | ||
} | ||
|
||
@JsonProperty("data") | ||
public List<Journal> getJournal() { | ||
return journal; | ||
} | ||
|
||
@JsonProperty("data") | ||
public void setJournal(List<Journal> journal) { | ||
this.journal = journal; | ||
} | ||
|
||
@JsonAnyGetter | ||
public Map<String, Object> getAdditionalProperties() { | ||
return this.additionalProperties; | ||
} | ||
|
||
@JsonAnySetter | ||
public void setAdditionalProperty(String name, Object value) { | ||
this.additionalProperties.put(name, value); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.