void UrunGetir(int ProducktID) { n11ProductService.GetProductByProductIdRequest ress = new n11ProductService.GetProductByProductIdRequest(); ProductAuthentication.appKey = "66e296ef-ba12-4c7a-8d3f-67027f1e1962"; //api anahtarınız ProductAuthentication.appSecret = "OiVekmVJRKC2wi0X"; //api şifeniz ress.auth = ProductAuthentication; ress.productId = ProducktID; var ahandaURun = porttur.GetProductByProductId(ress); //porttur.GetProductList. //porttur.GetProductList GetProductListRequest getProductListRequest = new GetProductListRequest(); getProductListRequest.auth = ProductAuthentication; n11ProductService.RequestPagingData requestPagingData = new n11ProductService.RequestPagingData(); //requestPagingData.currentPage (currentPageValue); //requestPagingData.setPageSize(pageSizeValue); getProductListRequest.pagingData = requestPagingData; porttur.GetProductList(getProductListRequest); MessageBox.Show(ahandaURun.product.title); }
public ActionResult GetProductListMessage(GetProductListRequest MyRequest) { MyRequest.GetHeaderMessage(); SetSessionData(MyRequest); return View(new GetProductListMessage(MyRequest)); }
public ActionResult GetProductListRequest() { Request MyRequest = new GetProductListRequest(); GetSessionData(ref MyRequest); return(View(MyRequest)); }
public ActionResult List(GetProductListRequest request) { request.Type = UrlDecode(request.Type); if (!String.IsNullOrEmpty(request.Type)) { if (request.Type.ToLower() == "refresh") { return(new RestfulResult { Data = _productDataService.RefreshProduct(new GetProductRefreshRequest { Page = request.Page, Pagesize = request.Pagesize, RefreshTs = request.RefreshTs, Sort = request.Sort, BrandId = request.BrandId, Lat = request.Lat, Lng = request.Lng, TagId = request.TagId, TopicId = request.TopicId, PromotionId = request.PromotionId }) }); } } else { return(new RestfulResult { Data = this._productDataService.GetProductList(request) }); } return(new RestfulResult()); }
public ActionResult Daren(GetProductListRequest request, [FetchUser(KeyName = "userid")] UserModel showUser) { if (System.String.Compare(request.Method, DefineRestfulMethod.List, System.StringComparison.OrdinalIgnoreCase) != 0) { return(new RestfulResult { Data = new ExecuteResult { StatusCode = StatusCode.ClientError, Message = "方法错误" } }); } request.UserModel = showUser; return(new RestfulResult { Data = this._productDataService.GetProductList(request) }); }
public void GetProductListWithProtoBufServClt() { GetProductListRequest request = new GetProductListRequest(); ProductListResponse response = null; using (ProtoBufServiceClient client = new ProtoBufServiceClient(listenOnUrl)) { response = client.Get <ProductListResponse>(request); } if (response != null) { response.PrintDump(); } Console.WriteLine("成功获取所有产品。"); Console.ReadLine(); }
public async override Task <GetProductListResponse> GetProductList(GetProductListRequest request, ServerCallContext context) { var result = (await _mediator.Send(new GetAllRequest())).ToList(); var listProduct = await GetProductResponses(result).ToListAsync(); var response = new GetProductListResponse { StatusCode = 0, Message = string.Empty, ResponseData = new GetProductListResponse.Types.ResponseData { ListProduct = { listProduct } } }; return(response); }
public void UrunlistesiniGetir() { //Authentication authentication = new Authentication(); authentication.appKey = strAppKey; authentication.appSecret = strAppSecret; RequestPagingData requestPagingData = new RequestPagingData(); requestPagingData.currentPage = currentPageValue; requestPagingData.pageSize = pageSizeValue; GetProductListRequest getProductListRequest = new GetProductListRequest(); getProductListRequest.auth = authentication; getProductListRequest.pagingData = requestPagingData; n11ProductService.ProductServicePortService port = new n11ProductService.ProductServicePortService(); GetProductListResponse response = port.GetProductList(getProductListRequest); if (productList == null) { this.productList = response.products.ToList(); } else { productList.AddRange(response.products); } //productList[0].stockItems.stockItem. if (response.pagingData.currentPage != response.pagingData.pageCount - 1) //son sayfaya kadar gidiyoruz { currentPageValue = (int)response.pagingData.currentPage + 1; UrunlistesiniGetir(); } //return productList; }
private static ProductBasic[] getProds() { apiAnahtari1 = "dbd6f8d0-52c1-4675-ab4d-3efc2badb56c"; apiSifresi1 = "iDg6PakWEtkcLrea"; var authentication1 = new n11Api.com.n11.api.Authentication(); authentication1.appKey = apiAnahtari1; //api anahtarınız authentication1.appSecret = apiSifresi1; //api şifeniz GetProductListRequest ProductListRequest = new GetProductListRequest(); ProductListRequest.auth = authentication1; ProductServicePortService port = new ProductServicePortService(); GetProductListResponse response = port.GetProductList(ProductListRequest); var products = response.products; return(products); }
public ProductBasic[] GetProductList() { com.n11Product.api.Authentication authentication = new com.n11Product.api.Authentication { appKey = apiKey, appSecret = apiSecret }; com.n11Product.api.RequestPagingData requestPagingData = new com.n11Product.api.RequestPagingData(); requestPagingData.currentPage = 0; requestPagingData.pageSize = 10; GetProductListRequest getProductListRequest = new GetProductListRequest(); getProductListRequest.auth = authentication; getProductListRequest.pagingData = requestPagingData; ProductServicePortService port = new ProductServicePortService(); GetProductListResponse getProductListResponse = port.GetProductList(getProductListRequest); ProductBasic[] productBasics = getProductListResponse.products; return(productBasics); }
public NegotiatedContentResult <GetProductListResponse> PostGetProductList([FromBody] GetProductListRequest request) { GetProductListResponse resp = _productServices.GetProductList(request); return(Content(HttpStatusCode.OK, resp)); }
public async Task <IActionResult> GetProductList([FromQuery] GetProductListRequest request) { var data = await _repo.GetProductList(request); return(Ok(data)); }
public static void CopyToEntity(Consumer consumer, GetProductListRequest request) { consumer.ConsID = request.user_id; // row_per_page, page_number consumer.AppToken = request.auth_token; }
public GetProductListResponse GetProductList(GetProductListRequest request) { GetProductListResponse response = new GetProductListResponse(); try { if (request.is_admin) { if (!AgentAdminServices.CheckAdmin(request.user_id, request.auth_token, response)) { //_userServices.MakeNouserResponse(response); return(response); } } else { if (!_userServices.CheckAuthUser(request.user_id, request.auth_token)) { _userServices.MakeNouserResponse(response); return(response); } } using (ProductDao dao = new ProductDao()) { List <Product> pList = dao.GetProducts(request.page_number, request.row_per_page); int totalCount = dao.GetTotalCount(); response.product_details = new ProductPagenationDetailsDto(); response.product_details.total_num_products = totalCount; ProductDto[] prodDtos = new ProductDto[pList.Count()]; for (int i = 0; i < pList.Count; i++) { ProductDto dto = new ProductDto(); ProductHelper.CopyFromEntity(dto, pList[i]); prodDtos[i] = dto; response.products = prodDtos; //response.has_exchange = (pList[i].ProductExchanges.Count > 0 ? 1 : 0); //if (response.has_exchange == 1) //{ // if (response.exchange == null) // response.exchange = new List<ExchangeDto>(); // foreach (var item in pList[i].ProductExchanges.ToList()) // { // ExchangeDto exDto = new ExchangeDto(); // ProductHelper.CopyFromEntity(exDto, item); // response.exchange.Add(exDto); // } //} } var reminder = dao.GetRemindersForProducts(); response.has_reminder = (reminder == null ? 0 : 1); ProductHelper.CopyFromEntity(response, reminder); response.has_resource = 1; response.code = 0; response.message = MessagesSource.GetMessage("has.products"); } } catch (Exception ex) { response.MakeExceptionResponse(ex); } return(response); }
/// <summary> /// 获取产品列表 /// </summary> /// <param name="request"></param> /// <returns></returns> public ExecuteResult <ProductCollectionResponse> GetProductList(GetProductListRequest request) { if (request == null) { return(new ExecuteResult <ProductCollectionResponse>(null) { StatusCode = StatusCode.ClientError, Message = "参数错误" }); } int? ruserId; List <int> tagIds = null; if (request.TagId != null) { tagIds = new List <int> { request.TagId.Value }; } if (request.UserModel == null) { ruserId = null; } else { ruserId = request.UserModel.Id; } var filter = new ProductFilter { BrandId = request.BrandId, DataStatus = DataStatus.Normal, ProductName = null, RecommendUser = ruserId, TagIds = tagIds, Timestamp = request.Timestamp, TopicId = request.TopicId, PromotionId = request.PromotionId }; ProductCollectionResponse r; int totalCount; if (request.Version > 2.09) { var produtEntities = _productRepository.Get(request.PagerRequest, out totalCount, request.ProductSortOrder, filter); var response = new ProductCollectionResponse(request.PagerRequest, totalCount) { Products = MappingManager.ProductInfoResponseMapping(produtEntities).ToList() }; r = response; } else { var p = _productRepository.GetPagedList(request.PagerRequest, out totalCount, request.ProductSortOrder, filter); var response = new ProductCollectionResponse(request.PagerRequest, totalCount) { Products = MappingManager.ProductInfoResponseMapping(p).ToList() }; r = response; } var result = new ExecuteResult <ProductCollectionResponse> { Data = r }; return(result); }
//获取产品列表: public ProductListResponse Get(GetProductListRequest request) { ProductListResponse result = ProductLogic.Instance.GetProductList(); return(result); }
public GetProductListResponse GetProductList(GetProductListRequest request) { return(WrapResponse <GetProductListResponse, GetProductListResponseBody>( new ServiceExecutionDelegator <GetProductListResponseBody, GetProductListRequestBody>().ResolveRequest(request.Request, (request.Request.Platform ?? ConfigurationManager.AppSettings["DefaultPlatform"]), ApiServiceName.GetProductList))); }