using Fake.Rbac.Application.Dtos.User; using Oms.Application.Dtos.Rbac; namespace Oms.Application.Rbac; internal static class OmsUserProfileMapper { public static OmsUserDetailDto ToDetailDto(UserDto user, UserProfileData? profile) { var detail = new OmsUserDetailDto { Id = user.Id, CreatedAt = user.CreatedAt, CreatedBy = user.CreatedBy, UpdatedAt = user.UpdatedAt, UpdatedBy = user.UpdatedBy, Name = user.Name, Account = user.Account, Email = user.Email, Avatar = user.Avatar, OrganizationId = user.OrganizationId, OrganizationName = user.OrganizationName, Roles = user.Roles, }; if (profile == null) { return detail; } detail.Phone = profile.Phone; detail.EmployeeNo = profile.EmployeeNo; detail.WechatId = profile.WechatId; detail.WechatQrCode = profile.WechatQrCode; detail.WecomKfUrl = profile.WecomKfUrl; detail.IsEnabled = profile.IsEnabled; return detail; } }