1
0
forked from baron/baron-sso

테넌트 등록 방식을 결정

This commit is contained in:
2026-02-02 14:05:50 +09:00
parent 9e9c622600
commit 5dd425050c
21 changed files with 613 additions and 84 deletions

View File

@@ -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,
);
}
}