using System.Collections.Generic;
using System.Threading.Tasks;
using GxPress.Result.DataCenter;
using GxPress.Service.Interface.PlatformData;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace GxPress.Api.AdminControllers
{
///
/// 平台数据
///
[Route("api/admin/platform")]
[ApiController]
[Authorize]
public class AdminPlatformDataController : Controller
{
private readonly IPlatformDataService platformDataService;
public AdminPlatformDataController(IPlatformDataService platformDataService)
{
this.platformDataService = platformDataService;
}
///
/// 平台数据
///
///
[HttpGet("data")]
public async Task GetPlatformDataResult()
{
var result = new PlatformDataResult();
result.PlatformOperationDataResult = await platformDataService.GetPlatformDataAsync();
result.UserIncreaseResult = await platformDataService.GetUserIncreaseResult();
result.UserAreaDistributingResults = await platformDataService.GetUserAreaDistributingResults();
result.UserVipProportionResult = await platformDataService.GetUserVipProportionResult();
result.OnlineUserResult = await platformDataService.GetOnlineUserResult();
result.PlatformContentDataResult = await platformDataService.GetPlatformContentDataResult();
result.ContentTypeDistributingResult = await platformDataService.GetContentTypeDistributingResults();
result.ContentOlogyDistributingResult = new List();
result.PayContentstatisticsResult = await platformDataService.GetPayContentstatisticsResult();
result.ContentIncreaseResult = await platformDataService.GetContentIncreaseResult();
result.PlatformAccumulativeVisitResult = await platformDataService.GetPlatformAccumulativeVisitResult();
result.VisitPortResult = new List();
result.PlatformCommerceResult = await platformDataService.GetPlatformCommerceResult();
result.ContentSaleRankingResults = await platformDataService.GetContentSaleRankingResults();
result.ContentSaleProportionResults = await platformDataService.GetContentSaleProportionResults();
return result;
}
///
/// 内容数据
///
///
[HttpGet("content-data")]
public async Task GetContentDataResult()
{
var result = new ContentDataResult();
result.PlatformContentDataInfoResult = await platformDataService.GetPlatformContentDataInfoResults();
result.ContentTypeDistributingResult = await platformDataService.GetContentTypeDistributingResults();
result.ContentOlogyDistributingResult = new List();
result.PayContentstatisticsResult = await platformDataService.GetPayContentstatisticsResult();
result.ContentIncreaseResult = await platformDataService.GetContentIncreaseResult();
return result;
}
///
/// 访问数据
/// ///
///
[HttpGet("visit-data")]
public async Task GetVisitDataResult()
{
var result = new VisitDataResult();
result.PlatformAccumulativeVisitResult = await platformDataService.GetPlatformAccumulativeVisitResult();
result.VisitPortResult = new List();
result.PlatformTodayVisitResult = await platformDataService.GetPlatformTodayVisitResult();
return result;
}
///
/// 商务数据
///
///
[HttpGet("commerce-data")]
public async Task GetCommerceDataResult()
{
return await platformDataService.GetCommerceDataResult();
}
///
/// 运营数据
///
///
[HttpGet("operation-data")]
public async Task GetOperationDataResult()
{
var result = new OperationDataResult();
result.PlatformOperationDataResult = await platformDataService.GetPlatformDataAsync();
result.UserIncreaseResult = await platformDataService.GetUserIncreaseResult();
result.UserAreaDistributingResults = await platformDataService.GetUserAreaDistributingResults();
result.UserVipProportionResult = await platformDataService.GetUserVipProportionResult();
result.OnlineUserResult = await platformDataService.GetOnlineUserResult();
return result;
}
}
}