feat: 사용자 관리 API 연동 구현
- UserRemoteDataSource: 사용자 CRUD, 상태 변경, 비밀번호 변경, 중복 확인 API 구현 - UserService: DTO-Model 변환 로직 및 역할/전화번호 매핑 처리 - UserListController: ChangeNotifier 패턴 적용, 페이지네이션, 검색, 필터링 기능 추가 - UserFormController: API 연동, username 중복 확인 기능 추가 - user_form.dart: username/password 필드 추가 및 실시간 검증 - user_list_redesign.dart: Provider 패턴 적용, 무한 스크롤 구현 - equipment_out_form_controller.dart: 구문 오류 수정 - API 통합 진행률: 85% (사용자 관리 100% 완료)
This commit is contained in:
@@ -7,6 +7,10 @@ class User {
|
||||
final String? position; // 직급
|
||||
final String? email; // 이메일
|
||||
final List<Map<String, String>> phoneNumbers; // 전화번호 목록 (유형과 번호)
|
||||
final String? username; // 사용자명 (API 연동용)
|
||||
final bool isActive; // 활성화 상태
|
||||
final DateTime? createdAt; // 생성일
|
||||
final DateTime? updatedAt; // 수정일
|
||||
|
||||
User({
|
||||
this.id,
|
||||
@@ -17,6 +21,10 @@ class User {
|
||||
this.position,
|
||||
this.email,
|
||||
this.phoneNumbers = const [],
|
||||
this.username,
|
||||
this.isActive = true,
|
||||
this.createdAt,
|
||||
this.updatedAt,
|
||||
});
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
@@ -29,6 +37,10 @@ class User {
|
||||
'position': position,
|
||||
'email': email,
|
||||
'phoneNumbers': phoneNumbers,
|
||||
'username': username,
|
||||
'isActive': isActive,
|
||||
'createdAt': createdAt?.toIso8601String(),
|
||||
'updatedAt': updatedAt?.toIso8601String(),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -45,6 +57,14 @@ class User {
|
||||
json['phoneNumbers'] != null
|
||||
? List<Map<String, String>>.from(json['phoneNumbers'])
|
||||
: [],
|
||||
username: json['username'],
|
||||
isActive: json['isActive'] ?? true,
|
||||
createdAt: json['createdAt'] != null
|
||||
? DateTime.parse(json['createdAt'])
|
||||
: null,
|
||||
updatedAt: json['updatedAt'] != null
|
||||
? DateTime.parse(json['updatedAt'])
|
||||
: null,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user