using System;
using System.Threading.Tasks;
using YBDevice.Application;
using YBDevice.Entity;

namespace YBDevice.NWeb.Pages
{
    public class HomeModel : BaseModel
    {
        private readonly IReportService _reportService;
        public string maxtime = DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd");
        public string mintime = DateTime.Now.AddDays(-1).AddMonths(-1).ToString("yyyyy-MM-dd");
        public string time = $"{DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd")} ~ {DateTime.Now.AddDays(-1).ToString("yyyy-MM-dd")}";
        public HomeModel(IReportService reportService)
        {
            _reportService = reportService;
        }
        public YB_Combined TotalData=null;
        public async Task OnGetAsync()
        {
            TotalData = await _reportService.GetCombinedInfoAsync();
        }
    }
}
