Platform upgrade: login auth fix, OCR/OSS upload, system menus and dicts, weather dashboard, weighing and invoice modules

This commit is contained in:
2026-08-14 01:12:33 +08:00
parent c377421a3e
commit 8099ebae0a
75 changed files with 5611 additions and 473 deletions
@@ -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();
}