Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
144 commits
Select commit Hold shift + click to select a range
8db3f9a
refactor/#131: 디자인시스템 모듈화
0Hooni May 2, 2025
55e2f41
feat/#131: SearchFeature 모듈 추가
0Hooni May 2, 2025
52dce12
feat/#131: 상단 검색바 View 구현
0Hooni May 2, 2025
caa5893
chore/#131: 관련 패키지 및 프레임워크 추가
0Hooni May 2, 2025
38fa728
feat/#131: ViewController, Reactor 구현 및 초기화면 변경
0Hooni May 2, 2025
94f4188
chore/#131: SearchFeatureDemo용 Provisioning 등록
0Hooni May 2, 2025
cbb41a0
feat/#131: 반복 사용될 팝업 그리드 뷰 compositionalLayout 구현
0Hooni May 2, 2025
a23bbf7
feat/#131: PopupCollectionViewCell 이식
0Hooni May 2, 2025
7d3ca88
add/#131: 필요한 디자인 파일 추가
0Hooni May 2, 2025
e4a8652
fix/#131: HeaderSection layout 제거
0Hooni May 2, 2025
62d35a6
refactor/#131: 접근제어자 수정
0Hooni May 2, 2025
f731e4f
feat/#131: DiffableDatasource 적용
0Hooni May 2, 2025
519b187
feat/#131: 재사용되는 TagCollectionView 이식
0Hooni May 2, 2025
6abccbf
refactor/#131: GridCell 로직 개선
0Hooni May 2, 2025
9330680
refactor/#131: Inputable에 Hashable 채택
0Hooni May 2, 2025
b3fbe66
chore/#131: 프레임워크 embed 설정 수정
0Hooni May 3, 2025
e11325b
feat/#131: 팝업 검색 View 구현
0Hooni May 3, 2025
f0c651f
fix/#131: 팝업 검색 ViewController 수정
0Hooni May 3, 2025
e6f3f0e
remove/#131: 사용하지 않는 View 제거
0Hooni May 3, 2025
6dfe683
refactor/#131: 레이아웃 수정
0Hooni May 3, 2025
be5d716
feat/#131: TagCollectionView 돚거
0Hooni May 3, 2025
a9adab4
feat/#131: TagCollectionView에 사용될 HeaderView 구현
0Hooni May 3, 2025
2a056b3
refactor/#131: 불필요한 코드 제거
0Hooni May 3, 2025
8929ecf
feat/#131: 필요한 의존성 등록 및 reactor 주입
0Hooni May 3, 2025
24bfa12
chore/#131: 커스텀 폰트 디자인 시스템으로 이동
0Hooni May 3, 2025
150585d
fix/#131: 디자인시스템이 폰트를 찾지 못하는 문제 해결
0Hooni May 3, 2025
d485a11
feat/#131: 팝업 스토어 검색 결과 데이터 바인딩
0Hooni May 3, 2025
373f616
fix/#131: snapShot이 적용되지 않는 문제 해결
0Hooni May 3, 2025
1d90d08
add/#131: 필요한 에셋 추가
0Hooni May 3, 2025
c185aef
feat/#131: 팝업 그리드 헤더 뷰 추가
0Hooni May 3, 2025
03cf353
feat/#131: 팝업 검색 결과 헤더 추가
0Hooni May 3, 2025
cd9c91f
feat/#131: 카테고리 선택 모달 구현
0Hooni May 3, 2025
6f8adc7
fix/#131: 검색화면 레이아웃 조정
0Hooni May 4, 2025
bd9310e
fix/#131: 카테고리 선택 화면 레이아웃 수정
0Hooni May 4, 2025
ffc349f
refactor/#131: 팝업 헤더 업데이트 방식 적용
0Hooni May 4, 2025
058046c
refactor/#131: 네이밍 수정
0Hooni May 4, 2025
7a2b465
feat/#131: 필터 선택 화면 구현
0Hooni May 4, 2025
85752c8
feat/#131: 필터 옵션 선택 버튼 바인딩
0Hooni May 4, 2025
3b698fe
feat/#131: 필터 옵션 기반 결과 변경 구현
0Hooni May 4, 2025
d9a51d2
feat/#131: 새로운 카테고리 API 반영
0Hooni May 4, 2025
2519e09
feat/#131: 카테고리 선택화면에서 선택한 카테고리 반영되도록 수정
0Hooni May 4, 2025
2eae6f1
fix/#131: 태그 사이사이 간격 조정
0Hooni May 4, 2025
10641e7
fix/#131: 카테고리가 변경이 없다면 fetch를 실행하지 않도록 수정
0Hooni May 4, 2025
24ff9bb
fix/#131: 카테고리가 변경이 없다면 fetch를 실행하지 않도록 수정
0Hooni May 4, 2025
f0599ac
Merge branch 'feat/#131-search-feature-module' of https://github.com/…
0Hooni May 4, 2025
94c8618
feat/#131: 페이지네이션 구현
0Hooni May 4, 2025
89a0627
fix/#131: 소소한 버그들 수정
0Hooni May 4, 2025
4e001e5
feat/#131: 카테고리 지우기 버튼 기능 구현
0Hooni May 4, 2025
d37cd92
refactor/#131: 필터 선택 화면 이동 로직 단순화
0Hooni May 4, 2025
1d0005c
fix/#131: 카테고리 태그 목록의 간격이 이상하던 문제 수정
0Hooni May 4, 2025
61a77c1
fix/#131: 소소한 수정
0Hooni May 4, 2025
fac0c99
chore/#131: 주석 추가
0Hooni May 4, 2025
284b024
refactor/#131: 폴더링 및 네이밍 개선
0Hooni May 6, 2025
b253af9
refactor/#131: 데이터소스 관리 개선
0Hooni May 6, 2025
3f3d657
feat/#131: 검색을 위한 API 흐름 추가
0Hooni May 5, 2025
f49470f
refactor/#131: 유즈케이스 이름 개선
0Hooni May 6, 2025
c7e566b
fix/#131: 레이아웃 에러 수정
0Hooni May 6, 2025
e83fa26
refactor/#131: 리액터 개선
0Hooni May 6, 2025
219e951
recator/#131: 카테고리 지우기 리액터 개선
0Hooni May 6, 2025
9a02893
refactor/#131: 카테고리 present 리액터 흐름 개선
0Hooni May 6, 2025
77c4291
refactor/#131: 리액터 개선
0Hooni May 6, 2025
aedac21
fix/#131: 페이지네이션이 종종 안되던 문제 수정
0Hooni May 6, 2025
9b56f1d
refactor/#131: 리액터 흐름 개선
0Hooni May 6, 2025
d722253
refactor/#131: 흐름 개선 거의 마무리...?
0Hooni May 6, 2025
b206651
refactor/#131: 리액터 흐름 개선 완
0Hooni May 6, 2025
a30e02b
refactor/#131: 페이지네이션 오류 수정
0Hooni May 6, 2025
25c1912
feat/#131: 최근 검색어 모두 삭제 기능 구현
0Hooni May 6, 2025
6b457d2
refactor/#131: 삭제 기능 캡슐화
0Hooni May 6, 2025
04fd431
fix/#131: 페이지네이션이 한번만 되는 문제 수정
0Hooni May 6, 2025
bc3e11b
refactor/#131: 네이밍 수정
0Hooni May 6, 2025
03565ed
refactor/#131: 메서드 수정
0Hooni May 6, 2025
34c79e5
feat/#131: 검색 기능 구현
0Hooni May 6, 2025
32abac6
feat/#131: 텍스트필드 지우기 버튼 동작 구현
0Hooni May 6, 2025
3110b6b
feat/#131: 외부 영역 터치시 동작 구현
0Hooni May 6, 2025
fa5ca67
refactor/#131: ViewController 코드정리
0Hooni May 6, 2025
0000bee
refactor/#131: 네이밍 수정
0Hooni May 6, 2025
30d89c0
refactor/#131: 검색한 상태에서 이전 화면으로 돌아가기 기능 구현
0Hooni May 6, 2025
0e7a532
feat/#131: 최근 검색어 태그 삭제 기능 구현
0Hooni May 6, 2025
63c427d
feat/#131: 최근 검색어 태그 터치시 액션 구현
0Hooni May 6, 2025
2d2901a
fix/#131: tapGestureRecog가 cell의 터치를 가로채가는 문제 해결
0Hooni May 6, 2025
7dd1de6
refactor/#131: 메서드 순서 조정
0Hooni May 7, 2025
6a836b6
feat/#131: 검색 이후에 헤더가 다르게 뜨도록 수정
0Hooni May 7, 2025
d9ea5b7
feat/#131: 검색 결과가 없을때 보여줄 label 띄우기 구현
0Hooni May 7, 2025
22225f6
fix/#131: 검색 결과가 없을때는 헤더를 지워지게 해줌
0Hooni May 7, 2025
46217e4
refactor/#131: View로부터 레이아웃 관심사를 분리
0Hooni May 7, 2025
1ed5563
fix/#131: 실기기 빌드 문제 해결
0Hooni May 7, 2025
648af9b
refactor/#131: Int형으로 전환을 toDomain에서 잘 보이도록 수정함
0Hooni May 7, 2025
081bccf
fix/#131: 디자인시스템 폰트로 적용되도록 수정
0Hooni May 7, 2025
1d8aaa3
refactor/#131: 필터 선택 리액터 개선
0Hooni May 7, 2025
1984486
refactor/#131: 카테고리 리액터 개선
0Hooni May 7, 2025
2d7e31d
refactor/#131: 팝업 검색 리액터 좀 개선
0Hooni May 7, 2025
2b5f0af
refactor/#131: 데이터에서만 구체적인 비트를 따르도록 수정
0Hooni May 8, 2025
2d981ba
chore/#131: 폰트가 빠져있던 문제 해결
0Hooni May 8, 2025
e4991ab
chore/#131: 폰트를 디자인시스템으로 이동
0Hooni May 8, 2025
11ac459
fix/#131: Int64 → Int 대응
0Hooni May 8, 2025
8b6993b
Merge branch 'feat/#131-이쯤부터-다시복구-드가자' of https://github.com/PopPool/…
0Hooni May 8, 2025
c220a7d
refactor/#131: 팬 모달 자꾸 에러나서 일단 지움
0Hooni May 8, 2025
4ad4acc
feat/#131: PanModal 대체품 생산
0Hooni May 8, 2025
99652b6
refactor/#131: 필터 선택 커스텀 모달 적용 및 레이아웃 수정
0Hooni May 8, 2025
4530ec9
refactor/#131: 카테고리 선택 커스텀 모달 적용 및 레이아웃 수정
0Hooni May 8, 2025
4fb4617
refactor/#131: PPSearchBar 디자인시스템으로 이동
0Hooni May 8, 2025
7eea641
refactor/#131: PopupGrid에 있던 Inputable 제거
0Hooni May 8, 2025
743f3ec
refactor/#131: TagCollectionViewCell Input 객체 제거
0Hooni May 8, 2025
e44ca64
refactor/#131: SearchFeature에서 Inputable 모두 제거
0Hooni May 8, 2025
64cf9e4
refactor/#131: View가 모델의 Case를 의존하지 않도록 수정
0Hooni May 8, 2025
538431f
fix/#131: 필터가 바뀌면 무조건 저장 버튼이 뜨는 문제 해결
0Hooni May 8, 2025
79424c0
refactor/#131: 리액터의 케이스 순서에 맞게 코드 위치 조정
0Hooni May 8, 2025
f436601
fix/#131: 레이아웃 검토 후 수정
0Hooni May 8, 2025
d8a8676
feat/#131: 코디네이터 모듈 생성
0Hooni May 8, 2025
069bbfd
feat/#131: SearchFeature 화면 내부 전환을 코디네이터에게 전달
0Hooni May 8, 2025
74b42eb
refactor/#131: 화면 전환을 위한 Coordinator를 search에 적용
0Hooni May 8, 2025
f6c8757
fix/#131: inset을 두번 잡았던 부분 수정
0Hooni May 8, 2025
5783777
refactor/#131: 코디네이터 제거
0Hooni May 9, 2025
c58af06
reafactor/#131: FactoryPattern을 이용해서 View를 만들도록 수정
0Hooni May 9, 2025
2fd0421
refactor/#131: 필터 선택 화면 Factory 적용
0Hooni May 9, 2025
4662ada
feat/#131: 팝업 상세 팩토리 적용
0Hooni May 9, 2025
559e17f
feat/#131: SearchFeature에서 팝업 디테일로 가는 의존성 구현
0Hooni May 9, 2025
f83725a
refactor/#131: 홈 화면에서 SearchBar로 신규 모듈로 접근하도록 수정
0Hooni May 9, 2025
de168f8
refactor/#131: 일부 Section을 사용이 필요한 View로 이동
0Hooni May 9, 2025
87517f3
refactor/#131: 기존에 사용하던 SearchScene 제거
0Hooni May 9, 2025
107ea1b
fix/#131: 데모앱 실기기 @rPath 문제 해결
0Hooni May 9, 2025
2af8b16
fix/#131: 검색에 성공했을때만 키워드를 저장하도록 수정
0Hooni May 9, 2025
c19b503
refactor/#131: 메서드의 이름을 더 정확하게 수정
0Hooni May 9, 2025
4143682
refactor/#131: Cell reuse를 위해 기존의 cell을 비우도록 설정
0Hooni May 9, 2025
8c231c9
feat/#131: 북마크 버튼을 탭했을때 기능 추가
0Hooni May 9, 2025
a51fda6
refactor/#131: 폴더링 다시
0Hooni May 10, 2025
3521057
refactor/#131: 가독성 개선
0Hooni May 10, 2025
360a858
fix/#131: 모달이 뜰 때 뒷 화면이 새로고침 되는 문제 수정
0Hooni May 10, 2025
9aca3d2
fix/#131: Section마다 다르게 업데이트 하도록 수정
0Hooni May 10, 2025
c505cd5
Merge branch 'feat/#131-이쯤부터-다시복구-드가자' of https://github.com/PopPool/…
0Hooni May 10, 2025
69b2944
fix/#131: 세개의 섹션으로 분리하여 각각 데이터소스 적용하도록 수정
0Hooni May 11, 2025
12f2e66
fix/#131: 북마크시 셀 깜빡임 문제 해결
0Hooni May 11, 2025
0eec33b
feat/#131: 검색어 최대 10개까지만 보이도록 수정
0Hooni May 11, 2025
43e5f2b
refactor/#131: 폴더링 및 리네임
0Hooni May 11, 2025
5f93b5e
Merge branch 'develop' of https://github.com/PopPool/iOS into feat/#1…
0Hooni May 11, 2025
a6070ae
style/#131: Apply SwiftLint autocorrect
github-actions[bot] May 11, 2025
1e6c28f
Merge branch 'develop' into feat/#131-search-feature-module
0Hooni May 13, 2025
bb997f6
fix/#131: 결과 없음 라벨을 눌렀을 때 충돌이 나는 문제 해결
0Hooni May 13, 2025
2003292
Merge branch 'feat/#131-search-feature-module' of https://github.com/…
0Hooni May 13, 2025
4382cf1
chore/#131: 사용하지 않는 주석 제거
0Hooni May 15, 2025
f6ecadb
fix/#131: static으로 선언된 cell identifier를 제거
0Hooni May 15, 2025
edaa734
refactor/#131: ReusableView의 identifier를 사용하도록 수정
0Hooni May 15, 2025
b4f5e85
Merge branch 'develop' of https://github.com/PopPool/iOS into feat/#1…
0Hooni May 15, 2025
429c3a1
fix/#131: develop merge로 인한 코드 오류 수정
0Hooni May 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions Poppool/.swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ disabled_rules:
- identifier_name
- cyclomatic_complexity
- redundant_optional_initialization
- function_parameter_count

# 기본(default) 룰이 아닌 룰들을 활성화
opt_in_rules:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
files = (
4EBC91D32DB8039800495C3B /* OSLog.framework in Frameworks */,
0522C1D72DB67B4F00B141FF /* RxSwift in Frameworks */,
05EC93DE2DB6612100771CB3 /* RxGesture in Frameworks */,
05EC93D92DB6605100771CB3 /* RxCocoa in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -112,7 +111,6 @@
name = Infrastructure;
packageProductDependencies = (
05EC93D82DB6605100771CB3 /* RxCocoa */,
05EC93DD2DB6612100771CB3 /* RxGesture */,
0522C1D62DB67B4F00B141FF /* RxSwift */,
);
productName = Infrastructure;
Expand Down Expand Up @@ -436,11 +434,6 @@
package = 05C1D82E2DB53CE300508FFD /* XCRemoteSwiftPackageReference "RxSwift" */;
productName = RxCocoa;
};
05EC93DD2DB6612100771CB3 /* RxGesture */ = {
isa = XCSwiftPackageProductDependency;
package = 05EC93DC2DB6612100771CB3 /* XCRemoteSwiftPackageReference "RxGesture" */;
productName = RxGesture;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 058CC90F2DB5383C0084221A /* Project object */;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,63 @@ public final class UserDefaultService {
UserDefaults.standard.removeObject(forKey: key)
}
}

// MARK: - Key base
extension UserDefaultService {
public enum Key: String {
case searchKeyword = "searchList"
}

/// Userdefault 데이터 저장 메서드
/// - Parameters:
/// - key: 저장하는 데이터의 키 값 i.e) 유저 id 등
/// - value: 저장하는 데이터 값 i.e) access token 등
/// - to: 로컬 데이터베이스 타입 - DatabaseType
/// - Returns: 별도 안내 없음
public func save(keyType: Key, value: String) {
UserDefaults.standard.set(value, forKey: keyType.rawValue)
}

/// Userdefault 데이터 저장 메서드
/// - Parameters:
/// - key: 저장하는 데이터의 키 값 i.e) 유저 id 등
/// - value: 저장하는 데이터 값 i.e) access token 등
/// - to: 로컬 데이터베이스 타입 - DatabaseType
/// - Returns: 별도 안내 없음
public func save(keyType: Key, value: [String]) {
UserDefaults.standard.set(value, forKey: keyType.rawValue)
}

/// Userdefault 데이터 발견 메서드
/// - Parameters:
/// - key: 찾는 데이터의 키 값 i.e) 유저 id 등
/// - from: 로컬 데이터베이스 타입 - DatabaseType
/// - Returns: 찾은 데이터 - String 타입
public func fetch(keyType: Key) -> String? {
if let token = UserDefaults.standard.string(forKey: keyType.rawValue) {
return token
}
return nil
}

/// Userdefault 데이터 발견 메서드
/// - Parameters:
/// - key: 찾는 데이터의 키 값 i.e) 유저 id 등
/// - from: 로컬 데이터베이스 타입 - DatabaseType
/// - Returns: 찾은 데이터 - String 타입
public func fetchArray(keyType: Key) -> [String]? {
if let token = UserDefaults.standard.array(forKey: keyType.rawValue) as? [String] {
return token
}
return nil
}

/// Userdefault 데이터 삭제 메서드
/// - Parameters:
/// - key: 삭제하는 데이터의 키 값 i.e) 유저 id 등
/// - from: 로컬 데이터베이스 타입 - DatabaseType
/// - Returns: 별도 안내 없음
public func delete(keyType: Key) {
UserDefaults.standard.removeObject(forKey: keyType.rawValue)
}
}
8 changes: 7 additions & 1 deletion Poppool/DataLayer/Data/Data.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
Network/API/AuthAPI/AuthAPIEndPoint.swift,
Network/API/AuthAPI/ResponseDTO/LoginResponseDTO.swift,
Network/API/AuthAPI/ResponseDTO/PostTokenReissueResponseDTO.swift,
Network/API/CategoryAPI/CategoryAPIEndpoint.swift,
Network/API/CategoryAPI/ResponseDTO/GetCategoryListResponseDTO.swift,
Network/API/CommentAPI/CommentAPIEndPoint.swift,
Network/API/CommentAPI/RequestDTO/DeleteCommentRequestDTO.swift,
Network/API/CommentAPI/RequestDTO/PostCommentRequestDTO.swift,
Expand All @@ -57,9 +59,11 @@
Network/API/PreSignedAPI/RequestDTO/PresignedURLRequestDTO.swift,
Network/API/PreSignedAPI/ResponseDTO/PreSignedURLDTO.swift,
Network/API/PreSignedAPI/ResponseDTO/PreSignedURLResponseDTO.swift,
Network/API/SearchAPI/RequestDTO/GetSearchPopupStoreRequestDTO.swift,
Network/API/SearchAPI/ResponseDTO/GetSearchPopupStoreResponseDTO.swift,
Network/API/SearchAPI/SearchAPIEndPoint.swift,
Network/API/SignUpAPI/RequestDTO/CheckNickNameRequestDTO.swift,
Network/API/SignUpAPI/RequestDTO/SignUpRequestDTO.swift,
Network/API/SignUpAPI/ResponseDTO/GetCategoryListResponseDTO.swift,
Network/API/SignUpAPI/SignUpAPIEndpoint.swift,
Network/API/UserAPI/RequesetDTO/CommentLikeRequestDTO.swift,
Network/API/UserAPI/RequesetDTO/GetMyCommentRequestDTO.swift,
Expand Down Expand Up @@ -96,13 +100,15 @@
RepositoryImpl/AdminRepositoryImpl.swift,
RepositoryImpl/AppleLoginRepositoryImpl.swift,
RepositoryImpl/AuthAPIRepositoryImpl.swift,
RepositoryImpl/CategoryRepositoryImpl.swift,
RepositoryImpl/CommentAPIRepositoryImpl.swift,
RepositoryImpl/HomeAPIRepositoryImpl.swift,
RepositoryImpl/KakaoLoginRepositoryImpl.swift,
RepositoryImpl/MapDirectionRepositoryImpl.swift,
RepositoryImpl/MapRepositoryImpl.swift,
RepositoryImpl/PopUpAPIRepositoryImpl.swift,
RepositoryImpl/PreSignedRepositoryImpl.swift,
RepositoryImpl/Search/SearchAPIRepositoryImpl.swift,
RepositoryImpl/SignUpRepositoryImpl.swift,
RepositoryImpl/UserAPIRepositoryImpl.swift,
);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Foundation

import Infrastructure

struct CategoryAPIEndpoint {

/// 관심사 목록을 가져옵니다.
/// - Returns: Endpoint<GetInterestListResponseDTO>
static func getCategoryList() -> Endpoint<GetCategoryListResponseDTO> {
return Endpoint(
baseURL: Secrets.popPoolBaseURL,
path: "/categories",
method: .get
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ struct GetCategoryListResponseDTO: Codable {

// MARK: - InterestResponse
struct CategoryResponseDTO: Codable {
let categoryId: Int64
let categoryId: Int32
let categoryName: String
}

extension CategoryResponseDTO {
func toDomain() -> CategoryResponse {
return CategoryResponse(categoryId: categoryId, category: categoryName)
return CategoryResponse(categoryId: Int(categoryId), category: categoryName)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Foundation

struct GetSearchPopupStoreRequestDTO: Encodable {
let query: String
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Foundation

import DomainInterface

struct GetSearchPopupStoreResponseDTO: Decodable {
var popUpStoreList: [PopUpStoreResponseDTO]
var loginYn: Bool
}

extension GetSearchPopupStoreResponseDTO {
func toDomain() -> KeywordBasePopupStoreListResponse {
return KeywordBasePopupStoreListResponse(
popupStoreList: popUpStoreList.map { $0.toDomain() },
loginYn: loginYn
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import Foundation

import Infrastructure

import RxSwift

struct SearchAPIEndPoint {

static func getSearchPopUpList(request: GetSearchPopupStoreRequestDTO) -> Endpoint<GetSearchPopupStoreResponseDTO> {
return Endpoint(
baseURL: Secrets.popPoolBaseURL,
path: "/search/popup-stores",
method: .get,
queryParameters: request
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ struct SignUpRequestDTO: Encodable {
var age: Int32
var socialEmail: String
var socialType: String
var interestCategories: [Int64]
var interestCategories: [Int]
var appleAuthorizationCode: String?
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public final class AdminRepositoryImpl: AdminRepository {
AdminStoreDetail(
id: dto.id,
name: dto.name,
categoryId: dto.categoryId,
categoryId: Int(dto.categoryId),
categoryName: dto.categoryName,
description: dto.desc,
address: dto.address,
Expand Down Expand Up @@ -77,7 +77,7 @@ public final class AdminRepositoryImpl: AdminRepository {
public func createStore(params: CreateStoreParams) -> Completable {
let dto = CreatePopUpStoreRequestDTO(
name: params.name,
categoryId: params.categoryId,
categoryId: Int64(params.categoryId),
desc: params.desc,
address: params.address,
startDate: params.startDate,
Expand All @@ -99,7 +99,7 @@ public final class AdminRepositoryImpl: AdminRepository {
popUpStore: UpdatePopUpStoreRequestDTO.PopUpStore(
id: params.id,
name: params.name,
categoryId: params.categoryId,
categoryId: Int64(params.categoryId),
desc: params.desc,
address: params.address,
startDate: params.startDate,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import Foundation

import DomainInterface

import RxSwift

public final class CategoryRepositoryImpl: CategoryRepository {

private let provider: Provider

public init(provider: Provider) {
self.provider = provider
}

public func fetchCategoryList() -> Observable<[CategoryResponse]> {
let endPoint = CategoryAPIEndpoint.getCategoryList()
return provider.requestData(with: endPoint, interceptor: TokenInterceptor()).map { responseDTO in
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tokenInterceptor를 class에서 생성하지 않고 사용할 때 마다 사용하는 이유가 궁금한데 이유를 알 수 있을까요?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

의존성 주입 개념으로 넣어두었고, 추후 인터페이스 추상화를 통해 주입해주면 좋겠다 싶어 우선적으로 저렇게 뒀었습니다☺️

return responseDTO.categoryResponseList.map({ $0.toDomain() })
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ public final class MapRepositoryImpl: MapRepository {
northEastLon: Double,
southWestLat: Double,
southWestLon: Double,
categories: [Int64]
categories: [Int]
) -> Observable<[MapPopUpStore]> {
return provider.requestData(
with: MapAPIEndpoint.locations_fetchStoresInBounds(
northEastLat: northEastLat,
northEastLon: northEastLon,
southWestLat: southWestLat,
southWestLon: southWestLon,
categories: categories
categories: categories.map { Int64($0 ) }
),
interceptor: TokenInterceptor()
)
Expand All @@ -35,12 +35,12 @@ public final class MapRepositoryImpl: MapRepository {

public func searchStores(
query: String,
categories: [Int64]
categories: [Int]
) -> Observable<[MapPopUpStore]> {
return provider.requestData(
with: MapAPIEndpoint.locations_searchStores(
query: query,
categories: categories
categories: categories.map { Int64($0 ) }
),
interceptor: TokenInterceptor()
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import Foundation

import DomainInterface
import Infrastructure

import RxSwift

public final class SearchAPIRepositoryImpl: SearchAPIRepository {

private let provider: Provider
private let tokenInterceptor = TokenInterceptor()
private let userDefaultService: UserDefaultService

public init(
provider: Provider,
userDefaultService: UserDefaultService
) {
self.provider = provider
self.userDefaultService = userDefaultService
}

public func fetchSearchResult(by query: String) -> Observable<KeywordBasePopupStoreListResponse> {

let request = GetSearchPopupStoreRequestDTO(query: query)
let endPoint = SearchAPIEndPoint.getSearchPopUpList(request: request)
return provider.requestData(
with: endPoint,
interceptor: tokenInterceptor
)
.map { $0.toDomain() }
.do { _ in self.saveSearchKeyword(keyword: query) }
}
}

private extension SearchAPIRepositoryImpl {
func saveSearchKeyword(keyword: String) {
let existingList = userDefaultService.fetchArray(keyType: .searchKeyword) ?? []
let updatedList = [keyword] + existingList.filter { $0 != keyword }
userDefaultService.save(keyType: .searchKeyword, value: updatedList)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public final class SignUpRepositoryImpl: SignUpRepository {
age: Int32,
socialEmail: String,
socialType: String,
interests: [Int64],
interests: [Int],
appleAuthorizationCode: String?
) -> Completable {
let endPoint = SignUpAPIEndpoint.signUp_trySignUp(with: .init(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@ public final class UserAPIRepositoryImpl: UserAPIRepository {
}

public func putUserCategory(
interestCategoriesToAdd: [Int64],
interestCategoriesToDelete: [Int64],
interestCategoriesToKeep: [Int64]
interestCategoriesToAdd: [Int],
interestCategoriesToDelete: [Int],
interestCategoriesToKeep: [Int]
) -> Completable {
let request = PutUserCategoryRequestDTO(
interestCategoriesToAdd: interestCategoriesToAdd,
interestCategoriesToDelete: interestCategoriesToDelete,
interestCategoriesToKeep: interestCategoriesToKeep
interestCategoriesToAdd: interestCategoriesToAdd.map { Int64($0 ) },
interestCategoriesToDelete: interestCategoriesToDelete.map { Int64($0 ) },
interestCategoriesToKeep: interestCategoriesToKeep.map { Int64($0 ) }
)
let endPoint = UserAPIEndPoint.putUserCategory(request: request)
return provider.request(with: endPoint, interceptor: tokenInterceptor)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import Foundation

import DomainInterface

import RxSwift

public final class FetchCategoryListUseCaseImpl: FetchCategoryListUseCase {

private let repository: CategoryRepository

public init(repository: CategoryRepository) {
self.repository = repository
}

public func execute() -> Observable<[CategoryResponse]> {
return repository.fetchCategoryList()
}
}
Loading