You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.3 KiB

using System.ComponentModel.DataAnnotations;
using Entity.DbModel.Station;
using Entity.Dto.Req;
using Entity.Dto.Resp;
using HybirdFrameworkCore.Entity;
using Microsoft.AspNetCore.Mvc;
using Service.Init;
using Service.Station;
namespace WebStarter.Controllers;
/// <summary>
/// 统计
/// </summary>
[ApiController]
[Route("api/[controller]")]
public class StatisticsController
{
private readonly ExStationDayRunResultService _exStationDayRunResultService;
public StatisticsController(ExStationDayRunResultService exStationDayRunResultService)
{
_exStationDayRunResultService = exStationDayRunResultService;
}
/// <summary>
/// 获取上个月的每日数据
/// </summary>
/// <returns></returns>
[HttpPost("GetMonthResult")]
public async Task<Result<List<ExchangeStationDayRunResult>>> GetMonthResult()
{
return Result<List<ExchangeStationDayRunResult>>.Success(await _exStationDayRunResultService.GetMonthRunResult());
}
/// <summary>
/// 获取今年到上月的每月的数据和
/// </summary>
/// <returns></returns>
[HttpPost("GetYearResult")]
public async Task<Result<List<ExchangeStationDayRunResultResp>>> GetYearResult()
{
return Result<List<ExchangeStationDayRunResultResp>>.Success(await _exStationDayRunResultService.GetYearRunResult());
}
}