public IActionResult FoodList(string zpShopId) { if (string.IsNullOrEmpty(zpShopId)) { return(Content("商家的id不存在")); } //此处获取的是正品的shopId var shopInfo = _meiTConfigService.GetMeiTConfig(zpShopId); if (shopInfo == null) { return(Content("商家的id不能和美团商户匹配")); } var shopId = shopInfo.ShopId; var appId = shopInfo.AppKey; var appSecret = shopInfo.AppSecret; var result = MeiTProduct.ProductList(_httpClientFactory, shopId, appId, appSecret); try { DealShopProduct(result, shopId); return(Content("数据更新成功")); } catch { return(Content("更新数据失败了联系it处理")); } }
public IActionResult BatchUpdateProduct() { var shopList = _meiTConfigService.AllMetTShop(); try { foreach (var meiTConfig in shopList) { var rsult = MeiTProduct.ProductList(_httpClientFactory, meiTConfig.ShopId); DealShopProduct(rsult, meiTConfig.ShopId); } return(Content("更新成功")); } catch (Exception e) { return(Content("更新数据失败了:" + e.Message)); } }
//public IActionResult Index() //{ // return Ok(); //} public IActionResult ShopBinding() { var shopSave = new SShopSave { app_poi_code = "469911", name = "麻辣盛艳(南京同曦万尚城店)", address = "南京市江宁区双龙大道1351号万尚城负1层", latitude = 31.942698, longitude = 118.821965, phone = "18115158980", shipping_fee = 5, shipping_time = "10:30-21:00", open_level = 1, is_online = 1, third_tag_name = "快餐简餐" }; var result = MeiTProduct.ShopSave(_httpClientFactory, shopSave); return(Content(result)); }