From 2c3dfbc5c663edc24ac7106e734c404f7bb831e4 Mon Sep 17 00:00:00 2001 From: TakahashiNg <83152264+TakahashiNguyen@users.noreply.github.com> Date: Thu, 7 May 2026 13:52:38 +0000 Subject: [PATCH] chore: update --- .../java/com/drinkool/controller/EateryController.java | 10 ++++++++-- .../main/java/com/drinkool/services/ReviewService.java | 8 +++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/gateway-service/src/main/java/com/drinkool/controller/EateryController.java b/gateway-service/src/main/java/com/drinkool/controller/EateryController.java index 4b67108..53e718b 100644 --- a/gateway-service/src/main/java/com/drinkool/controller/EateryController.java +++ b/gateway-service/src/main/java/com/drinkool/controller/EateryController.java @@ -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 receiveReview(SendReview input) { - return reviewService.receiveReview(input); + public Uni receiveReview( + SendReview input, + @HeaderParam(InternalValue.userId) UUID userId, + @HeaderParam(InternalValue.role) String role + ) { + return reviewService.receiveReview(input, userId, role); } @POST diff --git a/gateway-service/src/main/java/com/drinkool/services/ReviewService.java b/gateway-service/src/main/java/com/drinkool/services/ReviewService.java index 47d4a61..8cee0e2 100644 --- a/gateway-service/src/main/java/com/drinkool/services/ReviewService.java +++ b/gateway-service/src/main/java/com/drinkool/services/ReviewService.java @@ -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 receiveReview(SendReview input); + public Uni receiveReview( + SendReview input, + @HeaderParam(InternalValue.userId) UUID userId, + @HeaderParam(InternalValue.role) String role + ); }