Platform upgrade: login auth fix, OCR/OSS upload, system menus and dicts, weather dashboard, weighing and invoice modules
This commit is contained in:
@@ -4,17 +4,17 @@ namespace AgriculturalPlatform.Api.Dtos;
|
||||
|
||||
public record UserDto(
|
||||
int Id, string Username, string RealName, string Phone, string Role,
|
||||
int? OrgId, string? OrgName, bool IsActive, DateTime? LastLoginAt, DateTime CreatedAt);
|
||||
int? RoleId, string? RoleName, int? OrgId, string? OrgName, bool IsActive, DateTime? LastLoginAt, DateTime CreatedAt);
|
||||
|
||||
public record UserSaveRequest(
|
||||
string Username, string RealName, string Phone, string Role,
|
||||
int? OrgId, bool IsActive = true, string? Password = null);
|
||||
int? OrgId, int? RoleId = null, bool IsActive = true, string? Password = null);
|
||||
|
||||
public static class UserMappers
|
||||
{
|
||||
public static UserDto ToDto(this User u) => new(
|
||||
u.Id, u.Username, u.RealName, u.Phone, u.Role.ToString(),
|
||||
u.OrgId, u.Org?.Name, u.IsActive, u.LastLoginAt, u.CreatedAt);
|
||||
u.RoleId, u.SysRole?.Name, u.OrgId, u.Org?.Name, u.IsActive, u.LastLoginAt, u.CreatedAt);
|
||||
|
||||
public static UserDto[] ToDtos(this IEnumerable<User> items) => items.Select(ToDto).ToArray();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user