refactor: Repository 패턴 적용 및 Clean Architecture 완성
## 주요 변경사항 ### 🏗️ Architecture - Repository 패턴 전면 도입 (인터페이스/구현체 분리) - Domain Layer에 Repository 인터페이스 정의 - Data Layer에 Repository 구현체 배치 - UseCase 의존성을 Service에서 Repository로 전환 ### 📦 Dependency Injection - GetIt 기반 DI Container 재구성 (lib/injection_container.dart) - Repository 인터페이스와 구현체 등록 - Service와 Repository 공존 (마이그레이션 기간) ### 🔄 Migration Status 완료: - License 모듈 (6개 UseCase) - Warehouse Location 모듈 (5개 UseCase) 진행중: - Auth 모듈 (2/5 UseCase) - Company 모듈 (1/6 UseCase) 대기: - User 모듈 (7개 UseCase) - Equipment 모듈 (4개 UseCase) ### 🎯 Controller 통합 - 중복 Controller 제거 (with_usecase 버전) - 단일 Controller로 통합 - UseCase 패턴 직접 적용 ### 🧹 코드 정리 - 임시 파일 제거 (test_*.md, task.md) - Node.js 아티팩트 제거 (package.json) - 불필요한 테스트 파일 정리 ### ✅ 테스트 개선 - Real API 중심 테스트 구조 - Mock 제거, 실제 API 엔드포인트 사용 - 통합 테스트 프레임워크 강화 ## 기술적 영향 - 의존성 역전 원칙 적용 - 레이어 간 결합도 감소 - 테스트 용이성 향상 - 확장성 및 유지보수성 개선 ## 다음 단계 1. User/Equipment 모듈 Repository 마이그레이션 2. Service Layer 점진적 제거 3. 캐싱 전략 구현 4. 성능 최적화
This commit is contained in:
@@ -126,9 +126,9 @@ class InteractiveSearchTest {
|
||||
print(' 결과: ${companies?.items.length ?? 0}개 회사 조회됨');
|
||||
|
||||
// 2. 특정 검색어 테스트
|
||||
if (companies != null && companies.isNotEmpty) {
|
||||
final testCompany = companies.first;
|
||||
final searchKeyword = testCompany.name.substring(0, testCompany.name.items.length > 3 ? 3 : testCompany.name.items.length);
|
||||
if (companies != null && companies.items.isNotEmpty) {
|
||||
final testCompany = companies.items.first;
|
||||
final searchKeyword = testCompany.name.substring(0, testCompany.name.length > 3 ? 3 : testCompany.name.length);
|
||||
|
||||
print('테스트 2: "$searchKeyword" 검색어로 조회');
|
||||
companies = await companyService.getCompanies(
|
||||
@@ -185,7 +185,7 @@ class InteractiveSearchTest {
|
||||
result['tests'].add({
|
||||
'name': '긴 검색어',
|
||||
'status': 'PASS',
|
||||
'keywordLength': longKeyword.items.length,
|
||||
'keywordLength': longKeyword.length,
|
||||
});
|
||||
print(' 결과: 에러 없이 처리됨');
|
||||
} catch (e) {
|
||||
@@ -255,7 +255,7 @@ class InteractiveSearchTest {
|
||||
// 2. 이름으로 검색
|
||||
if (users != null && users.items.isNotEmpty) {
|
||||
final testUser = users.items.first;
|
||||
final searchKeyword = testUser.name.substring(0, testUser.name.items.length > 2 ? 2 : testUser.name.items.length);
|
||||
final searchKeyword = testUser.name.substring(0, testUser.name.length > 2 ? 2 : testUser.name.length);
|
||||
|
||||
print('테스트 2: "$searchKeyword" 검색어로 조회');
|
||||
// UserService에 search 파라미터 지원 확인 필요
|
||||
@@ -368,7 +368,7 @@ class InteractiveSearchTest {
|
||||
if (equipments != null && equipments.items.isNotEmpty) {
|
||||
final testEquipment = equipments.items.first;
|
||||
final searchKeyword = testEquipment.manufacturer?.substring(0,
|
||||
testEquipment.manufacturer!.items.length > 3 ? 3 : testEquipment.manufacturer!.items.length) ?? 'test';
|
||||
testEquipment.manufacturer!.length > 3 ? 3 : testEquipment.manufacturer!.length) ?? 'test';
|
||||
|
||||
print('테스트 2: "$searchKeyword" 검색어로 조회');
|
||||
equipments = await equipmentService.getEquipmentsWithStatus(
|
||||
|
||||
Reference in New Issue
Block a user