Commit e74f2fd7 by Neo Turing

优化

parent 540887cc
...@@ -74,15 +74,15 @@ namespace Kivii.Third.Chinaerdos.Entities ...@@ -74,15 +74,15 @@ namespace Kivii.Third.Chinaerdos.Entities
public object OnPullThirdReport() public object OnPullThirdReport()
{ {
//throw new Exception("请使用三六一专用拉取订单接口!"); //throw new Exception("请使用三六一专用拉取订单接口!");
#region 设置缓存1分钟内不能连续请求 //#region 设置缓存1分钟内不能连续请求
var cache = KiviiContext.GetCacheClient(); //var cache = KiviiContext.GetCacheClient();
var cacheKey = KiviiContext.GetUrnKey($"{typeof(ErdosOrder).FullName}.PullOrder:LockedOneMinute"); //var cacheKey = KiviiContext.GetUrnKey($"{typeof(ErdosOrder).FullName}.PullOrder:LockedOneMinute");
var cacheValue = cache.Get<string>(cacheKey); //var cacheValue = cache.Get<string>(cacheKey);
if (!cacheValue.IsNullOrEmpty()) //if (!cacheValue.IsNullOrEmpty())
{ //{
throw new Exception(cacheValue); // throw new Exception(cacheValue);
} //}
#endregion //#endregion
var rtns = new RestfulQueryResponse<ThirdReportOrder>(); var rtns = new RestfulQueryResponse<ThirdReportOrder>();
...@@ -91,7 +91,7 @@ namespace Kivii.Third.Chinaerdos.Entities ...@@ -91,7 +91,7 @@ namespace Kivii.Third.Chinaerdos.Entities
DateTime maxTranslateTime = conn.Scalar<ThirdReportOrder, DateTime>(o => Sql.Max(o.OperateTime), p => p.ThirdType == typeof(ErdosOrder).FullName); DateTime maxTranslateTime = conn.Scalar<ThirdReportOrder, DateTime>(o => Sql.Max(o.OperateTime), p => p.ThirdType == typeof(ErdosOrder).FullName);
//DateTime maxTranslateTime = conn.Scalar<ThirdReportOrder, DateTime>(o => Sql.Max(o.OperateTime)); //DateTime maxTranslateTime = conn.Scalar<ThirdReportOrder, DateTime>(o => Sql.Max(o.OperateTime));
var response = client.PullOrders(Configs._token, Configs._secret, maxTranslateTime); var response = client.PullOrders(Configs._token, Configs._secret, maxTranslateTime);
cache.Set(cacheKey, "一分钟内不可多次查询!", TimeSpan.FromMinutes(1)); //cache.Set(cacheKey, "一分钟内不可多次查询!", TimeSpan.FromMinutes(1));
(response.code != 200).ThrowIfTrue(response.message); (response.code != 200).ThrowIfTrue(response.message);
rtns.Results = new List<ThirdReportOrder>(); rtns.Results = new List<ThirdReportOrder>();
......
...@@ -38,9 +38,9 @@ namespace Kivii.Third.Chinaerdos.Extensions ...@@ -38,9 +38,9 @@ namespace Kivii.Third.Chinaerdos.Extensions
getWtsListRequest.signature = signature; getWtsListRequest.signature = signature;
getWtsListRequest.timestamp = timeStamp; getWtsListRequest.timestamp = timeStamp;
getWtsListRequest.length = length; getWtsListRequest.length = length;
if (beginTime != null && beginTime.Value != DateTime.MinValue) getWtsListRequest.beginTime = beginTime.Value; if (beginTime != null && beginTime.Value != DateTime.MinValue) getWtsListRequest.beginTime = beginTime.Value.ToString("yyyy-MM-dd");
if (endTime != null && endTime.Value != DateTime.MinValue) getWtsListRequest.endTime = endTime.Value; if (endTime != null && endTime.Value != DateTime.MinValue) getWtsListRequest.endTime = endTime.Value.ToString("yyyy-MM-dd");
var response = _client.Get(getWtsListRequest); var response = _client.Get(getWtsListRequest);
return response; return response;
} }
......
...@@ -43,16 +43,22 @@ namespace Kivii.Third.Chinaerdos.Requests ...@@ -43,16 +43,22 @@ namespace Kivii.Third.Chinaerdos.Requests
public string timestamp { get; set; } public string timestamp { get; set; }
[ApiMember(Description = "时间(从)可填")] [ApiMember(Description = "时间(从)可填")]
public DateTime? beginTime { get; set; } public string beginTime { get; set; }
[ApiMember(Description = "时间(到)可填")] [ApiMember(Description = "时间(到)可填")]
public DateTime? endTime { get; set; } public string endTime { get; set; }
[ApiMember(Description = "返回记录数(可填,默认为10)")] [ApiMember(Description = "返回记录数(可填,默认为10)")]
public int length { get; set; } public int length { get; set; }
[ApiMember(Description = "记录偏移量(可填,默认为0)")] [ApiMember(Description = "记录偏移量(可填,默认为0)")]
public int start { get; set; } public int start { get; set; }
/// <summary>
/// 0-草稿,5-品牌待审,10-发送,20-接收,40-取消,100-已完成。默认进行中:10
/// </summary>
[ApiMember(Description = "0-草稿,5-品牌待审,10-发送,20-接收,40-取消,100-已完成。默认进行中:10")]
public int status { get; set; }
} }
/// <summary> /// <summary>
......
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