|
@ -4,6 +4,7 @@ using BBWY.Common.Models; |
|
|
using Newtonsoft.Json.Linq; |
|
|
using Newtonsoft.Json.Linq; |
|
|
using System; |
|
|
using System; |
|
|
using System.Collections.Generic; |
|
|
using System.Collections.Generic; |
|
|
|
|
|
using System.Linq; |
|
|
using System.Net.Http; |
|
|
using System.Net.Http; |
|
|
|
|
|
|
|
|
namespace BBWY.Client.APIServices |
|
|
namespace BBWY.Client.APIServices |
|
@ -58,13 +59,19 @@ namespace BBWY.Client.APIServices |
|
|
response.Data.Add(d); |
|
|
response.Data.Add(d); |
|
|
foreach (var jShop in jayShops) |
|
|
foreach (var jShop in jayShops) |
|
|
{ |
|
|
{ |
|
|
if (jShop.Value<long?>("ShopId") == null || string.IsNullOrEmpty(jShop.Value<string>("AppToken"))) |
|
|
var shopId = jShop.Value<long?>("ShopId"); |
|
|
|
|
|
if (shopId == null || string.IsNullOrEmpty(jShop.Value<string>("AppToken"))) |
|
|
continue; //排除未授权
|
|
|
continue; //排除未授权
|
|
|
try |
|
|
try |
|
|
{ |
|
|
{ |
|
|
|
|
|
var jayAccounts = jShop.Value<JArray>("AccountList"); |
|
|
|
|
|
if ((jayAccounts == null || !jayAccounts.HasValues) && d.ShopList.Count(s => s.ShopId == shopId) > 0) |
|
|
|
|
|
{ |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
var shop = new Shop() |
|
|
var shop = new Shop() |
|
|
{ |
|
|
{ |
|
|
ShopId = jShop.Value<long>("ShopId"), |
|
|
ShopId = shopId.Value, |
|
|
AppKey = jShop.Value<string>("AppKey"), |
|
|
AppKey = jShop.Value<string>("AppKey"), |
|
|
AppSecret = jShop.Value<string>("AppSecret"), |
|
|
AppSecret = jShop.Value<string>("AppSecret"), |
|
|
AppToken = jShop.Value<string>("AppToken"), |
|
|
AppToken = jShop.Value<string>("AppToken"), |
|
@ -76,9 +83,7 @@ namespace BBWY.Client.APIServices |
|
|
TeamId = jShop.Value<string>("TeamId") |
|
|
TeamId = jShop.Value<string>("TeamId") |
|
|
}; |
|
|
}; |
|
|
d.ShopList.Add(shop); |
|
|
d.ShopList.Add(shop); |
|
|
var jayAccounts = jShop.Value<JArray>("AccountList"); |
|
|
|
|
|
if (jayAccounts == null || !jayAccounts.HasValues) |
|
|
|
|
|
continue; |
|
|
|
|
|
shop.PurchaseAccountList = new List<PurchaseAccount>(); |
|
|
shop.PurchaseAccountList = new List<PurchaseAccount>(); |
|
|
foreach (var jPurchaseAccount in jayAccounts) |
|
|
foreach (var jPurchaseAccount in jayAccounts) |
|
|
{ |
|
|
{ |
|
@ -89,8 +94,8 @@ namespace BBWY.Client.APIServices |
|
|
AppKey = jPurchaseAccount.Value<string>("AppKey"), |
|
|
AppKey = jPurchaseAccount.Value<string>("AppKey"), |
|
|
AppSecret = jPurchaseAccount.Value<string>("AppSecret"), |
|
|
AppSecret = jPurchaseAccount.Value<string>("AppSecret"), |
|
|
AppToken = jPurchaseAccount.Value<string>("AppToken"), |
|
|
AppToken = jPurchaseAccount.Value<string>("AppToken"), |
|
|
ShopId = shop.ShopId |
|
|
ShopId = shop.ShopId, |
|
|
//PurchasePlatformId = jPurchaseAccount.Value<long>()
|
|
|
PurchasePlatformId = (Platform)jPurchaseAccount.Value<int>("AppPlatformId") |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|