123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- import 'package:domain/generated/json/base/json_convert_content.dart';
- import 'package:domain/entity/response/switch_project_entity.dart';
- import 'package:domain/entity/response/index_option_entity.dart';
- SwitchProjectEntity $SwitchProjectEntityFromJson(Map<String, dynamic> json) {
- final SwitchProjectEntity switchProjectEntity = SwitchProjectEntity();
- final List<IndexOptionEntity>? cutUser = (json['cut_user'] as List<dynamic>?)?.map(
- (e) => jsonConvert.convert<IndexOptionEntity>(e) as IndexOptionEntity).toList();
- if (cutUser != null) {
- switchProjectEntity.cutUser = cutUser;
- }
- final List<SwitchProjectUserList>? userList = (json['user_list'] as List<dynamic>?)?.map(
- (e) => jsonConvert.convert<SwitchProjectUserList>(e) as SwitchProjectUserList).toList();
- if (userList != null) {
- switchProjectEntity.userList = userList;
- }
- return switchProjectEntity;
- }
- Map<String, dynamic> $SwitchProjectEntityToJson(SwitchProjectEntity entity) {
- final Map<String, dynamic> data = <String, dynamic>{};
- data['cut_user'] = entity.cutUser?.map((v) => v.toJson()).toList();
- data['user_list'] = entity.userList?.map((v) => v.toJson()).toList();
- return data;
- }
- extension SwitchProjectEntityExtension on SwitchProjectEntity {
- SwitchProjectEntity copyWith({
- List<IndexOptionEntity>? cutUser,
- List<SwitchProjectUserList>? userList,
- }) {
- return SwitchProjectEntity()
- ..cutUser = cutUser ?? this.cutUser
- ..userList = userList ?? this.userList;
- }
- }
- SwitchProjectUserList $SwitchProjectUserListFromJson(Map<String, dynamic> json) {
- final SwitchProjectUserList switchProjectUserList = SwitchProjectUserList();
- final String? adminId = jsonConvert.convert<String>(json['admin_id']);
- if (adminId != null) {
- switchProjectUserList.adminId = adminId;
- }
- final String? adminName = jsonConvert.convert<String>(json['admin_name']);
- if (adminName != null) {
- switchProjectUserList.adminName = adminName;
- }
- final String? employerName = jsonConvert.convert<String>(json['employer_name']);
- if (employerName != null) {
- switchProjectUserList.employerName = employerName;
- }
- return switchProjectUserList;
- }
- Map<String, dynamic> $SwitchProjectUserListToJson(SwitchProjectUserList entity) {
- final Map<String, dynamic> data = <String, dynamic>{};
- data['admin_id'] = entity.adminId;
- data['admin_name'] = entity.adminName;
- data['employer_name'] = entity.employerName;
- return data;
- }
- extension SwitchProjectUserListExtension on SwitchProjectUserList {
- SwitchProjectUserList copyWith({
- String? adminId,
- String? adminName,
- String? employerName,
- }) {
- return SwitchProjectUserList()
- ..adminId = adminId ?? this.adminId
- ..adminName = adminName ?? this.adminName
- ..employerName = employerName ?? this.employerName;
- }
- }
|