Waste/Waste.Web.Entry/Pages/Result/Index.cshtml.cs

65 lines
1.7 KiB
C#
Raw Permalink Normal View History

2021-05-27 16:58:40 +08:00
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Furion;
using Furion.DatabaseAccessor;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
2021-05-27 16:58:40 +08:00
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Waste.Application;
using Waste.Domain;
2021-05-27 16:58:40 +08:00
namespace Waste.Web.Entry.Pages.Result
{
/// <summary>
/// ͳ<>Ʊ<EFBFBD><C6B1><EFBFBD>
/// </summary>
public class IndexModel : BaseModel
{
public string defaulttime = "";
private readonly ResultColumnConfigService columnConfigService;
public IndexModel(ResultColumnConfigService columnConfigService)
{
this.columnConfigService = columnConfigService;
}
public async Task OnGetAsync()
2021-05-27 16:58:40 +08:00
{
defaulttime = $"{DateTime.Now.Date} ~ {DateTime.Now.Date.AddDays(1).AddSeconds(-1)}";
//var value = await service.GetAccountConfig(Baseuser.UserId);
Column = await columnConfigService.GetAccountColumn();
DefaultColumn = await columnConfigService.GetAccountDefaultColumn();
2021-05-27 16:58:40 +08:00
}
public async Task<IActionResult> OnPostUpdateAccountConfigAsync([FromBody] List<ColumnConfig> input)
{
await columnConfigService.WriteAccountConfig(input);
//await service.UpdateAccountConfig(Baseuser.UserId, config);
return Content("ok");
}
public Dictionary<string, string> Column { get; set; }
//private static Dictionary<string, string> EmptyColumn = new Dictionary<string, string>();
public Dictionary<string, string> DefaultColumn = new Dictionary<string, string>();
2021-05-27 16:58:40 +08:00
}
2021-05-27 16:58:40 +08:00
}