|
@@ -10,6 +10,7 @@ using Microsoft.AspNetCore.Authentication;
|
|
|
using TencentCloud.Ecm.V20190719.Models;
|
|
using TencentCloud.Ecm.V20190719.Models;
|
|
|
using COSXML.Network;
|
|
using COSXML.Network;
|
|
|
using System.Linq;
|
|
using System.Linq;
|
|
|
|
|
+using static dodohold.core.ZTOExpress.CreateOrderArgs;
|
|
|
|
|
|
|
|
namespace molilian.api.Controllers
|
|
namespace molilian.api.Controllers
|
|
|
{
|
|
{
|
|
@@ -71,7 +72,6 @@ namespace molilian.api.Controllers
|
|
|
return await UnionParseCore.UnionParseAsync(content, channel, ip, oaid);
|
|
return await UnionParseCore.UnionParseAsync(content, channel, ip, oaid);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
[HttpPost]
|
|
[HttpPost]
|
|
|
public async Task<ActionResult> unsafeParse([FromBody] JsonElement form)
|
|
public async Task<ActionResult> unsafeParse([FromBody] JsonElement form)
|
|
|
{
|
|
{
|
|
@@ -86,6 +86,54 @@ namespace molilian.api.Controllers
|
|
|
return await UnionParseCore.UnionParseAsync(content, channel, ip, oaid);
|
|
return await UnionParseCore.UnionParseAsync(content, channel, ip, oaid);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ //[HttpGet]
|
|
|
|
|
+ //public async Task<ActionResult> testParse()
|
|
|
|
|
+ //{
|
|
|
|
|
+ // var ip = "127.0.0.1";
|
|
|
|
|
+ // var oaid = "test-oaid";
|
|
|
|
|
+
|
|
|
|
|
+ // var list = new DBContext.Table("tk_parse_logs")
|
|
|
|
|
+ // .Where("success=1", null)
|
|
|
|
|
+ // .Order("ID DESC")
|
|
|
|
|
+ // .Limit(1000)
|
|
|
|
|
+ // .Select<TkDataDTO>();
|
|
|
|
|
+
|
|
|
|
|
+ // int success_total = 0, error_total = 0;
|
|
|
|
|
+ // foreach (var item in list)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // var result = UnionParseCore.testTaobaoParseAsync(item.rawContent, ip, oaid);
|
|
|
|
|
+ // if (result.success)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // success_total++;
|
|
|
|
|
+ // }
|
|
|
|
|
+ // else
|
|
|
|
|
+ // {
|
|
|
|
|
+ // Console.Write(result);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
+
|
|
|
|
|
+ // var list2 = new DBContext.Table("tk_parse_logs")
|
|
|
|
|
+ // .Where("success=0", null)
|
|
|
|
|
+ // .Order("ID DESC")
|
|
|
|
|
+ // .Limit(100)
|
|
|
|
|
+ // .Select<TkDataDTO>();
|
|
|
|
|
+
|
|
|
|
|
+ // foreach (var item in list2)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // var result = UnionParseCore.testTaobaoParseAsync(item.rawContent, ip, oaid);
|
|
|
|
|
+ // if (result.success)
|
|
|
|
|
+ // {
|
|
|
|
|
+ // Console.Write(result);
|
|
|
|
|
+ // }
|
|
|
|
|
+ // else
|
|
|
|
|
+ // {
|
|
|
|
|
+ // error_total++;
|
|
|
|
|
+
|
|
|
|
|
+ // }
|
|
|
|
|
+ // }
|
|
|
|
|
+ // return new APIResult(new { success_total, error_total });
|
|
|
|
|
+ //}
|
|
|
|
|
+
|
|
|
|
|
|
|
|
[HttpPost]
|
|
[HttpPost]
|
|
|
public async Task<ActionResult> unionCoupon([FromBody] JsonElement form, [FromQuery] string a = "", [FromQuery] int t = 0, [FromQuery] string sign = "")
|
|
public async Task<ActionResult> unionCoupon([FromBody] JsonElement form, [FromQuery] string a = "", [FromQuery] int t = 0, [FromQuery] string sign = "")
|
|
@@ -341,7 +389,7 @@ namespace molilian.api.Controllers
|
|
|
}
|
|
}
|
|
|
catch (Exception ex)
|
|
catch (Exception ex)
|
|
|
{
|
|
{
|
|
|
- new LoggerLibrary("api_error", "parse")
|
|
|
|
|
|
|
+ _ = new LoggerLibrary("api_error", "parse")
|
|
|
.Info(s, s2)
|
|
.Info(s, s2)
|
|
|
.Info($"【taobao】{account_name}", body)
|
|
.Info($"【taobao】{account_name}", body)
|
|
|
.Info(ex.Message, ex.StackTrace)
|
|
.Info(ex.Message, ex.StackTrace)
|
|
@@ -387,7 +435,7 @@ namespace molilian.api.Controllers
|
|
|
result.reason = reason;
|
|
result.reason = reason;
|
|
|
result.rawContent = content;
|
|
result.rawContent = content;
|
|
|
result.rawContent2 = content2;
|
|
result.rawContent2 = content2;
|
|
|
- TkLogCore.LogAsync(result);
|
|
|
|
|
|
|
+ _ = TkLogCore.LogAsync(result);
|
|
|
return new APIResult(result);
|
|
return new APIResult(result);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -399,7 +447,7 @@ namespace molilian.api.Controllers
|
|
|
result.reason = "没有匹配账号";
|
|
result.reason = "没有匹配账号";
|
|
|
result.rawContent = content;
|
|
result.rawContent = content;
|
|
|
result.rawContent2 = content2;
|
|
result.rawContent2 = content2;
|
|
|
- TkLogCore.LogAsync(result);
|
|
|
|
|
|
|
+ _ = TkLogCore.LogAsync(result);
|
|
|
return new APIResult(result);
|
|
return new APIResult(result);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -411,7 +459,7 @@ namespace molilian.api.Controllers
|
|
|
result.reason = "没有匹配账号";
|
|
result.reason = "没有匹配账号";
|
|
|
result.rawContent = content;
|
|
result.rawContent = content;
|
|
|
result.rawContent2 = content2;
|
|
result.rawContent2 = content2;
|
|
|
- TkLogCore.LogAsync(result);
|
|
|
|
|
|
|
+ _ = TkLogCore.LogAsync(result);
|
|
|
return new APIResult(result);
|
|
return new APIResult(result);
|
|
|
}
|
|
}
|
|
|
result = DataokeCore.JdParse(result, api, account, content);
|
|
result = DataokeCore.JdParse(result, api, account, content);
|
|
@@ -419,7 +467,7 @@ namespace molilian.api.Controllers
|
|
|
catch (Exception ex)
|
|
catch (Exception ex)
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
- new LoggerLibrary("api_error")
|
|
|
|
|
|
|
+ _ = new LoggerLibrary("api_error")
|
|
|
.Info(s, s2)
|
|
.Info(s, s2)
|
|
|
.Info("【jd】", body)
|
|
.Info("【jd】", body)
|
|
|
.Info(ex.Message, ex.StackTrace)
|
|
.Info(ex.Message, ex.StackTrace)
|
|
@@ -436,7 +484,7 @@ namespace molilian.api.Controllers
|
|
|
}
|
|
}
|
|
|
result.rawContent = content;
|
|
result.rawContent = content;
|
|
|
result.rawContent2 = content2;
|
|
result.rawContent2 = content2;
|
|
|
- TkLogCore.LogAsync(result);
|
|
|
|
|
|
|
+ _ = TkLogCore.LogAsync(result);
|
|
|
return new APIResult(new
|
|
return new APIResult(new
|
|
|
{
|
|
{
|
|
|
result.success,
|
|
result.success,
|
|
@@ -600,7 +648,7 @@ namespace molilian.api.Controllers
|
|
|
|
|
|
|
|
var ids = data.Select(e => e.Id).ToArray();
|
|
var ids = data.Select(e => e.Id).ToArray();
|
|
|
log.Info(string.Join(',', ids));
|
|
log.Info(string.Join(',', ids));
|
|
|
- log.SaveAsync();
|
|
|
|
|
|
|
+ _ = log.SaveAsync();
|
|
|
|
|
|
|
|
return new APIResult(new
|
|
return new APIResult(new
|
|
|
{
|
|
{
|
|
@@ -644,7 +692,7 @@ namespace molilian.api.Controllers
|
|
|
|
|
|
|
|
var ids = data.Select(e => e.Id).ToArray();
|
|
var ids = data.Select(e => e.Id).ToArray();
|
|
|
log.Info(string.Join(',', ids));
|
|
log.Info(string.Join(',', ids));
|
|
|
- log.SaveAsync();
|
|
|
|
|
|
|
+ _ = log.SaveAsync();
|
|
|
|
|
|
|
|
return new APIResult(new
|
|
return new APIResult(new
|
|
|
{
|
|
{
|