-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Refacotr] #495 - UserRepository 의존성 분리
- Loading branch information
ena-isme
committed
Mar 6, 2025
1 parent
45f09d1
commit 2c46a61
Showing
20 changed files
with
145 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
WSSiOS/WSSiOS/Source/Data/Repository/UserRepository/UserBlockRepository.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// | ||
// UserBlockRepository.swift | ||
// WSSiOS | ||
// | ||
// Created by 신지원 on 3/6/25. | ||
// | ||
|
||
import Foundation | ||
|
||
import RxSwift | ||
|
||
protocol UserBlockRepository { | ||
func getBlocksList() -> Observable<BlockUserEntity> | ||
func deleteBlockUser(blockID: Int) -> Observable<Void> | ||
func postBlockUser(userId: Int) -> Observable<Void> | ||
} | ||
|
||
struct DefaultUserBlockRepository: UserBlockRepository { | ||
private var blocksService: BlocksService | ||
|
||
init(blocksService: BlocksService) { | ||
self.blocksService = blocksService | ||
} | ||
|
||
//MARK: - BlockService | ||
|
||
func getBlocksList() -> Observable<BlockUserEntity> { | ||
return blocksService.getBlocksList() | ||
.map { $0.toEntity() } | ||
.asObservable() | ||
} | ||
|
||
func deleteBlockUser(blockID: Int) -> Observable<Void> { | ||
return blocksService.deleteBlockUser(blockID: blockID) | ||
.asObservable() | ||
} | ||
|
||
func postBlockUser(userId: Int) -> Observable<Void> { | ||
return blocksService.postBlockUser(blockID: userId) | ||
.asObservable() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
WSSiOS/WSSiOS/Source/Data/Repository/UserRepository/UserRepository.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// | ||
// UserRepository.swift | ||
// WSSiOS | ||
// | ||
// Created by 신지원 on 1/5/24. | ||
// | ||
|
||
import Foundation | ||
|
||
import RxSwift | ||
|
||
protocol UserRepository { | ||
var userInfoRepository: UserInfoRepository { get } | ||
var userBlockRepository: UserBlockRepository { get } | ||
} | ||
|
||
struct DefaultUserRepository: UserRepository { | ||
var userInfoRepository: any UserInfoRepository | ||
var userBlockRepository: any UserBlockRepository | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.