@@ -638,61 +638,53 @@ mod storage {
638
638
& self ,
639
639
merchant_id : & str ,
640
640
refund_details : & api_models:: refunds:: RefundListRequest ,
641
- storage_scheme : enums:: MerchantStorageScheme ,
641
+ _storage_scheme : enums:: MerchantStorageScheme ,
642
642
limit : i64 ,
643
643
offset : i64 ,
644
644
) -> CustomResult < Vec < diesel_models:: refund:: Refund > , errors:: StorageError > {
645
- match storage_scheme {
646
- enums :: MerchantStorageScheme :: PostgresOnly => {
647
- let conn = connection :: pg_connection_read ( self ) . await ? ;
648
- <diesel_models :: refund :: Refund as storage_types :: RefundDbExt > :: filter_by_constraints ( & conn , merchant_id, refund_details , limit , offset )
649
- . await
650
- . map_err ( Into :: into )
651
- . into_report ( )
652
- }
653
-
654
- enums :: MerchantStorageScheme :: RedisKv => Err ( errors :: StorageError :: KVError . into ( ) ) ,
655
- }
645
+ let conn = connection :: pg_connection_read ( self ) . await ? ;
646
+ <diesel_models :: refund :: Refund as storage_types :: RefundDbExt > :: filter_by_constraints (
647
+ & conn,
648
+ merchant_id,
649
+ refund_details ,
650
+ limit ,
651
+ offset ,
652
+ )
653
+ . await
654
+ . map_err ( Into :: into)
655
+ . into_report ( )
656
656
}
657
657
658
658
#[ cfg( feature = "olap" ) ]
659
659
async fn filter_refund_by_meta_constraints (
660
660
& self ,
661
661
merchant_id : & str ,
662
662
refund_details : & api_models:: refunds:: TimeRange ,
663
- storage_scheme : enums:: MerchantStorageScheme ,
663
+ _storage_scheme : enums:: MerchantStorageScheme ,
664
664
) -> CustomResult < api_models:: refunds:: RefundListMetaData , errors:: StorageError > {
665
- match storage_scheme {
666
- enums:: MerchantStorageScheme :: PostgresOnly => {
667
- let conn = connection:: pg_connection_read ( self ) . await ?;
668
- <diesel_models:: refund:: Refund as storage_types:: RefundDbExt >:: filter_by_meta_constraints ( & conn, merchant_id, refund_details)
665
+ let conn = connection:: pg_connection_read ( self ) . await ?;
666
+ <diesel_models:: refund:: Refund as storage_types:: RefundDbExt >:: filter_by_meta_constraints ( & conn, merchant_id, refund_details)
669
667
. await
670
668
. map_err ( Into :: into)
671
669
. into_report ( )
672
- }
673
-
674
- enums:: MerchantStorageScheme :: RedisKv => Err ( errors:: StorageError :: KVError . into ( ) ) ,
675
- }
676
670
}
677
671
678
672
#[ cfg( feature = "olap" ) ]
679
673
async fn get_total_count_of_refunds (
680
674
& self ,
681
675
merchant_id : & str ,
682
676
refund_details : & api_models:: refunds:: RefundListRequest ,
683
- storage_scheme : enums:: MerchantStorageScheme ,
677
+ _storage_scheme : enums:: MerchantStorageScheme ,
684
678
) -> CustomResult < i64 , errors:: StorageError > {
685
- match storage_scheme {
686
- enums:: MerchantStorageScheme :: PostgresOnly => {
687
- let conn = connection:: pg_connection_read ( self ) . await ?;
688
- <diesel_models:: refund:: Refund as storage_types:: RefundDbExt >:: get_refunds_count ( & conn, merchant_id, refund_details)
689
- . await
690
- . map_err ( Into :: into)
691
- . into_report ( )
692
- }
693
-
694
- enums:: MerchantStorageScheme :: RedisKv => Err ( errors:: StorageError :: KVError . into ( ) ) ,
695
- }
679
+ let conn = connection:: pg_connection_read ( self ) . await ?;
680
+ <diesel_models:: refund:: Refund as storage_types:: RefundDbExt >:: get_refunds_count (
681
+ & conn,
682
+ merchant_id,
683
+ refund_details,
684
+ )
685
+ . await
686
+ . map_err ( Into :: into)
687
+ . into_report ( )
696
688
}
697
689
}
698
690
}
0 commit comments