using NTMiner.Core.MinerServer; using System; using System.Collections.Generic; using System.Web.Http; namespace NTMiner.Controllers { public class CoinSnapshotController : ApiControllerBase, ICoinSnapshotController { #region LatestSnapshots [Role.Admin] [HttpPost] public GetCoinSnapshotsResponse LatestSnapshots([FromBody]GetCoinSnapshotsRequest request) { if (request == null) { return ResponseBase.InvalidInput("参数错误"); } try { List data = WebApiRoot.CoinSnapshotSet.GetLatestSnapshots( request.Limit, out int totalMiningCount, out int totalOnlineCount) ?? new List(); return GetCoinSnapshotsResponse.Ok(data, totalMiningCount, totalOnlineCount); } catch (Exception e) { Logger.ErrorDebugLine(e); return ResponseBase.ServerError(e.Message); } } #endregion } }