public IService Create(IDataSyncService info) { IService service = null; long serviceCode = 0; AccessToken token = accessTokenRepository.Get(info.AccessTokenId); if (long.TryParse(info.Code, out serviceCode)) { if (token == null) { throw new ApplicationException("Token can not found."); } // continue... } else { throw new ApplicationException(serviceCode.ToString() + " service code format was warran"); } switch (serviceCode) { case (long)DataSyncServiceCode.com_alibaba_trade_alibaba_trade_getSellerOrderList_1: service = new AlibabaTradeGetSellerOrderListService(token, tradeManager); break; case (long)DataSyncServiceCode.com_alibaba_trade_alibaba_trade_get_sellerView_1: break; } return(service); }
public void Execute(long serviceId) { var syncServiceEntity = _dataSyncServiceRepository.Get(serviceId); var accessToken = _accessTokenRepository.Get(syncServiceEntity.AccessTokenId); IService service = new AlibabaTradeGetSellerOrderListService(accessToken, _tradeManager); service.Execute(); }
public IList <AlibabaOpenplatformTradeModelTradeInfo> GetModificationTradeInfos( long tokenId, DateTime modifyStart, DateTime modifyEnd) { IAccessToken token = accessTokenRepository.Get(tokenId); return(GetModificationTradeInfos(token, modifyStart, modifyEnd)); }
public void InitializeAccessToken_Test() { // Act var list = _accessTokenRepository.GetAllList(); if (list.Count > 0) { var token = _accessTokenRepository.Get(list[0].Id); _accessTokenManager.InitializeToken(token, "079617f6-df6d-4253-b5d1-15ce170dbf10"); } // Assert Assert.True(true); }
public void GetYesterdaySellerOrderListTest() { var token = accessTokenRepository.Get(1); tradeManager.GetYesterdayModificationTradeInfos(token); }