Commit 3c9e52b2 by wangonghui

日志添加主和备的区分修改

parent 0b8ca038
......@@ -35,6 +35,13 @@ namespace VIZ.TVP.CBA.Module
private static string httpStr = "http://sportsdata.misports.cn/beitai/api/";
//新的URL
public static string strUrl= AppSetup_InitCBALiteDB.HttpUrlConfigEntity.Url;
/// <summary>
/// true 是主数据来源,false 是备份数据库来源
/// </summary>
public static bool dataFromSource = true ;
//ApplicationDomainEx.HttpUrlConfig.Url;
//ApplicationDomainEx.HttpUrlConfig.Url;
//sd?.Settings["url"].Value.ToString();
......@@ -87,7 +94,14 @@ namespace VIZ.TVP.CBA.Module
string result = JsonHelper.GetResult(TomorrowMatchPath);
Log.Info("明日赛程数据接口新:=======>:" + result);
if (dataFromSource)
{
Log.Info("明日赛程数据接口新:主数据来源 =======>:" + result);
}
else
{
Log.Info("明日赛程数据接口新:备份数据来源 =======>:" + result);
}
JsonSerializerSettings settings = new JsonSerializerSettings();
settings.NullValueHandling = NullValueHandling.Ignore;
dayschedules = JsonConvert.DeserializeObject<Dayschedules>(result, settings);
......@@ -153,9 +167,14 @@ namespace VIZ.TVP.CBA.Module
string newKey = Utils.GetKey(appID, appKey);
var str = JsonHelper.Post(TomorrowMatchPath, dict, newKey);
Log.Info("明日赛程数据接口新:=======>:" + str);
if (dataFromSource)
{
Log.Info($"明日赛程数据接口新:主数据来源:{TomorrowMatchPath}=======>:" + str);
}
else
{
Log.Info($"明日赛程数据接口新:备份数据来源:{TomorrowMatchPath}=======>:" + str);
}
JsonSerializerSettings settings = new JsonSerializerSettings();
settings.NullValueHandling = NullValueHandling.Ignore;
dayschedules = JsonConvert.DeserializeObject<Dayschedules>(str, settings);
......@@ -304,7 +323,14 @@ namespace VIZ.TVP.CBA.Module
settings.NullValueHandling = NullValueHandling.Ignore;
playerSeasonData = JsonConvert.DeserializeObject<PlayerSeasonData>(result,settings);
Log.Info("球员赛季数据的服务器接口地址====>:"+result);
if (dataFromSource)
{
Log.Info($"球员赛季数据的服务器接口地址:主数据来源:{PlayerSeasonDataPath}====>:" + result);
}
else
{
Log.Info($"球员赛季数据的服务器接口地址:备份数据来源:{PlayerSeasonDataPath}====>:" + result);
}
});
return playerSeasonData;
......@@ -372,7 +398,14 @@ namespace VIZ.TVP.CBA.Module
string result = JsonHelper.Post(GameRoundDataPath,dict,newKey);
Log.Info("指定轮数的赛程的服务器接口地址====>:" + result);
if (dataFromSource)
{
Log.Info($"指定轮数的赛程的服务器接口地址:主数据来源:{GameRoundDataPath}====>:" + result);
}
else
{
Log.Info($"指定轮数的赛程的服务器接口地址:备份数据来源:{GameRoundDataPath}====>:" + result);
}
JsonSerializerSettings settings = new JsonSerializerSettings();
settings.NullValueHandling = NullValueHandling.Ignore;
......@@ -443,7 +476,14 @@ namespace VIZ.TVP.CBA.Module
string newKey = Utils.GetKey(appID, appKey);
string result = JsonHelper.Post(OnAirDataPath,dict,newKey);
Log.Info("全量直播数据==>:" + result);
if (dataFromSource)
{
Log.Info($"全量直播数据:主数据来源:{OnAirDataPath}==>" + result);
}
else
{
Log.Info($"全量直播数据:备份数据来源:{OnAirDataPath}==>" + result);
}
JsonSerializerSettings settings = new JsonSerializerSettings();
settings.NullValueHandling = NullValueHandling.Ignore;
......@@ -523,6 +563,15 @@ namespace VIZ.TVP.CBA.Module
string result = JsonHelper.Post(TeamSeasonDataPath,dict,newKey);
Log.Info("球队赛季接口数据==>:" + result);
if(dataFromSource)
{
Log.Info($"球队赛季接口数据:主数据来源:{TeamSeasonDataPath}==>:" + result);
}
else
{
Log.Info($"球队赛季接口数据:备份数据来源:{TeamSeasonDataPath}==>:" + result);
}
JsonSerializerSettings settings = new JsonSerializerSettings();
settings.NullValueHandling = NullValueHandling.Ignore;
teamSeasonData = JsonConvert.DeserializeObject<TeamSeasonData>(result, settings);
......@@ -589,7 +638,14 @@ namespace VIZ.TVP.CBA.Module
string result = JsonHelper.Post(TeamScoreDataPath,dict,newKey);
Log.Info("球队积分排行数据==>:" + result);
if (dataFromSource)
{
Log.Info($"球队积分排行数据:主数据来源:{TeamScoreDataPath}==>:" + result);
}
else
{
Log.Info($"球队积分排行数据:备份数据来源:{TeamScoreDataPath}==>:" + result);
}
JsonSerializerSettings settings = new JsonSerializerSettings();
settings.NullValueHandling = NullValueHandling.Ignore;
......
......@@ -174,6 +174,8 @@ namespace VIZ.TVP.CBA.Module
JsonModel.strUrl = AppSetup_InitCBALiteDB.HttpUrlConfigEntity.Url;
JsonModel.appKey = AppSetup_InitCBALiteDB.HttpUrlConfigEntity.AppKey;
JsonModel.appID = AppSetup_InitCBALiteDB.HttpUrlConfigEntity.AppId;
JsonModel.dataFromSource = true;
}
}
}
......@@ -197,6 +199,8 @@ namespace VIZ.TVP.CBA.Module
JsonModel.strUrl = AppSetup_InitCBALiteDB.HttpUrlConfigEntity.BUrl;
JsonModel.appKey = AppSetup_InitCBALiteDB.HttpUrlConfigEntity.BAppKey;
JsonModel.appID = AppSetup_InitCBALiteDB.HttpUrlConfigEntity.BAppId;
JsonModel.dataFromSource = false;
}
}
}
......
......@@ -1289,7 +1289,7 @@ namespace VIZ.TVP.CBA.Module
//if (SelectMatchItems == null) return;
//ScheduleID = SetMatchDict[SelectMatchItems];
Log.Error(string.Format("teamStatsViewModel:{0}", ScheduleID));
//Log.Error(string.Format("teamStatsViewModel:{0}", ScheduleID));
if (string.IsNullOrEmpty(ScheduleID)) return;
onAirDataModel = JsonModel.PostOnAirData_Path(ScheduleID);
ClearData();
......
......@@ -1286,7 +1286,7 @@ namespace VIZ.TVP.CBA.Module
//if (SelectMatchItems == null) return;
//ScheduleID = SetMatchDict[SelectMatchItems];
Log.Error(string.Format("teamStatsViewModel:{0}", ScheduleID));
//Log.Error(string.Format("teamStatsViewModel:{0}", ScheduleID));
if (string.IsNullOrEmpty(ScheduleID)) return;
onAirDataModel = JsonModel.PostOnAirData_Path(ScheduleID);
ClearData();
......
......@@ -36,6 +36,10 @@ namespace VIZ.TVP.FTB.Module
//public string seasonId = AppSetup_InitLiteDB.HttpUrlConfigEntity.SeasonId;
/// <summary>
/// true 是主数据来源,false 是备份数据库来源
/// </summary>
public static bool dataFromSource = true;
/// <summary>
......@@ -63,8 +67,15 @@ namespace VIZ.TVP.FTB.Module
string newKey = Utils.GetKey(appID, appKey);
var str = JsonHelper.Post(GameRoundDataPath, dict, newKey);
Log.Info("轮次数据接口新:=======>:" + str);
if(dataFromSource)
{
Log.Info($"轮次数据接口新:主数据来源:{GameRoundDataPath}=======>:" + str);
}
else
{
Log.Info($"轮次数据接口新:备份数据来源:{GameRoundDataPath}=======>:" + str);
}
JsonSerializerSettings settings = new JsonSerializerSettings();
settings.NullValueHandling = NullValueHandling.Ignore;
dayschedules = JsonConvert.DeserializeObject<Dayschedules>(str, settings);
......@@ -107,7 +118,15 @@ namespace VIZ.TVP.FTB.Module
string result = JsonHelper.Post(TeamScoreDataPath, dict, newKey);
Log.Info("球队积分排行数据==>:" + result);
if(dataFromSource)
{
Log.Info($"球队积分排行数据:主数据来源:{TeamScoreDataPath}==>:" + result);
}
else
{
Log.Info($"球队积分排行数据:备份数据来源:{TeamScoreDataPath}==>:" + result);
}
JsonSerializerSettings settings = new JsonSerializerSettings();
settings.NullValueHandling = NullValueHandling.Ignore;
......@@ -147,7 +166,15 @@ namespace VIZ.TVP.FTB.Module
string newKey = Utils.GetKey(appID, appKey);
string result = JsonHelper.Post(MatchDataPath, dict, newKey);
Log.Info("足球赛季数据==>" + result);
if (dataFromSource)
{
Log.Info($"足球赛季数据:主数据来源:{MatchDataPath}==>" + result);
}
else
{
Log.Info($"足球赛季数据:备份数据来源:{MatchDataPath}==>" + result);
}
JsonSerializerSettings settings = new JsonSerializerSettings();
settings.NullValueHandling = NullValueHandling.Ignore;
......@@ -192,25 +219,27 @@ namespace VIZ.TVP.FTB.Module
string newKey = Utils.GetKey(appID, appKey);
Log.Info("访问接口开始时间");
string result = JsonHelper.Post(shootPath, dict, newKey);
Log.Info("足球球员射手排行==>" + result);
if (dataFromSource)
{
Log.Info($"足球球员射手排行:主数据来源:{shootPath}==>" + result);
}
else
{
Log.Info($"足球球员射手排行:备份数据来源:{shootPath}==>" + result);
}
JsonSerializerSettings settings = new JsonSerializerSettings();
settings.NullValueHandling = NullValueHandling.Ignore;
Log.Info("序列化json开始时间");
shootPlayerRanks = JsonConvert.DeserializeObject<ShootPlayerRanks>(result, settings);
Log.Info("序列化结束时间");
//var sortPlayerShoot = shootPlayerRanks.playerstats.Take(5).ToList();
//shootPlayerRanks.playerstats = sortPlayerShoot;
});
return shootPlayerRanks;
}
......
......@@ -59,6 +59,7 @@ namespace VIZ.TVP.FTB.Module
JsonModel.strUrl = AppSetup_InitLiteDB.HttpUrlConfigEntity.Url;
JsonModel.appKey = AppSetup_InitLiteDB.HttpUrlConfigEntity.AppKey;
JsonModel.appID = AppSetup_InitLiteDB.HttpUrlConfigEntity.AppId;
JsonModel.dataFromSource = true;
}
}
}
......@@ -82,6 +83,7 @@ namespace VIZ.TVP.FTB.Module
JsonModel.strUrl = AppSetup_InitLiteDB.HttpUrlConfigEntity.BUrl;
JsonModel.appKey = AppSetup_InitLiteDB.HttpUrlConfigEntity.BAppKey;
JsonModel.appID = AppSetup_InitLiteDB.HttpUrlConfigEntity.BAppId;
JsonModel.dataFromSource = false;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment