refactor: UI 화면 통합 및 불필요한 파일 정리
- 모든 *_redesign.dart 파일을 기본 화면 파일로 통합 - 백업용 컨트롤러 파일들 제거 (*_controller.backup.dart) - 사용하지 않는 예제 및 테스트 파일 제거 - Clean Architecture 적용 후 남은 정리 작업 완료 - 테스트 코드 정리 및 구조 개선 준비 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -12,7 +12,7 @@ import 'package:superport/data/models/equipment/equipment_request.dart';
|
||||
import 'package:superport/data/models/equipment/equipment_response.dart';
|
||||
|
||||
abstract class EquipmentRemoteDataSource {
|
||||
Future<List<EquipmentListDto>> getEquipments({
|
||||
Future<EquipmentListResponseDto> getEquipments({
|
||||
int page = 1,
|
||||
int perPage = 20,
|
||||
String? status,
|
||||
@@ -44,7 +44,7 @@ class EquipmentRemoteDataSourceImpl implements EquipmentRemoteDataSource {
|
||||
final ApiClient _apiClient = GetIt.instance<ApiClient>();
|
||||
|
||||
@override
|
||||
Future<List<EquipmentListDto>> getEquipments({
|
||||
Future<EquipmentListResponseDto> getEquipments({
|
||||
int page = 1,
|
||||
int perPage = 20,
|
||||
String? status,
|
||||
@@ -68,8 +68,19 @@ class EquipmentRemoteDataSourceImpl implements EquipmentRemoteDataSource {
|
||||
);
|
||||
|
||||
if (response.data['success'] == true && response.data['data'] != null) {
|
||||
final List<dynamic> data = response.data['data'];
|
||||
return data.map((json) => EquipmentListDto.fromJson(json)).toList();
|
||||
// API 응답 구조를 DTO에 맞게 변환 (warehouse_remote_datasource 패턴 참조)
|
||||
final List<dynamic> dataList = response.data['data'];
|
||||
final pagination = response.data['pagination'] ?? {};
|
||||
|
||||
final listData = {
|
||||
'items': dataList,
|
||||
'total': pagination['total'] ?? 0,
|
||||
'page': pagination['page'] ?? 1,
|
||||
'per_page': pagination['per_page'] ?? 20,
|
||||
'total_pages': pagination['total_pages'] ?? 1,
|
||||
};
|
||||
|
||||
return EquipmentListResponseDto.fromJson(listData);
|
||||
} else {
|
||||
throw ServerException(
|
||||
message: response.data['message'] ?? 'Failed to fetch equipment list',
|
||||
|
||||
Reference in New Issue
Block a user