| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- using NTMiner.Controllers;
- using NTMiner.Core.MinerServer;
- using System;
- namespace NTMiner.Services.Official {
- public class NTMinerFileService {
- private readonly string _controllerName = ControllerUtil.GetControllerName<INTMinerFileController>();
- internal NTMinerFileService() {
- }
- #region GetNTMinerFilesAsync
- // ReSharper disable once InconsistentNaming
- public void GetNTMinerFilesAsync(DateTime timestamp, Action<NTMinerFilesResponse, Exception> callback) {
- RpcRoot.JsonRpc.PostAsync(
- _controllerName,
- nameof(INTMinerFileController.GetNTMinerFiles),
- new NTMinerFilesRequest {
- Timestamp = timestamp
- },
- callback);
- }
- #endregion
- #region AddOrUpdateNTMinerFileAsync
- // ReSharper disable once InconsistentNaming
- public void AddOrUpdateNTMinerFileAsync(NTMinerFileData entity, Action<ResponseBase, Exception> callback) {
- DataRequest<NTMinerFileData> request = new DataRequest<NTMinerFileData>() {
- Data = entity
- };
- RpcRoot.JsonRpc.SignPostAsync(
- _controllerName,
- nameof(INTMinerFileController.AddOrUpdateNTMinerFile),
- data: request,
- callback);
- }
- #endregion
- #region RemoveNTMinerFileAsync
- // ReSharper disable once InconsistentNaming
- public void RemoveNTMinerFileAsync(Guid id, Action<ResponseBase, Exception> callback) {
- DataRequest<Guid> request = new DataRequest<Guid>() {
- Data = id
- };
- RpcRoot.JsonRpc.SignPostAsync(
- _controllerName,
- nameof(INTMinerFileController.RemoveNTMinerFile),
- data: request,
- callback);
- }
- #endregion
- }
- }
|