forked from baron/baron-sso
테넌트 등록 방식을 결정
This commit is contained in:
@@ -1,3 +1,35 @@
|
||||
class Tenant {
|
||||
final String id;
|
||||
final String name;
|
||||
final String slug;
|
||||
final String description;
|
||||
|
||||
Tenant({
|
||||
required this.id,
|
||||
required this.name,
|
||||
required this.slug,
|
||||
required this.description,
|
||||
});
|
||||
|
||||
factory Tenant.fromJson(Map<String, dynamic> json) {
|
||||
return Tenant(
|
||||
id: json['id'] ?? '',
|
||||
name: json['name'] ?? '',
|
||||
slug: json['slug'] ?? '',
|
||||
description: json['description'] ?? '',
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
'id': id,
|
||||
'name': name,
|
||||
'slug': slug,
|
||||
'description': description,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
class UserProfile {
|
||||
final String id;
|
||||
final String email;
|
||||
@@ -6,6 +38,7 @@ class UserProfile {
|
||||
final String department;
|
||||
final String affiliationType;
|
||||
final String companyCode;
|
||||
final Tenant? tenant;
|
||||
|
||||
UserProfile({
|
||||
required this.id,
|
||||
@@ -15,6 +48,7 @@ class UserProfile {
|
||||
required this.department,
|
||||
required this.affiliationType,
|
||||
required this.companyCode,
|
||||
this.tenant,
|
||||
});
|
||||
|
||||
factory UserProfile.fromJson(Map<String, dynamic> json) {
|
||||
@@ -26,6 +60,7 @@ class UserProfile {
|
||||
department: json['department'] ?? '',
|
||||
affiliationType: json['affiliationType'] ?? '',
|
||||
companyCode: json['companyCode'] ?? '',
|
||||
tenant: json['tenant'] != null ? Tenant.fromJson(json['tenant']) : null,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -38,6 +73,7 @@ class UserProfile {
|
||||
'department': department,
|
||||
'affiliationType': affiliationType,
|
||||
'companyCode': companyCode,
|
||||
'tenant': tenant?.toJson(),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -54,6 +90,7 @@ class UserProfile {
|
||||
department: department ?? this.department,
|
||||
affiliationType: affiliationType,
|
||||
companyCode: companyCode,
|
||||
tenant: tenant,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -503,7 +503,7 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
||||
runSpacing: 8,
|
||||
children: [
|
||||
_buildInfoChip(Icons.badge_outlined, '프로필 관리'),
|
||||
_buildInfoChip(Icons.apartment, department),
|
||||
_buildInfoChip(Icons.apartment, profile.tenant?.name ?? department),
|
||||
],
|
||||
),
|
||||
],
|
||||
@@ -743,6 +743,10 @@ class _ProfilePageState extends ConsumerState<ProfilePage> {
|
||||
),
|
||||
const Divider(height: 24),
|
||||
_buildReadOnlyTile('구분', profile.affiliationType),
|
||||
if (profile.tenant != null) ...[
|
||||
const Divider(height: 24),
|
||||
_buildReadOnlyTile('소속 테넌트', profile.tenant!.name),
|
||||
],
|
||||
if (profile.companyCode.isNotEmpty) ...[
|
||||
const Divider(height: 24),
|
||||
_buildReadOnlyTile('회사코드', profile.companyCode),
|
||||
|
||||
Reference in New Issue
Block a user