server/aspnetapp/Controllers/WebApi/AnalyseController.cs
(开头部分) 6KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using aspnetapp.Models;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
namespace aspnetapp.Controllers.WebApi
{
[Route("api/[controller]")]
[ApiController]
public class AnalyseController : ControllerBase
{
private readonly CounterContext _context;
public AnalyseController(CounterContext context)
{
_context = context;
}
public class AnalyseResponse
{
/// <summary>
/// 总量 晚 午 早 ['晚餐 90 份', '午餐 60 份', '早餐 30 份']
/// </summary>
public List<string>? analysefoods { get; set; }
/// <summary>
/// 米饭 晚 午 早 [400, 200, 0]
/// </summary>
public List<int>? analyserices { get; set; }
/// <summary>
/// 馒头 晚 午 早 [400, 200, 0]
/// </summary>
public List<int>? analysemt { get; set; }
/// <summary>
/// 普通汉餐 晚 午 早 [400, 200, 0]
/// </summary>
public List<int>? analysenomalc { get; set; }
/// <summary>
/// 回餐 晚 午 早 [400, 200, 0]
/// </summary>
public List<int>? analysehc { get; set; }
/// <summary>
/// 全素 晚 午 早 [400, 200, 0]
/// </summary>
public List<int>? analyseqs { get; set; }
/// <summary>
/// 特色餐 晚 午 早 [400, 200, 0]
/// </summary>
public List<int>? analysespecial { get; set; }
}
private async Task<AnalyseResponse> getAnalyse(int? dir)
{
DateTime now = DateTime.Now;
DateTime today = new DateTime(now.Year, now.Month, now.Day);
if (dir.HasValue)
{
today = today.AddDays(dir.Value);
}
List<OrderEntity> allorders = await _context.Orders.AsNoTracking().Where(s => s.OrderStatus != (int)EnumCode.OrderStatus.已取消 && s.OrderForDate == today).ToListAsync();
后面还有 43 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。