chore: update
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
package com.drinkool.services;
|
||||
|
||||
import com.drinkool.*;
|
||||
import com.drinkool.entities.CustomerEntity;
|
||||
import com.drinkool.dtos.*;
|
||||
import com.drinkool.entities.CustomerEntity;
|
||||
import jakarta.inject.Inject;
|
||||
import jakarta.transaction.Transactional;
|
||||
import jakarta.ws.rs.*;
|
||||
import jakarta.ws.rs.core.*;
|
||||
import java.util.UUID;
|
||||
|
||||
@Path(Role.Customer)
|
||||
public class CustomerService extends BaseService<CustomerEntity> {
|
||||
@@ -88,4 +89,10 @@ public class CustomerService extends BaseService<CustomerEntity> {
|
||||
.entity(customer)
|
||||
.build();
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/{id}")
|
||||
public Response findStaff(@PathParam("id") UUID staffId) {
|
||||
return Response.ok(CustomerEntity.findById(staffId)).build();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,9 +4,9 @@ import com.drinkool.InternalValue;
|
||||
import com.drinkool.Role;
|
||||
import com.drinkool.Url;
|
||||
import com.drinkool.dtos.DtoMapper;
|
||||
import com.drinkool.dtos.SendReview;
|
||||
import com.drinkool.entities.ReviewEntity;
|
||||
import com.drinkool.enums.SortBy;
|
||||
import com.drinkool.dtos.SendReview;
|
||||
import io.quarkus.panache.common.Sort;
|
||||
import io.vertx.core.http.HttpServerRequest;
|
||||
import jakarta.annotation.security.RolesAllowed;
|
||||
@@ -45,7 +45,13 @@ public class ReviewService {
|
||||
};
|
||||
|
||||
return Response.ok()
|
||||
.entity(ReviewEntity.find("eatery.id = ?1", sort, eateryId).list())
|
||||
.entity(
|
||||
ReviewEntity.find(
|
||||
"FROM ReviewEntity r LEFT JOIN FETCH r.eatery WHERE r.eatery.id = ?1",
|
||||
sort,
|
||||
eateryId
|
||||
).list()
|
||||
)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
@@ -39,4 +39,10 @@ public class CustomerController {
|
||||
public Uni<Response> me(@HeaderParam(InternalValue.userId) UUID id) {
|
||||
return accountService.me(id);
|
||||
}
|
||||
|
||||
@GET
|
||||
@Path("/{id}")
|
||||
public Uni<Response> findCustomer(@PathParam("id") UUID id) {
|
||||
return accountService.findCustomer(id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,4 +32,8 @@ public interface CustomerService {
|
||||
@GET
|
||||
@Path(Url.Me)
|
||||
Uni<Response> me(@HeaderParam(InternalValue.userId) UUID id);
|
||||
|
||||
@GET
|
||||
@Path("/{id}")
|
||||
public Uni<Response> findCustomer(@PathParam("id") UUID id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user