|
|
@@ -12,7 +12,7 @@ namespace molilian.core
|
|
|
{
|
|
|
public partial class UnionParseCore
|
|
|
{
|
|
|
- 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 = "", string type = "")
|
|
|
+ public static async Task<ActionResult> UnionParseAsync(string content, string channel, int commerceType, string ip, string oaid, string riskStrategy, int launchScene, int accountid = 0, int special_text = -1, string clickId = "", string type = "")
|
|
|
|
|
|
{
|
|
|
content = content.Trim();
|
|
|
@@ -21,9 +21,9 @@ namespace molilian.core
|
|
|
{
|
|
|
return channel switch
|
|
|
{
|
|
|
- "jd" => await DeeplinkJdParseAsync(content, commerceType, ip, oaid, riskStrategy, launchScene, accountid, clickId),
|
|
|
- "pdd" => await DeeplinkPddParseAsync(content, commerceType, ip, oaid, accountid),
|
|
|
- "tb" => await DeeplinkTaobaoParseAsync(content, commerceType, ip, oaid, riskStrategy, launchScene, accountid),
|
|
|
+ "jd" => await DeeplinkJdParseAsync(content, commerceType, ip, oaid, riskStrategy, launchScene, accountid, special_text, clickId),
|
|
|
+ "pdd" => await DeeplinkPddParseAsync(content, commerceType, ip, oaid, accountid, special_text),
|
|
|
+ "tb" => await DeeplinkTaobaoParseAsync(content, commerceType, ip, oaid, riskStrategy, launchScene, accountid, special_text),
|
|
|
};
|
|
|
}
|
|
|
|
|
|
@@ -31,12 +31,12 @@ namespace molilian.core
|
|
|
{
|
|
|
//"wemeet" => await WemeetParseAsync(content, ip, oaid),
|
|
|
//"bdpan" => await PanParseAsync(content, ip, oaid),
|
|
|
- "jd" => await JdParseAsync(content, type, commerceType, ip, oaid, riskStrategy, launchScene, accountid, clickId),
|
|
|
- "ks" => await KsParseAsync(content, commerceType, ip, oaid, accountid),
|
|
|
- "dy" => await DyParseAsync(content, commerceType, ip, oaid),
|
|
|
- "pdd" => await PddParseAsync(content, type, commerceType, ip, oaid, accountid),
|
|
|
- "tb" => await TaobaoParseAsync(content, commerceType, ip, oaid, riskStrategy, launchScene, accountid),
|
|
|
- _ => await DeeplinkParseCore.ParseAsync(content, channel, ip, oaid),
|
|
|
+ "jd" => await JdParseAsync(content, type, commerceType, ip, oaid, riskStrategy, launchScene, accountid, special_text, clickId),
|
|
|
+ "ks" => await KsParseAsync(content, commerceType, ip, oaid, accountid, special_text),
|
|
|
+ "dy" => await DyParseAsync(content, commerceType, ip, oaid, special_text),
|
|
|
+ "pdd" => await PddParseAsync(content, type, commerceType, ip, oaid, accountid, special_text),
|
|
|
+ "tb" => await TaobaoParseAsync(content, commerceType, ip, oaid, riskStrategy, launchScene, accountid, special_text),
|
|
|
+ _ => await DeeplinkParseCore.ParseAsync(content, channel, ip, oaid, special_text),
|
|
|
};
|
|
|
}
|
|
|
//return await DeeplinkParseCore.ParseAsync(content, channel, ip, oaid);
|
|
|
@@ -144,7 +144,7 @@ namespace molilian.core
|
|
|
|
|
|
|
|
|
public static async Task<APIResult> TaobaoParseAsync(string content, int commerceType,
|
|
|
- string ip = "", string oaid = "", string riskStrategy = "", int launchScene = -1,
|
|
|
+ string ip = "", string oaid = "", string riskStrategy = "", int launchScene = -1, int special_text = -1,
|
|
|
int accountid = 0)
|
|
|
{
|
|
|
bool other_aff = false;
|
|
|
@@ -185,25 +185,13 @@ namespace molilian.core
|
|
|
bool is_other = AlimamaPlus.MatchOtherInfo(content, arr2);
|
|
|
|
|
|
|
|
|
- var overrideContent = await OverrideRuleCore.ProcessAsync(content);
|
|
|
+ var overrideContent = await OverrideRuleCore.ProcessAsync("tb", content, ip, oaid, riskStrategy, launchScene, special_text);
|
|
|
if (overrideContent != null)
|
|
|
{
|
|
|
- bool is_ignore = AlimamaPlus.ShouldIgnoreRequest(ip, oaid, riskStrategy, launchScene, out reason);
|
|
|
- if (is_ignore)
|
|
|
- {
|
|
|
- result.success = false;
|
|
|
- result.message = "放弃转链";
|
|
|
- result.itemName = "点击打开淘宝APP";
|
|
|
- result.reason = reason;
|
|
|
- result.subCode = TkSubCodeEnum.TrafficCtrl;
|
|
|
-
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- result.success = true;
|
|
|
- result.deeplink_url = overrideContent.output_text;
|
|
|
- }
|
|
|
+ result.success = true;
|
|
|
+ result.deeplink_url = overrideContent.output_text;
|
|
|
|
|
|
+ _ = TkLogCore.ParseLogAsync(result);
|
|
|
return TaobaoParseOutput(result, swData, new
|
|
|
{
|
|
|
result.success,
|
|
|
@@ -573,7 +561,7 @@ namespace molilian.core
|
|
|
|
|
|
public static async Task<APIResult> JdParseAsync(string content, string type, int commerceType, string ip, string oaid,
|
|
|
string riskStrategy = "", int launchScene = -1,
|
|
|
- int accountid = 0, string clickId = "", CancellationToken cancellationToken = default)
|
|
|
+ int accountid = 0, int special_text = -1, string clickId = "", CancellationToken cancellationToken = default)
|
|
|
{
|
|
|
var config = TkConfigCore.Get();
|
|
|
var result = JdUnionPlus.GetFormattedObject(content, ip, oaid, clickId);
|
|
|
@@ -585,6 +573,18 @@ namespace molilian.core
|
|
|
bool is_hide = false;
|
|
|
try
|
|
|
{
|
|
|
+ var overrideContent = await OverrideRuleCore.ProcessAsync("jd", content, ip, oaid, riskStrategy, launchScene, special_text);
|
|
|
+ if (overrideContent != null)
|
|
|
+ {
|
|
|
+ result.success = true;
|
|
|
+ result.message = "OK";
|
|
|
+ result.commercial = true;
|
|
|
+ result.deeplink_url = overrideContent.output_text;
|
|
|
+
|
|
|
+ _ = TkLogCore.ParseLogAsync(result, is_hide);
|
|
|
+ return JdParseOutput(result);
|
|
|
+ }
|
|
|
+
|
|
|
switch (type)
|
|
|
{
|
|
|
case "goods":
|
|
|
@@ -753,7 +753,7 @@ namespace molilian.core
|
|
|
}
|
|
|
|
|
|
|
|
|
- public static async Task<APIResult> DyParseAsync(string content, int commerceType, string ip, string oaid, CancellationToken cancellationToken = default)
|
|
|
+ public static async Task<APIResult> DyParseAsync(string content, int commerceType, string ip, string oaid, int special_text = -1, CancellationToken cancellationToken = default)
|
|
|
{
|
|
|
var result = DyUnionPlus.GetFormattedObject(content, ip, oaid);
|
|
|
content = content.UrlDecode();
|
|
|
@@ -761,6 +761,16 @@ namespace molilian.core
|
|
|
bool IfExceptional = false;
|
|
|
try
|
|
|
{
|
|
|
+ var overrideContent = await OverrideRuleCore.ProcessAsync("dy", content, ip, oaid, string.Empty, 0, special_text);
|
|
|
+ if (overrideContent != null)
|
|
|
+ {
|
|
|
+ result.success = true;
|
|
|
+ result.message = "OK";
|
|
|
+ result.deeplink_url = overrideContent.output_text;
|
|
|
+
|
|
|
+ _ = TkLogCore.ParseLogAsync(result);
|
|
|
+ return new APIResult(result);
|
|
|
+ }
|
|
|
#if DEBUG
|
|
|
#else
|
|
|
// 2024-06-19 联盟业务下线
|
|
|
@@ -772,6 +782,7 @@ namespace molilian.core
|
|
|
#endif
|
|
|
|
|
|
|
|
|
+
|
|
|
if (DyUnionPlus.ShouldIgnoreRequest(ip, oaid, out string reason))
|
|
|
{
|
|
|
result.success = false;
|
|
|
@@ -836,10 +847,23 @@ namespace molilian.core
|
|
|
}
|
|
|
|
|
|
public static async Task<APIResult> PddParseAsync(string content, string type, int commerceType, string ip, string oaid,
|
|
|
- int accountid = 0, CancellationToken cancellationToken = default)
|
|
|
+ int accountid = 0, int special_text = -1, CancellationToken cancellationToken = default)
|
|
|
{
|
|
|
var result = PddUnionPlus.GetFormattedObject(content, ip, oaid);
|
|
|
|
|
|
+
|
|
|
+ var overrideContent = await OverrideRuleCore.ProcessAsync("pdd", content, ip, oaid, string.Empty, 0, special_text);
|
|
|
+ if (overrideContent != null)
|
|
|
+ {
|
|
|
+ result.success = true;
|
|
|
+ result.message = "OK";
|
|
|
+ result.deeplink_url = overrideContent.output_text;
|
|
|
+
|
|
|
+ _ = TkLogCore.ParseLogAsync(result);
|
|
|
+ return PddParseOutput(result);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
switch (type)
|
|
|
{
|
|
|
case "goods":
|
|
|
@@ -1034,7 +1058,7 @@ namespace molilian.core
|
|
|
|
|
|
|
|
|
public static async Task<APIResult> KsParseAsync(string content, int commerceType, string ip, string oaid,
|
|
|
- int accountid = 0, CancellationToken cancellationToken = default)
|
|
|
+ int accountid = 0, int special_text = -1, CancellationToken cancellationToken = default)
|
|
|
{
|
|
|
var result = KsUnionPlus.GetFormattedObject(content, ip, oaid);
|
|
|
content = content.UrlDecode();
|
|
|
@@ -1044,6 +1068,19 @@ namespace molilian.core
|
|
|
{
|
|
|
var config = TkConfigCore.Get();
|
|
|
|
|
|
+
|
|
|
+ var overrideContent = await OverrideRuleCore.ProcessAsync("ks", content, ip, oaid, string.Empty, 0, special_text);
|
|
|
+ if (overrideContent != null)
|
|
|
+ {
|
|
|
+ result.success = true;
|
|
|
+ result.message = "OK";
|
|
|
+ result.deeplink_url = overrideContent.output_text;
|
|
|
+
|
|
|
+ _ = TkLogCore.ParseLogAsync(result);
|
|
|
+ return KsParseOutput(result);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
if (!string.IsNullOrEmpty(config.ks_blacklist_regular))
|
|
|
{
|
|
|
var blacklist = config.ks_blacklist_regular.Split('\n')
|