diff --git a/genti-api/src/main/java/com/gt/genti/purchase/api/UserPurchaseApi.java b/genti-api/src/main/java/com/gt/genti/purchase/api/UserPurchaseApi.java new file mode 100644 index 0000000..d8dc280 --- /dev/null +++ b/genti-api/src/main/java/com/gt/genti/purchase/api/UserPurchaseApi.java @@ -0,0 +1,27 @@ +package com.gt.genti.purchase.api; + +import com.gt.genti.error.ResponseCode; +import com.gt.genti.purchase.dto.request.PurchaseRequestDto; +import com.gt.genti.response.GentiResponse; +import com.gt.genti.swagger.AuthorizedUser; +import com.gt.genti.swagger.EnumResponse; +import com.gt.genti.swagger.EnumResponses; +import com.gt.genti.user.model.AuthUser; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.RequestBody; + +@AuthorizedUser +@Tag(name = "[UserPurchaseController] 인앱 결제 컨트롤러", description = "결제 내용을 서버에서 검증합니다.") +public interface UserPurchaseApi { + + @Operation(summary = "영수증 검증", description = "클라이언트로부터 받은 결제 내역을 검증합니다.") + @EnumResponses(value = { + @EnumResponse(ResponseCode.OK), + @EnumResponse(ResponseCode.UserNotFound) + }) + ResponseEntity> validateReceipt( + @AuthUser Long userId, + @RequestBody PurchaseRequestDto purchaseRequestDto); +} diff --git a/genti-api/src/main/java/com/gt/genti/purchase/controller/UserPurchaseController.java b/genti-api/src/main/java/com/gt/genti/purchase/controller/UserPurchaseController.java index 1584f0c..eb701f3 100644 --- a/genti-api/src/main/java/com/gt/genti/purchase/controller/UserPurchaseController.java +++ b/genti-api/src/main/java/com/gt/genti/purchase/controller/UserPurchaseController.java @@ -1,5 +1,6 @@ package com.gt.genti.purchase.controller; +import com.gt.genti.purchase.api.UserPurchaseApi; import com.gt.genti.purchase.dto.request.PurchaseRequestDto; import com.gt.genti.purchase.service.InAppPurchaseService; import com.gt.genti.response.GentiResponse; @@ -14,7 +15,7 @@ @RestController @RequestMapping("/api/v1/users/in-app-purchases") @RequiredArgsConstructor -public class UserPurchaseController { +public class UserPurchaseController implements UserPurchaseApi { private final InAppPurchaseService inAppPurchaseService;