-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dependency: migrate to version v4.2.0
- Loading branch information
Showing
6 changed files
with
118 additions
and
85 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
34 changes: 34 additions & 0 deletions
34
src/main/java/at/medunigraz/api/rest/base/services/MUGAPIPersonServiceBase.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,34 @@ | ||
package at.medunigraz.api.rest.base.services; | ||
|
||
import at.medunigraz.api.rest.base.models.MUGSearchResult; | ||
import at.medunigraz.damap.rest.dmp.domain.MUGPerson; | ||
import jakarta.ws.rs.Consumes; | ||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.PathParam; | ||
import jakarta.ws.rs.Produces; | ||
import jakarta.ws.rs.QueryParam; | ||
import jakarta.ws.rs.core.MediaType; | ||
import java.util.List; | ||
import org.eclipse.microprofile.rest.client.annotation.RegisterClientHeaders; | ||
|
||
@Produces(MediaType.APPLICATION_JSON) | ||
@RegisterClientHeaders(value = AuthorizationClientHeadersFactory.class) | ||
public interface MUGAPIPersonServiceBase { | ||
|
||
// The API currently applies an AND operation for each filter (i.e. | ||
// first_name__contains AND last_name__contains). Currenly, we only search | ||
// for one field, as we do not know how people will search. | ||
@GET | ||
@Path("") | ||
MUGSearchResult<MUGPerson> search( | ||
@QueryParam("last_name__icontains") String firstName, | ||
@QueryParam("offset") int offset, | ||
@QueryParam("limit") int limit, | ||
@QueryParam("expand") List<String> expand); | ||
|
||
@GET | ||
@Path("/{id}") | ||
@Consumes(value = "application/json") | ||
MUGPerson read(@PathParam("id") String id, @QueryParam("expand") List<String> expand); | ||
} |
33 changes: 33 additions & 0 deletions
33
src/main/java/at/medunigraz/api/rest/base/services/MUGAPIProjectServiceBase.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,33 @@ | ||
package at.medunigraz.api.rest.base.services; | ||
|
||
import at.medunigraz.api.rest.base.models.MUGSearchResult; | ||
import at.medunigraz.damap.rest.dmp.domain.MUGProject; | ||
import jakarta.ws.rs.Consumes; | ||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.PathParam; | ||
import jakarta.ws.rs.Produces; | ||
import jakarta.ws.rs.QueryParam; | ||
import jakarta.ws.rs.core.MediaType; | ||
import java.time.Instant; | ||
import java.util.List; | ||
import org.eclipse.microprofile.rest.client.annotation.ClientHeaderParam; | ||
import org.eclipse.microprofile.rest.client.annotation.RegisterClientHeaders; | ||
|
||
@Produces(MediaType.APPLICATION_JSON) | ||
@RegisterClientHeaders(value = AuthorizationClientHeadersFactory.class) | ||
public interface MUGAPIProjectServiceBase { | ||
@GET | ||
@Path("") | ||
@ClientHeaderParam(name = "accept", value = "application/json") | ||
MUGSearchResult<MUGProject> search( | ||
@QueryParam("title") String title, | ||
@QueryParam("end_effective__gte") Instant endEffective, | ||
@QueryParam("offset") int offset, | ||
@QueryParam("limit") int limit); | ||
|
||
@GET | ||
@Path("/{id}") | ||
@Consumes(value = "application/json") | ||
MUGProject read(@PathParam("id") String id, @QueryParam("expand") List<String> expand); | ||
} |
29 changes: 0 additions & 29 deletions
29
src/main/java/at/medunigraz/api/rest/base/services/MUGAPIServiceBase.java
This file was deleted.
Oops, something went wrong.
22 changes: 2 additions & 20 deletions
22
src/main/java/at/medunigraz/damap/rest/persons/MUGPersonRestService.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 |
---|---|---|
@@ -1,30 +1,12 @@ | ||
package at.medunigraz.damap.rest.persons; | ||
|
||
import at.medunigraz.api.rest.base.models.MUGSearchResult; | ||
import at.medunigraz.api.rest.base.services.AuthorizationClientHeadersFactory; | ||
import at.medunigraz.api.rest.base.services.MUGAPIServiceBase; | ||
import at.medunigraz.damap.rest.dmp.domain.MUGPerson; | ||
import at.medunigraz.api.rest.base.services.MUGAPIPersonServiceBase; | ||
import jakarta.enterprise.context.ApplicationScoped; | ||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.QueryParam; | ||
import java.util.List; | ||
import org.eclipse.microprofile.rest.client.annotation.RegisterClientHeaders; | ||
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; | ||
|
||
@ApplicationScoped | ||
@RegisterRestClient(configKey = "rest.persons") | ||
@RegisterClientHeaders(value = AuthorizationClientHeadersFactory.class) | ||
public interface MUGPersonRestService extends MUGAPIServiceBase<MUGPerson> { | ||
|
||
// The API currently applies an AND operation for each filter (i.e. | ||
// first_name__contains AND last_name__contains). Currenly, we only search | ||
// for one field, as we do not know how people will search. | ||
@GET | ||
@Path("") | ||
MUGSearchResult<MUGPerson> search( | ||
@QueryParam("last_name__icontains") String firstName, | ||
@QueryParam("offset") int offset, | ||
@QueryParam("limit") int limit, | ||
@QueryParam("expand") List<String> expand); | ||
} | ||
public interface MUGPersonRestService extends MUGAPIPersonServiceBase {} |
20 changes: 2 additions & 18 deletions
20
src/main/java/at/medunigraz/damap/rest/projects/MUGProjectRestService.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 |
---|---|---|
@@ -1,23 +1,7 @@ | ||
package at.medunigraz.damap.rest.projects; | ||
|
||
import at.medunigraz.api.rest.base.models.MUGSearchResult; | ||
import at.medunigraz.api.rest.base.services.MUGAPIServiceBase; | ||
import at.medunigraz.damap.rest.dmp.domain.MUGProject; | ||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.QueryParam; | ||
import java.time.Instant; | ||
import org.eclipse.microprofile.rest.client.annotation.ClientHeaderParam; | ||
import at.medunigraz.api.rest.base.services.MUGAPIProjectServiceBase; | ||
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; | ||
|
||
@RegisterRestClient(configKey = "rest.projects") | ||
public interface MUGProjectRestService extends MUGAPIServiceBase<MUGProject> { | ||
@GET | ||
@Path("") | ||
@ClientHeaderParam(name = "accept", value = "application/json") | ||
MUGSearchResult<MUGProject> search( | ||
@QueryParam("title") String title, | ||
@QueryParam("end_effective__gte") Instant endEffective, | ||
@QueryParam("offset") int offset, | ||
@QueryParam("limit") int limit); | ||
} | ||
public interface MUGProjectRestService extends MUGAPIProjectServiceBase {} |