Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PanacheRepositoryResource should implement ReactiveRestDataResource #30715

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
import io.quarkus.hibernate.reactive.rest.data.panache.PanacheRepositoryResource;
import io.quarkus.rest.data.panache.MethodProperties;
import io.quarkus.rest.data.panache.ResourceProperties;
import io.smallrye.mutiny.Uni;

@ResourceProperties(hal = true, paged = false, halCollectionName = "item-collections", rolesAllowed = "user")
public interface CollectionsResource extends PanacheRepositoryResource<CollectionsRepository, Collection, String> {

@MethodProperties(rolesAllowed = "admin")
boolean delete(String name);
Uni<Boolean> delete(String name);
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import io.quarkus.rest.data.panache.MethodProperties;
import io.quarkus.rest.data.panache.ResourceProperties;
import io.quarkus.test.QuarkusUnitTest;
import io.smallrye.mutiny.Uni;

class PanacheRepositoryResourcePathCustomisationTest extends AbstractPathCustomisationTest {

Expand All @@ -27,18 +28,18 @@ public interface CustomPathCollectionsResource
extends PanacheRepositoryResource<CollectionsRepository, Collection, String> {

@MethodProperties(path = "api")
List<Collection> list(Page page, Sort sort);
Uni<List<Collection>> list(Page page, Sort sort);

@MethodProperties(path = "api")
Collection get(String name);
Uni<Collection> get(String name);

@MethodProperties(path = "api")
Collection add(Collection collection);
Uni<Collection> add(Collection collection);

@MethodProperties(path = "api")
Collection update(String name, Collection collection);
Uni<Collection> update(String name, Collection collection);

@MethodProperties(path = "api")
boolean delete(String name);
Uni<Boolean> delete(String name);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import io.quarkus.hibernate.reactive.panache.PanacheRepositoryBase;
import io.quarkus.rest.data.panache.MethodProperties;
import io.quarkus.rest.data.panache.ReactiveRestDataResource;
import io.quarkus.rest.data.panache.ResourceProperties;
import io.quarkus.rest.data.panache.RestDataResource;

Expand All @@ -18,6 +19,6 @@
* @param <ID> ID type of the entity.
*/
public interface PanacheRepositoryResource<Repository extends PanacheRepositoryBase<Entity, ID>, Entity, ID>
extends RestDataResource<Entity, ID> {
extends ReactiveRestDataResource<Entity, ID> {

}