Co-authored-by: TakahashiNg <83152264+TakahashiNguyen@users.noreply.github.com> Reviewed-on: #48
This commit was merged in pull request #48.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.drinkool.controller;
|
||||
|
||||
import com.drinkool.InternalValue;
|
||||
import com.drinkool.Url;
|
||||
import com.drinkool.enums.SortBy;
|
||||
import com.drinkool.lib.dtos.GraphqlDto;
|
||||
@@ -9,6 +10,7 @@ import io.smallrye.mutiny.Uni;
|
||||
import jakarta.inject.Inject;
|
||||
import jakarta.ws.rs.DefaultValue;
|
||||
import jakarta.ws.rs.GET;
|
||||
import jakarta.ws.rs.HeaderParam;
|
||||
import jakarta.ws.rs.POST;
|
||||
import jakarta.ws.rs.Path;
|
||||
import jakarta.ws.rs.PathParam;
|
||||
@@ -43,8 +45,12 @@ public class EateryController extends GraphqlBase {
|
||||
|
||||
@POST
|
||||
@Path(Url.Review)
|
||||
public Uni<Response> receiveReview(SendReview input) {
|
||||
return reviewService.receiveReview(input);
|
||||
public Uni<Response> receiveReview(
|
||||
SendReview input,
|
||||
@HeaderParam(InternalValue.userId) UUID userId,
|
||||
@HeaderParam(InternalValue.role) String role
|
||||
) {
|
||||
return reviewService.receiveReview(input, userId, role);
|
||||
}
|
||||
|
||||
@POST
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package com.drinkool.services;
|
||||
|
||||
import com.drinkool.InternalValue;
|
||||
import com.drinkool.Url;
|
||||
import com.drinkool.enums.SortBy;
|
||||
import com.drinkool.lib.dtos.SendReview;
|
||||
import io.smallrye.mutiny.Uni;
|
||||
import jakarta.ws.rs.DefaultValue;
|
||||
import jakarta.ws.rs.GET;
|
||||
import jakarta.ws.rs.HeaderParam;
|
||||
import jakarta.ws.rs.POST;
|
||||
import jakarta.ws.rs.Path;
|
||||
import jakarta.ws.rs.PathParam;
|
||||
@@ -25,5 +27,9 @@ public interface ReviewService {
|
||||
);
|
||||
|
||||
@POST
|
||||
public Uni<Response> receiveReview(SendReview input);
|
||||
public Uni<Response> receiveReview(
|
||||
SendReview input,
|
||||
@HeaderParam(InternalValue.userId) UUID userId,
|
||||
@HeaderParam(InternalValue.role) String role
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user