diff --git a/Smashing-Assignment/Networks/API/PersonAPI.swift b/Smashing-Assignment/Networks/API/PeopleAPI.swift
similarity index 77%
rename from Smashing-Assignment/Networks/API/PersonAPI.swift
rename to Smashing-Assignment/Networks/API/PeopleAPI.swift
index 4f20349..6481e83 100644
--- a/Smashing-Assignment/Networks/API/PersonAPI.swift
+++ b/Smashing-Assignment/Networks/API/PeopleAPI.swift
@@ -9,11 +9,11 @@ import Foundation
import Moya
import Alamofire
-enum PersonAPI {
- case fetchPeople(page: Int)
+enum PeopleAPI {
+ case fetchPeople(name: String, page: Int)
}
-extension PersonAPI: BaseTargetType {
+extension PeopleAPI: BaseTargetType {
var path: String {
switch self {
@@ -28,9 +28,10 @@ extension PersonAPI: BaseTargetType {
var task: Task {
switch self {
- case .fetchPeople(let page):
+ case .fetchPeople(let name, let page):
return .requestParameters(
parameters: ["key": Environment.movie_API_Key,
+ "peopleNm": name,
"curPage": page,
"itemPerPage": 10],
encoding: URLEncoding.default)
diff --git a/Smashing-Assignment/Presentation/Core/HJB/Combine4/SearchMovieCollectionViewCell.swift b/Smashing-Assignment/Presentation/Core/HJB/Combine4/SearchMovieCollectionViewCell.swift
new file mode 100644
index 0000000..9be9850
--- /dev/null
+++ b/Smashing-Assignment/Presentation/Core/HJB/Combine4/SearchMovieCollectionViewCell.swift
@@ -0,0 +1,66 @@
+//
+// SearchMovieCollectionViewCell.swift
+// Smashing-Assignment
+//
+// Created by 홍준범 on 1/8/26.
+//
+
+import UIKit
+import Combine
+
+import SnapKit
+import Then
+
+final class SearchPeopleCollectionViewCell: UICollectionViewCell {
+
+ static let identifier: String = "SearchPeopleCollectionViewCell"
+
+ private let peopleNameLabel = UILabel().then {
+ $0.font = .systemFont(ofSize: 20, weight: .bold)
+ }
+
+ private let roleLabel = UILabel().then {
+ $0.textAlignment = .right
+ $0.font = .systemFont(ofSize: 14, weight: .regular)
+ $0.textColor = .systemGray
+ }
+ override init(frame: CGRect) {
+ super.init(frame: frame)
+ contentView.addSubview(peopleNameLabel)
+ contentView.addSubview(roleLabel)
+
+ peopleNameLabel.snp.makeConstraints { make in
+ make.centerY.equalToSuperview()
+ make.leading.equalToSuperview().offset(16)
+ make.trailing.equalTo(roleLabel.snp.leading).offset(-10)
+ }
+
+ roleLabel.snp.makeConstraints { make in
+ make.centerY.equalToSuperview()
+ make.trailing.equalToSuperview().offset(-16)
+ make.width.equalTo(80)
+ }
+ }
+
+ required init?(coder: NSCoder) {
+ fatalError("init(coder:) has not been implemented")
+ }
+
+ func configure(data: PeopleDTO, index: Int) {
+ // 색상 변경 (10명씩 다른 색)
+ switch (index / 10) % 3 {
+ case 0:
+ peopleNameLabel.textColor = .systemPink
+ case 1:
+ peopleNameLabel.textColor = .systemCyan
+ case 2:
+ peopleNameLabel.textColor = .systemGreen
+ default:
+ peopleNameLabel.textColor = .white
+ }
+
+ peopleNameLabel.text = "\(index + 1): \(data.peopleNm)"
+ roleLabel.text = data.repRoleNm ?? "-"
+ }
+
+}
diff --git a/Smashing-Assignment/Presentation/Core/HJB/Combine4/SearchMovieViewModel.swift b/Smashing-Assignment/Presentation/Core/HJB/Combine4/SearchMovieViewModel.swift
new file mode 100644
index 0000000..a02945c
--- /dev/null
+++ b/Smashing-Assignment/Presentation/Core/HJB/Combine4/SearchMovieViewModel.swift
@@ -0,0 +1,157 @@
+//
+// SearchMovieViewModel.swift
+// Smashing-Assignment
+//
+// Created by 홍준범 on 1/8/26.
+//
+
+import Foundation
+import Combine
+
+protocol InputOutputProtocol {
+
+ associatedtype Input
+ associatedtype Output
+
+ func transform(input: AnyPublisher) -> Output
+
+}
+//
+//protocol SearchPeopleViewModelProtocol {
+// associatedtype Input
+// associatedtype Output
+//
+// func transform(input: AnyPublisher) -> Output
+//
+// var people: [PeopleDTO] { get }
+// var numberOfPeople: Int { get }
+// func person(at index: Int) -> PeopleDTO?
+//
+//}
+
+protocol SearchPeopleViewModelProtocol: InputOutputProtocol where Input == SearchPeopleViewModel.Input, Output == SearchPeopleViewModel.Output {
+ var people: [PeopleDTO] { get }
+ var numberOfPeople: Int { get }
+ func person(at index: Int) -> PeopleDTO?
+}
+
+class SearchPeopleViewModel: SearchPeopleViewModelProtocol {
+
+ enum Input {
+ case searchTextChanged(String)
+ case scrollReachedBottom
+ }
+
+ struct Output {
+ let people = PassthroughSubject<[PeopleDTO], Never>.init()
+ let error = PassthroughSubject.init()
+ let isLoading = CurrentValueSubject.init(false)
+ }
+
+// struct Output {
+// let people: PassthroughSubject<[PeopleDTO], Never>
+// let error: PassthroughSubject
+// let isLoading: CurrentValueSubject
+// }
+//
+// private let output = Output(
+// people: PassthroughSubject(),
+// error: PassthroughSubject(),
+// isLoading: CurrentValueSubject(false)
+// )
+//
+// private let outputPublisher = PassthroughSubject