fix: API 응답 파싱 오류 수정 및 에러 처리 개선
주요 변경사항: - 창고 관리 API 응답 구조와 DTO 불일치 수정 - WarehouseLocationDto에 code, manager_phone 필드 추가 - RemoteDataSource에서 API 응답을 DTO 구조에 맞게 변환 - 회사 관리 API 응답 파싱 오류 수정 - CompanyResponse의 필수 필드를 nullable로 변경 - PaginatedResponse 구조 매핑 로직 개선 - 에러 처리 및 로깅 개선 - Service Layer에 상세 에러 로깅 추가 - Controller에서 에러 타입별 처리 - 새로운 유틸리티 추가 - ResponseInterceptor: API 응답 정규화 - DebugLogger: 디버깅 도구 - HealthCheckService: 서버 상태 확인 - 문서화 - API 통합 테스트 가이드 - 에러 분석 보고서 - 리팩토링 계획서
This commit is contained in:
@@ -10,6 +10,7 @@ import 'package:superport/screens/license/license_list_redesign.dart';
|
||||
import 'package:superport/screens/warehouse_location/warehouse_location_list_redesign.dart';
|
||||
import 'package:superport/services/auth_service.dart';
|
||||
import 'package:superport/utils/constants.dart';
|
||||
import 'package:superport/data/models/auth/auth_user.dart';
|
||||
|
||||
/// Microsoft Dynamics 365 스타일의 메인 레이아웃
|
||||
/// 상단 헤더 + 좌측 사이드바 + 메인 콘텐츠 구조
|
||||
@@ -28,6 +29,8 @@ class _AppLayoutRedesignState extends State<AppLayoutRedesign>
|
||||
late String _currentRoute;
|
||||
bool _sidebarCollapsed = false;
|
||||
late AnimationController _sidebarAnimationController;
|
||||
AuthUser? _currentUser;
|
||||
late final AuthService _authService;
|
||||
late Animation<double> _sidebarAnimation;
|
||||
|
||||
@override
|
||||
@@ -35,6 +38,17 @@ class _AppLayoutRedesignState extends State<AppLayoutRedesign>
|
||||
super.initState();
|
||||
_currentRoute = widget.initialRoute;
|
||||
_setupAnimations();
|
||||
_authService = GetIt.instance<AuthService>();
|
||||
_loadCurrentUser();
|
||||
}
|
||||
|
||||
Future<void> _loadCurrentUser() async {
|
||||
final user = await _authService.getCurrentUser();
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_currentUser = user;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void _setupAnimations() {
|
||||
@@ -74,6 +88,12 @@ class _AppLayoutRedesignState extends State<AppLayoutRedesign>
|
||||
return const LicenseListRedesign();
|
||||
case Routes.warehouseLocation:
|
||||
return const WarehouseLocationListRedesign();
|
||||
case '/test/api':
|
||||
// Navigator를 사용하여 별도 화면으로 이동
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
Navigator.pushNamed(context, '/test/api');
|
||||
});
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
default:
|
||||
return const OverviewScreenRedesign();
|
||||
}
|
||||
@@ -115,6 +135,8 @@ class _AppLayoutRedesignState extends State<AppLayoutRedesign>
|
||||
return '유지보수 관리';
|
||||
case Routes.warehouseLocation:
|
||||
return '입고지 관리';
|
||||
case '/test/api':
|
||||
return 'API 테스트';
|
||||
default:
|
||||
return '대시보드';
|
||||
}
|
||||
@@ -139,6 +161,8 @@ class _AppLayoutRedesignState extends State<AppLayoutRedesign>
|
||||
return ['홈', '유지보수 관리'];
|
||||
case Routes.warehouseLocation:
|
||||
return ['홈', '입고지 관리'];
|
||||
case '/test/api':
|
||||
return ['홈', '개발자 도구', 'API 테스트'];
|
||||
default:
|
||||
return ['홈', '대시보드'];
|
||||
}
|
||||
@@ -330,7 +354,10 @@ class _AppLayoutRedesignState extends State<AppLayoutRedesign>
|
||||
onTap: () {
|
||||
_showProfileMenu(context);
|
||||
},
|
||||
child: ShadcnAvatar(initials: 'A', size: 36),
|
||||
child: ShadcnAvatar(
|
||||
initials: _currentUser != null ? _currentUser!.name.substring(0, 1).toUpperCase() : 'U',
|
||||
size: 36,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
@@ -410,14 +437,20 @@ class _AppLayoutRedesignState extends State<AppLayoutRedesign>
|
||||
// 프로필 정보
|
||||
Row(
|
||||
children: [
|
||||
ShadcnAvatar(initials: 'A', size: 48),
|
||||
ShadcnAvatar(
|
||||
initials: _currentUser != null ? _currentUser!.name.substring(0, 1).toUpperCase() : 'U',
|
||||
size: 48,
|
||||
),
|
||||
const SizedBox(width: ShadcnTheme.spacing4),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('관리자', style: ShadcnTheme.headingH4),
|
||||
Text(
|
||||
'admin@superport.com',
|
||||
_currentUser?.name ?? '사용자',
|
||||
style: ShadcnTheme.headingH4,
|
||||
),
|
||||
Text(
|
||||
_currentUser?.email ?? '',
|
||||
style: ShadcnTheme.bodyMuted,
|
||||
),
|
||||
],
|
||||
@@ -551,6 +584,17 @@ class SidebarMenuRedesign extends StatelessWidget {
|
||||
isActive: currentRoute == Routes.license,
|
||||
),
|
||||
|
||||
const SizedBox(height: ShadcnTheme.spacing4),
|
||||
const Divider(),
|
||||
const SizedBox(height: ShadcnTheme.spacing4),
|
||||
|
||||
_buildMenuItem(
|
||||
icon: Icons.bug_report,
|
||||
title: 'API 테스트',
|
||||
route: '/test/api',
|
||||
isActive: currentRoute == '/test/api',
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user