| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- using System;
- using System.Security.Principal;
- using System.Threading.Tasks;
- using BO.AppServer.Data.Entity;
- using BO.AppServer.Data.Repository;
- using BO.AppServer.Metadata.Dto;
- using BO.AppServer.Business.Mapper;
- using Microsoft.Extensions.Logging;
- using Quadarax.Foundation.Core.Business;
- using Quadarax.Foundation.Core.Data.Interface.Entity.Dto;
- namespace BO.AppServer.Business.Services
- {
- public class StatisticsService : AbstractService
- {
- #region *** Private fields ***
- protected StatisticRepo _repoStatistic;
- protected UserRepo _repoUser;
- #endregion
- #region *** Constructor & DI ***
- public StatisticsService(
- StatisticRepo repoStatistic,
- UserRepo repoUser,
- IPrincipal currentPrincipal,
- ILoggerFactory logger) : base(currentPrincipal, logger)
- {
- _repoStatistic = repoStatistic ?? throw new ArgumentNullException(nameof(repoStatistic));
- _repoUser = repoUser ?? throw new ArgumentNullException(nameof(repoUser));
- }
- #endregion
- #region *** Public Operations ***
- public async Task<ResultValueDto<StatisticsDto>> GetCurrent()
- {
- var current = _repoStatistic.GetCurrent();
- return new ResultValueDto<StatisticsDto>(current.Map<Statistic, StatisticsDto>());
- }
- #endregion
- }
- }
|