refactor: Equipment 리스트 화면 API 호환성 개선
Some checks failed
Flutter Test & Quality Check / Test on macos-latest (push) Has been cancelled
Flutter Test & Quality Check / Test on ubuntu-latest (push) Has been cancelled
Flutter Test & Quality Check / Build APK (push) Has been cancelled

- 리스트 API가 제공하지 않는 9개 컬럼 제거 (카테고리, 바코드, 입고지, 구매처, 구매일, 구매가격, 현재위치, 창고위치, 점검일)
- 실제 제공되는 데이터만 표시하도록 최적화 (제조사, 장비번호, 모델명, 시리얼번호, 수량, 상태, 입출고일)
- Equipment 필드명 변경 대응 (name → equipmentNumber, category 하드코딩 개선)
- 불필요한 헬퍼 함수 제거 및 테이블 너비 계산 최적화
- 헬스체크 주기 조정 (30초 → 300초)
This commit is contained in:
JiWoong Sul
2025-08-21 20:07:30 +09:00
parent 49089b7814
commit a740ff10c8
3 changed files with 66 additions and 278 deletions

View File

@@ -4,52 +4,52 @@ class AppConstants {
static const int defaultPageSize = 20;
static const int maxPageSize = 100;
static const Duration cacheTimeout = Duration(minutes: 5);
// API 타임아웃
static const Duration apiConnectTimeout = Duration(seconds: 60);
static const Duration apiReceiveTimeout = Duration(seconds: 60);
static const Duration healthCheckTimeout = Duration(seconds: 10);
static const Duration loginTimeout = Duration(seconds: 10);
// 디바운스 시간
static const Duration searchDebounce = Duration(milliseconds: 500);
static const Duration licenseSearchDebounce = Duration(milliseconds: 300);
// 애니메이션 시간
static const Duration autocompleteAnimation = Duration(milliseconds: 200);
static const Duration formAnimation = Duration(milliseconds: 300);
static const Duration loginAnimation = Duration(milliseconds: 1000);
static const Duration loginSubAnimation = Duration(milliseconds: 800);
// 라이선스 만료 기간
static const int licenseExpiryWarningDays = 30;
static const int licenseExpiryCautionDays = 60;
static const int licenseExpiryInfoDays = 90;
// 헬스체크 주기
static const Duration healthCheckInterval = Duration(seconds: 30);
static const Duration healthCheckInterval = Duration(seconds: 300);
// 토큰 키
static const String accessTokenKey = 'access_token';
static const String refreshTokenKey = 'refresh_token';
static const String tokenTypeKey = 'token_type';
static const String expiresInKey = 'expires_in';
// 사용자 권한 매핑
static const Map<String, String> flutterToBackendRole = {
'S': 'admin', // Super user
'M': 'manager', // Manager
'U': 'staff', // User
'V': 'viewer', // Viewer
'S': 'admin', // Super user
'M': 'manager', // Manager
'U': 'staff', // User
'V': 'viewer', // Viewer
};
static const Map<String, String> backendToFlutterRole = {
'admin': 'S',
'manager': 'M',
'staff': 'U',
'viewer': 'V',
};
// 장비 상태
static const Map<String, String> equipmentStatus = {
'available': '사용가능',
@@ -58,7 +58,7 @@ class AppConstants {
'disposed': '폐기',
'rented': '대여중',
};
// 정렬 옵션
static const Map<String, String> sortOptions = {
'created_at': '생성일',
@@ -66,34 +66,39 @@ class AppConstants {
'name': '이름',
'status': '상태',
};
// 날짜 형식
static const String dateFormat = 'yyyy-MM-dd';
static const String dateTimeFormat = 'yyyy-MM-dd HH:mm:ss';
// 파일 업로드
static const int maxFileSize = 10 * 1024 * 1024; // 10MB
static const List<String> allowedFileExtensions = [
'jpg', 'jpeg', 'png', 'pdf', 'doc', 'docx', 'xls', 'xlsx'
'jpg',
'jpeg',
'png',
'pdf',
'doc',
'docx',
'xls',
'xlsx',
];
// 에러 메시지
static const String networkError = '네트워크 연결을 확인해주세요.';
static const String timeoutError = '요청 시간이 초과되었습니다.';
static const String unauthorizedError = '인증이 필요합니다.';
static const String serverError = '서버 오류가 발생했습니다.';
static const String unknownError = '알 수 없는 오류가 발생했습니다.';
// 정규식 패턴
static final RegExp emailRegex = RegExp(
r'^[a-zA-Z0-9.]+@[a-zA-Z0-9]+\.[a-zA-Z]+',
);
static final RegExp phoneRegex = RegExp(
r'^01[0-9]{1}-?[0-9]{4}-?[0-9]{4}$',
);
static final RegExp phoneRegex = RegExp(r'^01[0-9]{1}-?[0-9]{4}-?[0-9]{4}$');
static final RegExp businessNumberRegex = RegExp(
r'^[0-9]{3}-?[0-9]{2}-?[0-9]{5}$',
);
}
}