update: 修复 ABTest 解析报错的问题
parent
dfd4b633b7
commit
c0936f094e
|
|
@ -93,6 +93,27 @@ namespace Guru
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region 单元测试
|
||||||
|
|
||||||
|
public static void TestConfig(string json)
|
||||||
|
{
|
||||||
|
var p = ABParamData.Parse(json);
|
||||||
|
if (p == null)
|
||||||
|
{
|
||||||
|
Debug.LogError($"Could not parse config: {json}");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(p.group))
|
||||||
|
{
|
||||||
|
Debug.Log($"ID: <color=#88ff00>{p.id}</color>");
|
||||||
|
Debug.Log($"Group: <color=#88ff00>{p.group}</color>");
|
||||||
|
Debug.Log($"Value: <color=#88ff00>{p.value}</color>");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
[Serializable]
|
[Serializable]
|
||||||
|
|
@ -111,7 +132,7 @@ namespace Guru
|
||||||
p.value = value;
|
p.value = value;
|
||||||
|
|
||||||
// 发现Guru AB测试标志位
|
// 发现Guru AB测试标志位
|
||||||
var dict = JsonMapper.ToObject<Dictionary<string, object>>(value);
|
var dict = JsonMapper.ToObject<Dictionary<string, JsonData>>(value);
|
||||||
if (null != dict)
|
if (null != dict)
|
||||||
{
|
{
|
||||||
foreach (var k in dict.Keys)
|
foreach (var k in dict.Keys)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue