11package com .nowait .applicationuser .storepayment .controller ;
22
3+ import java .util .Optional ;
4+
35import org .springframework .http .HttpStatus ;
46import org .springframework .http .ResponseEntity ;
57import org .springframework .web .bind .annotation .GetMapping ;
68import org .springframework .web .bind .annotation .PathVariable ;
79import org .springframework .web .bind .annotation .RequestMapping ;
810import org .springframework .web .bind .annotation .RestController ;
911
12+ import com .nowait .applicationuser .storepayment .dto .StorePaymentReadDto ;
1013import com .nowait .applicationuser .storepayment .service .StorePaymentService ;
1114import com .nowait .common .api .ApiUtils ;
1215
1316import io .swagger .v3 .oas .annotations .Operation ;
1417import io .swagger .v3 .oas .annotations .responses .ApiResponse ;
1518import io .swagger .v3 .oas .annotations .tags .Tag ;
16- import jakarta .validation .Valid ;
1719import lombok .RequiredArgsConstructor ;
1820import lombok .extern .slf4j .Slf4j ;
1921
@@ -30,12 +32,25 @@ public class StorePaymentController {
3032 @ Operation (summary = "주점 결제 정보 조회" , description = "주점 ID로 주점 결제 정보를 조회합니다." )
3133 @ ApiResponse (responseCode = "200" , description = "주점 결제 정보 조회 성공" )
3234 public ResponseEntity <?> getStorePaymentByStoreId (@ PathVariable Long storeId ) {
33- return ResponseEntity
34- .status (HttpStatus .OK )
35- .body (
36- ApiUtils .success (
37- storePaymentService .getStorePaymentByStoreId (storeId )
38- )
39- );
35+ Optional <StorePaymentReadDto > response = storePaymentService .getStorePaymentByStoreId (storeId );
36+
37+ if (response .isPresent ()) {
38+ return ResponseEntity
39+ .status (HttpStatus .OK )
40+ .body (
41+ ApiUtils .success (
42+ response
43+ )
44+ );
45+ } else {
46+ return ResponseEntity
47+ .status (HttpStatus .NO_CONTENT )
48+ .body (
49+ ApiUtils .success (
50+ response
51+ )
52+ );
53+ }
54+
4055 }
4156}
0 commit comments