|
@@ -8,7 +8,7 @@ namespace molilian.core
|
|
|
{
|
|
{
|
|
|
public partial class UnionParseCore
|
|
public partial class UnionParseCore
|
|
|
{
|
|
{
|
|
|
- public static async Task<ActionResult> UnionParseAsync(string content, string channel, int commerceType, string ip, string oaid, string riskStrategy, int accountid = 0, string clickId = "")
|
|
|
|
|
|
|
+ public static async Task<ActionResult> UnionParseAsync(string content, string channel, int commerceType, string ip, string oaid, string riskStrategy, int launchScene, int accountid = 0, string clickId = "")
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
content = content.Trim();
|
|
content = content.Trim();
|
|
@@ -16,11 +16,11 @@ namespace molilian.core
|
|
|
{
|
|
{
|
|
|
"wemeet" => await WemeetParseAsync(content, ip, oaid),
|
|
"wemeet" => await WemeetParseAsync(content, ip, oaid),
|
|
|
"bdpan" => PanParse(content, ip, oaid),
|
|
"bdpan" => PanParse(content, ip, oaid),
|
|
|
- "jd" => await JdParseAsync(content, commerceType, ip, oaid, accountid, clickId),
|
|
|
|
|
|
|
+ "jd" => await JdParseAsync(content, commerceType, ip, oaid, riskStrategy, launchScene, accountid, clickId),
|
|
|
"ks" => await KsParseAsync(content, commerceType, ip, oaid, accountid),
|
|
"ks" => await KsParseAsync(content, commerceType, ip, oaid, accountid),
|
|
|
"dy" => await DyParseAsync(content, commerceType, ip, oaid),
|
|
"dy" => await DyParseAsync(content, commerceType, ip, oaid),
|
|
|
"pdd" => await PddParseAsync(content, commerceType, ip, oaid, accountid),
|
|
"pdd" => await PddParseAsync(content, commerceType, ip, oaid, accountid),
|
|
|
- "tb" => await TaobaoParseAsync(content, commerceType, ip, oaid, riskStrategy, accountid),
|
|
|
|
|
|
|
+ "tb" => await TaobaoParseAsync(content, commerceType, ip, oaid, riskStrategy, launchScene, accountid),
|
|
|
_ => await DeeplinkParseCore.ParseAsync(content, channel, ip, oaid),
|
|
_ => await DeeplinkParseCore.ParseAsync(content, channel, ip, oaid),
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|
|
@@ -121,7 +121,7 @@ namespace molilian.core
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public static async Task<APIResult> TaobaoParseAsync(string content, int commerceType,
|
|
public static async Task<APIResult> TaobaoParseAsync(string content, int commerceType,
|
|
|
- string ip = "", string oaid = "", string riskStrategy = "",
|
|
|
|
|
|
|
+ string ip = "", string oaid = "", string riskStrategy = "", int launchScene = 0,
|
|
|
int accountid = 0)
|
|
int accountid = 0)
|
|
|
{
|
|
{
|
|
|
bool other_aff = false;
|
|
bool other_aff = false;
|
|
@@ -130,6 +130,7 @@ namespace molilian.core
|
|
|
content = content[..Math.Min(1000, content.Length)];
|
|
content = content[..Math.Min(1000, content.Length)];
|
|
|
var result = AlimamaPlus.GetFormattedObject(content, ip, oaid);
|
|
var result = AlimamaPlus.GetFormattedObject(content, ip, oaid);
|
|
|
result.riskStrategy = riskStrategy;
|
|
result.riskStrategy = riskStrategy;
|
|
|
|
|
+ result.launchScene = launchScene;
|
|
|
|
|
|
|
|
Dictionary<string, long> swData = new();
|
|
Dictionary<string, long> swData = new();
|
|
|
swData.Add("StartNew", 0);
|
|
swData.Add("StartNew", 0);
|
|
@@ -315,7 +316,7 @@ namespace molilian.core
|
|
|
}
|
|
}
|
|
|
//============================== 放弃转链-地区过滤 ==============================
|
|
//============================== 放弃转链-地区过滤 ==============================
|
|
|
|
|
|
|
|
- bool is_ignore2 = AlimamaPlus.ShouldIgnoreRequest(ip, oaid, riskStrategy, out reason);
|
|
|
|
|
|
|
+ bool is_ignore2 = AlimamaPlus.ShouldIgnoreRequest(ip, oaid, riskStrategy, launchScene, out reason);
|
|
|
|
|
|
|
|
if (is_ignore2)
|
|
if (is_ignore2)
|
|
|
{
|
|
{
|
|
@@ -342,7 +343,7 @@ namespace molilian.core
|
|
|
//============================== 放弃转链-没有匹配账号 ==============================
|
|
//============================== 放弃转链-没有匹配账号 ==============================
|
|
|
TkPoolDTO? account = accountid > 0 ?
|
|
TkPoolDTO? account = accountid > 0 ?
|
|
|
await TkPoolCore.GetOneAsync(accountid) :
|
|
await TkPoolCore.GetOneAsync(accountid) :
|
|
|
- await TkPoolCore.GetOneAsync(TkPoolCore.TkAction.parse, isTaobaoUrl, riskStrategy);
|
|
|
|
|
|
|
+ await TkPoolCore.GetOneAsync(TkPoolCore.TkAction.parse, isTaobaoUrl, riskStrategy, launchScene);
|
|
|
if (account == null)
|
|
if (account == null)
|
|
|
{
|
|
{
|
|
|
result.success = false;
|
|
result.success = false;
|
|
@@ -377,7 +378,7 @@ namespace molilian.core
|
|
|
using var cts = new CancellationTokenSource();
|
|
using var cts = new CancellationTokenSource();
|
|
|
cts.CancelAfter(timeout);
|
|
cts.CancelAfter(timeout);
|
|
|
|
|
|
|
|
- var requestTask = Task.Run(() => alimama.UnionParseAsync(ip, oaid, content, commerceType, result, isTaobaoUrl, riskStrategy, cts.Token, swData), cts.Token);
|
|
|
|
|
|
|
+ var requestTask = Task.Run(() => alimama.UnionParseAsync(ip, oaid, content, commerceType, result, isTaobaoUrl, riskStrategy, launchScene, cts.Token, swData), cts.Token);
|
|
|
var delayTask = Task.Delay(timeout, cts.Token);
|
|
var delayTask = Task.Delay(timeout, cts.Token);
|
|
|
var completedTask = await Task.WhenAny(requestTask, delayTask);
|
|
var completedTask = await Task.WhenAny(requestTask, delayTask);
|
|
|
if (completedTask == requestTask)
|
|
if (completedTask == requestTask)
|
|
@@ -459,6 +460,7 @@ namespace molilian.core
|
|
|
result.shortLinkurl,
|
|
result.shortLinkurl,
|
|
|
result.deeplink_url,
|
|
result.deeplink_url,
|
|
|
result.riskStrategy,
|
|
result.riskStrategy,
|
|
|
|
|
+ result.launchScene,
|
|
|
result.content,
|
|
result.content,
|
|
|
result.taoToken,
|
|
result.taoToken,
|
|
|
other_aff,
|
|
other_aff,
|
|
@@ -479,10 +481,13 @@ namespace molilian.core
|
|
|
result.itemName,
|
|
result.itemName,
|
|
|
result.shortLinkurl,
|
|
result.shortLinkurl,
|
|
|
result.deeplink_url,
|
|
result.deeplink_url,
|
|
|
|
|
+ result.riskStrategy,
|
|
|
|
|
+ result.launchScene,
|
|
|
}, code);
|
|
}, code);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public static async Task<APIResult> JdParseAsync(string content, int commerceType, string ip, string oaid,
|
|
public static async Task<APIResult> JdParseAsync(string content, int commerceType, string ip, string oaid,
|
|
|
|
|
+ string riskStrategy = "", int launchScene = 0,
|
|
|
int accountid = 0, string clickId = "", CancellationToken cancellationToken = default)
|
|
int accountid = 0, string clickId = "", CancellationToken cancellationToken = default)
|
|
|
{
|
|
{
|
|
|
var config = TkConfigCore.Get();
|
|
var config = TkConfigCore.Get();
|
|
@@ -490,6 +495,8 @@ namespace molilian.core
|
|
|
var result = JdUnionPlus.GetFormattedObject(content, ip, oaid, clickId);
|
|
var result = JdUnionPlus.GetFormattedObject(content, ip, oaid, clickId);
|
|
|
content = content.UrlDecode();
|
|
content = content.UrlDecode();
|
|
|
result.rawContent = content;
|
|
result.rawContent = content;
|
|
|
|
|
+ result.riskStrategy = riskStrategy;
|
|
|
|
|
+ result.launchScene = launchScene;
|
|
|
bool IfExceptional = false;
|
|
bool IfExceptional = false;
|
|
|
try
|
|
try
|
|
|
{
|
|
{
|
|
@@ -518,7 +525,7 @@ namespace molilian.core
|
|
|
string itemId = null;
|
|
string itemId = null;
|
|
|
|
|
|
|
|
//============================== 放弃转链-地区过滤 ==============================
|
|
//============================== 放弃转链-地区过滤 ==============================
|
|
|
- if (!TestParseCore.InWhitelist(result.ip, result.oaid) && accountid == 0 && JdUnionPlus.ShouldIgnoreRequest(config, ip, oaid, out string reason))
|
|
|
|
|
|
|
+ if (!TestParseCore.InWhitelist(result.ip, result.oaid) && accountid == 0 && JdUnionPlus.ShouldIgnoreRequest(config, ip, oaid, riskStrategy, launchScene, out string reason))
|
|
|
{
|
|
{
|
|
|
result.link_type = JdUnionPlus.GetLinkType(result.shortLinkurl, out out_url, out itemId);
|
|
result.link_type = JdUnionPlus.GetLinkType(result.shortLinkurl, out out_url, out itemId);
|
|
|
|
|
|
|
@@ -574,7 +581,7 @@ namespace molilian.core
|
|
|
|
|
|
|
|
bool is_numeric = result.shortLinkurl.Contains(itemId);
|
|
bool is_numeric = result.shortLinkurl.Contains(itemId);
|
|
|
|
|
|
|
|
- var account = accountid > 0 ? await JdPoolCore.GetOneAsync(accountid, JdPoolCore.JdAction.parse) : await JdPoolCore.GetOneAsync(JdPoolCore.JdAction.parse, is_numeric);
|
|
|
|
|
|
|
+ var account = accountid > 0 ? await JdPoolCore.GetOneAsync(accountid, JdPoolCore.JdAction.parse) : await JdPoolCore.GetOneAsync(JdPoolCore.JdAction.parse, riskStrategy, launchScene, is_numeric);
|
|
|
if (account == null)
|
|
if (account == null)
|
|
|
{
|
|
{
|
|
|
result.success = false;
|
|
result.success = false;
|