Пример #1
0
 // TODO:异步化
 /// <summary>
 /// 同步方法
 /// </summary>
 /// <returns></returns>
 public DataResponse <List <WalletData> > GetWallets()
 {
     try {
         SignRequest request = new SignRequest {
         };
         DataResponse <List <WalletData> > response = Post <DataResponse <List <WalletData> > >(SControllerName, nameof(IWalletController.Wallets), request.ToQuery(SingleUser.LoginName, SingleUser.PasswordSha1), request, timeout: 2000);
         return(response);
     }
     catch (Exception e) {
         Logger.ErrorDebugLine(e);
         return(null);
     }
 }
 // TODO:异步化
 /// <summary>
 /// 同步方法
 /// </summary>
 /// <returns></returns>
 public List <MineWorkData> GetMineWorks()
 {
     try {
         SignRequest request = new SignRequest {
         };
         DataResponse <List <MineWorkData> > response = Post <DataResponse <List <MineWorkData> > >(SControllerName, nameof(IMineWorkController.MineWorks), request.ToQuery(SingleUser.LoginName, SingleUser.PasswordSha1), request, timeout: 2000);
         if (response != null && response.Data != null)
         {
             return(response.Data);
         }
         return(new List <MineWorkData>());
     }
     catch (Exception e) {
         Logger.ErrorDebugLine(e);
         return(new List <MineWorkData>());
     }
 }
            public void LoginAsync(string loginName, string password, Action <ResponseBase, Exception> callback)
            {
                SignRequest request = new SignRequest()
                {
                };

                PostAsync(SControllerName, nameof(IControlCenterController.LoginControlCenter), request.ToQuery(loginName, password), request, callback);
            }