重构项目结构,引入 Avalonia-Common、Avalonia-EFCore、Avalonia-Services,实现 API 与桌面端统一端点注册、过滤器、鉴权和标准响应格式。支持多数据库自动迁移与配置,集成 Serilog 日志系统。移除旧路由与控制器,提升接口一致性与可维护性。
28 lines
753 B
C#
28 lines
753 B
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace Avalonia_Services.Models
|
|
{
|
|
/// <summary>
|
|
/// 天气预报数据实体 —— 对应数据库中的 WeatherForecasts 表。
|
|
/// </summary>
|
|
[Table("WeatherForecasts")]
|
|
public class WeatherForecastEntity
|
|
{
|
|
[Key]
|
|
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
|
public int Id { get; set; }
|
|
|
|
public DateOnly Date { get; set; }
|
|
|
|
public int TemperatureC { get; set; }
|
|
|
|
[MaxLength(200)]
|
|
public string? Summary { get; set; }
|
|
|
|
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
|
|
|
public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
|
|
}
|
|
}
|